home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / lib / python2.4 / site-packages / _xmlplus / ns.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2006-08-31  |  12.2 KB  |  292 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.4)
  3.  
  4. '''NS module -- XML Namespace constants
  5.  
  6. This module contains the definitions of namespaces (and sometimes other
  7. URI\'s) used by a variety of XML standards.  Each class has a short
  8. all-uppercase name, which should follow any (emerging) convention for
  9. how that standard is commonly used.  For example, ds is almost always
  10. used as the namespace prefixes for items in XML Signature, so DS is the
  11. class name.   Attributes within that class, all uppercase, define symbolic
  12. names (hopefully evocative) for "constants" used in that standard.
  13. '''
  14.  
  15. class XMLNS:
  16.     '''XMLNS, Namespaces in XML
  17.  
  18.     XMLNS (14-Jan-1999) is a W3C Recommendation.  It is specified in
  19.     http://www.w3.org/TR/REC-xml-names
  20.         BASE -- the basic namespace defined by the specification
  21.         XML -- the namespace for XML 1.0
  22.         HTML -- the namespace for HTML4.0
  23.     '''
  24.     BASE = 'http://www.w3.org/2000/xmlns/'
  25.     XML = 'http://www.w3.org/XML/1998/namespace'
  26.     HTML = 'http://www.w3.org/TR/REC-html40'
  27.  
  28.  
  29. class XLINK:
  30.     '''XLINK, XML Linking Language
  31.  
  32.     XLink (v1.0, 27-Jun-2001) is a W3C Recommendation.  It is
  33.     specified in http://www.w3.org/TR/xlink/
  34.     '''
  35.     BASE = 'http://www.w3.org/1999/xlink'
  36.  
  37.  
  38. class SOAP:
  39.     '''SOAP, the Simple Object Access Protocol
  40.  
  41.     SOAP (v1.1, 8-May-2000) is a W3C note.  It is specified in
  42.     http://www.w3.org/TR/SOAP
  43.         ENV -- namespace for the SOAP envelope
  44.         ENC -- namespace for the SOAP encoding in section 5
  45.         ACTOR_NEXT -- the URI for the "next" actor
  46.     (Note that no BASE is defined.)
  47.     '''
  48.     ENV = 'http://schemas.xmlsoap.org/soap/envelope/'
  49.     ENC = 'http://schemas.xmlsoap.org/soap/encoding/'
  50.     ACTOR_NEXT = 'http://schemas.xmlsoap.org/soap/actor/next'
  51.  
  52.  
  53. class DSIG:
  54.     '''DSIG, XML-Signature Syntax and Processing
  55.  
  56.     DSIG (19-Apr-2001) is a W3C Candidate Recommendation.  It is specified
  57.     in http://www.w3.org/TR/xmldsig-core/
  58.         BASE -- the basic namespace defined by the specification
  59.         DIGEST_SHA1 -- The SHA-1 digest method
  60.         DIGEST_MD2 -- The MD2 digest method
  61.         DIGEST_MD5 -- The MD5 digest method
  62.         SIG_DSA_SHA1 -- The DSA/DHA-1 signature method
  63.         SIG_RSA_SHA1 -- The RSA/DHA-1 signature method
  64.         HMAC_SHA1 -- The SHA-1 HMAC method
  65.         ENC_BASE64 -- The Base64 encoding method
  66.         ENVELOPED -- an enveloped XML signature
  67.         C14N  -- XML canonicalization
  68.         C14N_COMM  -- XML canonicalization, retaining comments
  69.         C14N_EXCL  -- XML exclusive canonicalization
  70.         XPATH -- The identifier for an XPATH transform
  71.         XSLT -- The identifier for an XSLT transform
  72.     '''
  73.     BASE = 'http://www.w3.org/2000/09/xmldsig#'
  74.     DIGEST_SHA1 = BASE + 'sha1'
  75.     DIGEST_MD2 = BASE + 'md2'
  76.     DIGEST_MD5 = BASE + 'md5'
  77.     SIG_DSA_SHA1 = BASE + 'dsa-sha1'
  78.     SIG_RSA_SHA1 = BASE + 'rsa-sha1'
  79.     HMAC_SHA1 = BASE + 'hmac-sha1'
  80.     ENC_BASE64 = BASE + 'base64'
  81.     ENVELOPED = BASE + 'enveloped-signature'
  82.     C14N = 'http://www.w3.org/TR/2000/CR-xml-c14n-20010315'
  83.     C14N_COMM = C14N + '#WithComments'
  84.     C14N_EXCL = 'http://www.w3.org/2001/10/xml-exc-c14n#'
  85.     XPATH = 'http://www.w3.org/TR/1999/REC-xpath-19991116'
  86.     XSLT = 'http://www.w3.org/TR/1999/REC-xslt-19991116'
  87.  
  88.  
  89. class ENCRYPTION:
  90.     '''ENCRYPTION, XML-Encryption Syntax and Processing
  91.  
  92.     ENCRYPTION (26-Jun-2001) is a W3C Working Draft.  It is specified in
  93.     http://www.w3.org/TR/xmlenc-core/
  94.         BASE -- the basic namespace defined by the specification
  95.         BLOCK_3DES -- The triple-DES symmetric encryption method
  96.         BLOCK_AES128 -- The 128-bit AES symmetric encryption method
  97.         BLOCK_AES256 -- The 256-bit AES symmetric encryption method
  98.         BLOCK_AES192 -- The 192-bit AES symmetric encryption method
  99.         STREAM_ARCFOUR -- The ARCFOUR symmetric encryption method
  100.         KT_RSA_1_5 -- The RSA v1.5 key transport method
  101.         KT_RSA_OAEP -- The RSA OAEP key transport method
  102.         KA_DH -- The Diffie-Hellman key agreement method
  103.         WRAP_3DES -- The triple-DES symmetric key wrap method
  104.         WRAP_AES128 -- The 128-bit AES symmetric key wrap method
  105.         WRAP_AES256 -- The 256-bit AES symmetric key wrap method
  106.         WRAP_AES192 -- The 192-bit AES symmetric key wrap method
  107.         DIGEST_SHA256 -- The SHA-256 digest method
  108.         DIGEST_SHA512 -- The SHA-512 digest method
  109.         DIGEST_RIPEMD160 -- The RIPEMD-160 digest method
  110.     '''
  111.     BASE = 'http://www.w3.org/2001/04/xmlenc#'
  112.     BLOCK_3DES = BASE + 'des-cbc'
  113.     BLOCK_AES128 = BASE + 'aes128-cbc'
  114.     BLOCK_AES256 = BASE + 'aes256-cbc'
  115.     BLOCK_AES192 = BASE + 'aes192-cbc'
  116.     STREAM_ARCFOUR = BASE + 'arcfour'
  117.     KT_RSA_1_5 = BASE + 'rsa-1_5'
  118.     KT_RSA_OAEP = BASE + 'rsa-oaep-mgf1p'
  119.     KA_DH = BASE + 'dh'
  120.     WRAP_3DES = BASE + 'kw-3des'
  121.     WRAP_AES128 = BASE + 'kw-aes128'
  122.     WRAP_AES256 = BASE + 'kw-aes256'
  123.     WRAP_AES192 = BASE + 'kw-aes192'
  124.     DIGEST_SHA256 = BASE + 'sha256'
  125.     DIGEST_SHA512 = BASE + 'sha512'
  126.     DIGEST_RIPEMD160 = BASE + 'ripemd160'
  127.  
  128.  
  129. class SCHEMA:
  130.     '''SCHEMA, XML Schema
  131.  
  132.     XML Schema (30-Mar-2001) is a W3C candidate recommendation.  It is
  133.     specified in http://www.w3.org/TR/xmlschema-1 (Structures) and
  134.     http://www.w3.org/TR/xmlschema-2 (Datatypes). Schema has been under
  135.     development for a comparitively long time, and other standards have
  136.     at times used earlier drafts.  This class defines the most-used, and
  137.     sets BASE to the latest.
  138.         BASE -- the basic namespace (2001)
  139.         XSD1, XSI1 -- schema and schema-instance for 1999
  140.         XSD2, XSI2 -- schema and schema-instance for October 2000
  141.         XSD3, XSI3 -- schema and schema-instance for 2001
  142.         XSD_LIST -- a sequence of the XSDn values
  143.         XSI_LIST -- a sequence of the XSIn values
  144.     '''
  145.     XSD1 = 'http://www.w3.org/1999/XMLSchema'
  146.     XSD2 = 'http://www.w3.org/2000/10/XMLSchema'
  147.     XSD3 = 'http://www.w3.org/2001/XMLSchema'
  148.     XSD_LIST = [
  149.         XSD1,
  150.         XSD2,
  151.         XSD3]
  152.     XSI1 = 'http://www.w3.org/1999/XMLSchema-instance'
  153.     XSI2 = 'http://www.w3.org/2000/10/XMLSchema-instance'
  154.     XSI3 = 'http://www.w3.org/2001/XMLSchema-instance'
  155.     XSI_LIST = [
  156.         XSI1,
  157.         XSI2,
  158.         XSI3]
  159.     BASE = XSD3
  160.  
  161.  
  162. class XSLT:
  163.     '''XSLT, XSL Transformations
  164.  
  165.     XSLT (16-Nov-1999) is a W3C Recommendation.  It is specified in
  166.     http://www.w3.org/TR/xslt/
  167.         BASE -- the basic namespace defined by this specification
  168.     '''
  169.     BASE = 'http://www.w3.org/1999/XSL/Transform'
  170.  
  171.  
  172. class XPATH:
  173.     '''XPATH, XML Path Language
  174.  
  175.     XPATH (16-Nov-1999) is a W3C Recommendation.  It is specified in
  176.     http://www.w3.org/TR/xpath.  This class is currently empty.
  177.     '''
  178.     pass
  179.  
  180.  
  181. class WSDL:
  182.     '''WSDL, Web Services Description Language
  183.  
  184.     WSDL (V1.1, 15-Mar-2001) is a W3C Note.  It is specified in
  185.     http://www.w3.org/TR/wsdl
  186.         BASE -- the basic namespace defined by this specification
  187.         BIND_SOAP -- SOAP binding for WSDL
  188.         BIND_HTTP -- HTTP GET and POST binding for WSDL
  189.         BIND_MIME -- MIME binding for WSDL
  190.     '''
  191.     BASE = 'http://schemas.xmlsoap.org/wsdl/'
  192.     BIND_SOAP = BASE + 'soap/'
  193.     BIND_HTTP = BASE + 'http/'
  194.     BIND_MIME = BASE + 'mime/'
  195.  
  196.  
  197. class RNG:
  198.     '''RELAX NG, schema language for XML
  199.  
  200.     RELAX NG (03-Dec-2001) is a simple schema languge for XML,
  201.     published under the auspices of OASIS.  The specification, tutorial,
  202.     and other information are available from http://www.relaxng.org.
  203.     '''
  204.     BASE = 'http://relaxng.org/ns/structure/1.0'
  205.  
  206.  
  207. class DCMI:
  208.     """Dublin Core Metadata Initiative
  209.  
  210.     The DCMI defines a commonly-used set of general metadata elements.
  211.     There is a base set of elements, a variety of refinements of
  212.     those, a set of value encodings, and a 'type vocabulary' used to
  213.     describe what something described in metadata actually is (a text,
  214.     a physical object, a collection, etc.).
  215.  
  216.     Documentation on the Dublin Core, including recommendations for
  217.     encoding Dublin Core metadata in XML and HTML/XHTML can be found
  218.     at http://dublincore.org/.
  219.     """
  220.     BASE = 'http://purl.org/dc/'
  221.     DCMES_1_1 = BASE + 'elements/1.1/'
  222.     DCMES = DCMES_1_1
  223.     TERMS = BASE + 'terms/'
  224.     TYPE = BASE + 'dcmitype/'
  225.  
  226.  
  227. class _Namespace:
  228.     """Base class for Namespace classes.
  229.  
  230.     Namespace objects are a convenient way to 'spell' (uri, localName)
  231.     pairs in application code.  A namespace object would be created to
  232.     represent a namespace (URI), and attributes of the namespace
  233.     object would represent the (uri, localName) pairs.
  234.  
  235.     For example, a namespace object would be created by providing the
  236.     URI are any known local names for that namespace to the
  237.     constructor:
  238.  
  239.         xbel = xml.ns.ClosedNamespace(
  240.             'http://www.python.org/topics/xml/xbel/',
  241.             ['xbel', 'title', 'info', 'metadata', 'folder', 'bookmark',
  242.              'desc', 'separator', 'alias'])
  243.  
  244.     Specific (uri, localName) pairs can then be referenced by more
  245.     convenient names:
  246.  
  247.         xbel.title # ==> ('http://www.python.org/topics/xml/xbel/', 'title')
  248.  
  249.     This can be convenient in (for example) SAX ContentHandler
  250.     implementations.
  251.     """
  252.     
  253.     def __init__(self, uri, names):
  254.         d = self.__dict__
  255.         for name in names:
  256.             d[name] = (uri, name)
  257.         
  258.  
  259.  
  260.  
  261. class ClosedNamespace(_Namespace):
  262.     """Namespace that doesn't allow names to be added after instantiation.
  263.  
  264.     This is useful when the set of names for the namespace is known in
  265.     advance; using a ClosedNamespace doesn't allow names to be added
  266.     inadvertently.
  267.     """
  268.     
  269.     def __setattr__(self, name, value):
  270.         raise AttributeError("can't set attributes on a ClosedNamespace")
  271.  
  272.  
  273.  
  274. class OpenNamespace(_Namespace):
  275.     """Namespace that allows names to be added automatically.
  276.  
  277.     When attributes of these objects are referenced, (uri, localName)
  278.     pairs are generated for the name if they don't already exist.
  279.     """
  280.     
  281.     def __init__(self, uri, names = ()):
  282.         _Namespace.__init__(self, uri, names)
  283.         self._OpenNamespace__uri = uri
  284.  
  285.     
  286.     def __getattr__(self, name):
  287.         t = (self._OpenNamespace__uri, name)
  288.         setattr(self, name, t)
  289.         return t
  290.  
  291.  
  292.