ó
ŧ}Lc           @   s?   d  Z  d d l m Z e   Z d   Z d d d     YZ d S(   s  
The sax module contains a collection of classes that provide a
(D)ocument (O)bject (M)odel representation of an XML document.
The goal is to provide an easy, intuative interface for managing XML
documents.  Although, the term, DOM, is used above, this model is
B{far} better.

XML namespaces in suds are represented using a (2) element tuple
containing the prefix and the URI.  Eg: I{('tns', 'http://myns')}

@var encoder: A I{pluggable} XML special character processor used to
    encode/decode strings.
@type encoder: L{Encoder}
iĸĸĸĸ(   t   Encoderc         C   s?   t  |  t  r1 d |  k r1 t |  j d d   Sd |  f Sd S(   s@  
    Split the name into a tuple (I{prefix}, I{name}).  The first element in
    the tuple is I{None} when the name does't have a prefix.
    @param name: A node name containing an optional prefix.
    @type name: basestring
    @return: A tuple containing the (2) parts of I{name}
    @rtype: (I{prefix}, I{name}) 
    t   :i   N(   t
   isinstancet
   basestringt   tuplet   splitt   None(   t   name(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/sax/__init__.pyt   splitPrefix(   s    	t	   Namespacec           B   sĄ   e  Z d  Z d Z d Z d Z d Z e e f Z e	 d d d   Z
 e	 d    Z e	 d	    Z e	 d
    Z e	 d    Z e	 d    Z e	 d    Z RS(   s8   
    The namespace class represents XML namespaces.
    t   xmls$   http://www.w3.org/XML/1998/namespacet   xss    http://www.w3.org/2001/XMLSchemat   xsis)   http://www.w3.org/2001/XMLSchema-instancec         C   s
   | | f S(   N(    (   t   clst   pt   u(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/sax/__init__.pyt   createC   s    c         C   s   | |  j  k S(   N(   t   default(   R   t   ns(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/sax/__init__.pyt   noneG   s    c         C   s2   y$ |  j  |  o" | d j d  SWn n Xt S(   Ni   t	   XMLSchema(   t   w3t   endswitht   False(   R   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/sax/__init__.pyt   xsdK   s
    $c         C   s2   y$ |  j  |  o" | d j d  SWn n Xt S(   Ni   s   XMLSchema-instance(   R   R   R   (   R   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/sax/__init__.pyR   S   s
    $c         C   s   |  j  |  p |  j |  S(   N(   R   R   (   R   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/sax/__init__.pyR   [   s    c         C   s#   y | d j  d  SWn n Xt S(   Ni   s   http://www.w3.org(   t
   startswithR   (   R   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/sax/__init__.pyR   _   s
    c         C   s:   y, t  | t  o* t |  t |  j  k SWn n Xt S(   N(   R   R   t   lenR   R   (   R   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/sax/__init__.pyt   isnsg   s
    ,N(   NN(   s   xmls$   http://www.w3.org/XML/1998/namespace(   s   xss    http://www.w3.org/2001/XMLSchema(   s   xsis)   http://www.w3.org/2001/XMLSchema-instance(   t   __name__t
   __module__t   __doc__R   R   t   xmlnst   xsdnst   xsinst   allt   classmethodR   R   R   R   R   R   R   (    (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/sax/__init__.pyR	   8   s   N(    (   R   t   suds.sax.encR    t   encoderR   R	   (    (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/sax/__init__.pyt   <module>   s   		