ó
h€
\c           @   sŒ  d  d l  Z  d  d l Z d  d l Z d  d l m Z d  d l m Z d  d l m Z m	 Z	 d  d l
 m Z m Z d  d l m Z d  d l m Z d  d l m Z m Z d  d	 l m Z m Z e j e ƒ Z d
 e f d „  ƒ  YZ x… d d d d d d d d d d d d d d d d d d d d d  d! g D]; Z e e  j k rEe n e d" Z e  e e e e ƒ ƒ q*Wd# e f d$ „  ƒ  YZ! d% „  Z" d S(&   iÿÿÿÿN(   t   etree(   t   XMLParseError(   t   absolute_locationt   load_external(   t   as_qnamet
   qname_attr(   t   elements(   t   types(   t   AUTO_IMPORT_NAMESPACESt   xsd_ns(   t   UnresolvedCustomTypet   UnresolvedTypet   tagsc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR      s   t   schemat   importt   includet
   annotationt   elementt
   simpleTypet   complexTypet   simpleContentt   complexContentt   sequencet   groupt   choicet   allt   listt   uniont	   attributet   anyt   anyAttributet   attributeGroupt   restrictiont	   extensiont   notationt   _t   SchemaVisitorc           B   s2  e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d* d	 „ Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  d „  Z! d „  Z" d  „  Z# d! „  Z$ d" „  Z% d# „  Z& d$ „  Z' d% „  Z( d& „  Z) d' „  Z* d( „  Z+ d) „  Z, i e e- j. 6e e- j/ 6e" e- j0 6e e- j1 6e& e- j2 6e e- j3 6d* e- j4 6d* e- j5 6e e- j6 6e e- j7 6e  e- j8 6e e- j9 6e e- j: 6e e- j; 6e e- j< 6e% e- j= 6e' e- j> 6Z? RS(+   sí   Visitor which processes XSD files and registers global elements and
    types in the given schema.

    :param schema:
    :type schema: zeep.xsd.schema.Schema
    :param document:
    :type document: zeep.xsd.schema.SchemaDocument

    c         C   s"   | |  _  | |  _ t ƒ  |  _ d  S(   N(   t   documentR   t   sett	   _includes(   t   selfR   R'   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   __init__.   s    		c         C   s   |  j  j | | ƒ d  S(   N(   R'   t   register_element(   R*   t   qnamet   instance(    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR,   3   s    c         C   s   |  j  j | | ƒ d  S(   N(   R'   t   register_attribute(   R*   t   nameR.   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR/   6   s    c         C   s   |  j  j | | ƒ d  S(   N(   R'   t   register_type(   R*   R-   R.   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR1   9   s    c         C   s   |  j  j | | ƒ d  S(   N(   R'   t   register_group(   R*   R-   R.   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR2   <   s    c         C   s   |  j  j | | ƒ d  S(   N(   R'   t   register_attribute_group(   R*   R-   R.   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR3   ?   s    c         C   s   |  j  j | | ƒ d  S(   N(   R'   t   register_import(   R*   t	   namespaceR'   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR4   B   s    c         C   sG   |  j  j | j ƒ } | s1 t d | j ƒ ‚ n  | |  | | ƒ } | S(   Ns   No visitor defined for %r(   t   visitorst   gett   tagt
   ValueError(   R*   t   nodet   parentt
   visit_funct   result(    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   processE   s
    c         C   sZ   t  | d ƒ } | rV |  j | ƒ } | j d k r7 d  St j | j | |  j d | ƒSd  S(   Nt   refs    http://www.w3.org/2001/XMLSchemat
   array_type(   R   t   _create_qnameR5   t   xsd_elementst   RefAttributeR8   R   (   R*   R:   R@   R?   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   process_ref_attributeL   s    c         K   sª   t  | d ƒ } | s d  S| j t j k r7 t j } nZ | j t j k rU t j } n< | j t j k rs t j	 } n | j t j
 k r‘ t j } n  | | j | |  j |  S(   NR?   (   R   R8   R   R   RB   t
   RefElementR   RC   R   t   RefGroupR!   t   RefAttributeGroupR   (   R*   R:   t   kwargsR?   t   cls(    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   process_referenceY   s    c         C   s   | d k	 s t ‚ | j d ƒ |  j _ | j d d ƒ |  j _ | j d d ƒ |  j _ x! | D] } |  j | d | ƒq^ Wd S(   sÉ  Visit the xsd:schema element and process all the child elements

        Definition::

            <schema
              attributeFormDefault = (qualified | unqualified): unqualified
              blockDefault = (#all | List of (extension | restriction | substitution) : ''
              elementFormDefault = (qualified | unqualified): unqualified
              finalDefault = (#all | List of (extension | restriction | list | union): ''
              id = ID
              targetNamespace = anyURI
              version = token
              xml:lang = language
              {any attributes with non-schema Namespace}...>
            Content: (
                (include | import | redefine | annotation)*,
                (((simpleType | complexType | group | attributeGroup) |
                  element | attribute | notation),
                 annotation*)*)
            </schema>

        :param node: The XML node
        :type node: lxml.etree._Element

        t   targetNamespacet   elementFormDefaultt   unqualifiedt   attributeFormDefaultR;   N(   t   Nonet   AssertionErrorR7   R'   t   _target_namespacet   _element_formt   _attribute_formR>   (   R*   R:   t   child(    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   visit_schemah   s    c   	   
   C   s  d } | j d ƒ } | j d ƒ } | rB t | |  j j ƒ } n  | rz |  j j rz t d d |  j j d | j	 ƒ‚ n  |  j
 j j | | ƒ } | r¼ t j d | ƒ |  j | | ƒ | S| rØ | d k rØ d } n  | sö t j d	 d
 | ƒ d St | |  j
 j d |  j
 j ƒ} | j d ƒ } | rf| rf| | k rft d | d |  j j d | j	 ƒ‚ n  |  j
 j | | ƒ } |  j | | ƒ | S(   s¨  

        Definition::

            <import
              id = ID
              namespace = anyURI
              schemaLocation = anyURI
              {any attributes with non-schema Namespace}...>
            Content: (annotation?)
            </import>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        R5   t   schemaLocations[   The attribute 'namespace' must be existent if the importing schema has no target namespace.t   filenamet
   sourcelines   Returning existing schema: %rs$   http://www.w3.org/XML/1998/namespaces   https://www.w3.org/2001/xml.xsds+   Ignoring import statement for namespace %r s   (missing schemaLocation)Nt   settingsRK   sa   The namespace defined on the xsd:import doesn't match the imported targetNamespace located at %r (   RO   R7   R   R'   t	   _base_urlRQ   R   t	   _documentt   locationRX   R   t	   documentst   get_by_namespace_and_locationt   loggert   debugR4   R   t
   _transportRY   t	   _locationt   create_new_document(	   R*   R:   R;   t   schema_nodeR5   R\   R'   t
   schema_tnsR   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   visit_import‹   sH    	c         C   s=  | j  d ƒ s t d ƒ ‚ n  | j  d ƒ } | |  j k r@ d St | |  j j d |  j j d |  j j ƒ} |  j j	 | ƒ | j
 j  d ƒ r‚| j
 j  d ƒ s´ | j j  d ƒ r‚i | j
 j  d ƒ pÓ | j d d 6} | j | j
 ƒ t j | j d | ƒ} x | D] } | j | ƒ q	Wx- | j j ƒ  D] \ } }	 | j | |	 ƒ q0W| j j  d ƒ sy| j d | j d <n  | } n  |  j j }
 |  j j } |  j j } | j  d d	 ƒ |  j _ | j  d
 d	 ƒ |  j _ t | |  j j ƒ |  j _ x! | D] } |  j | d | ƒqøW|
 |  j _ | |  j _ | |  j _ d S(   s‰  

        Definition::

            <include
              id = ID
              schemaLocation = anyURI
              {any attributes with non-schema Namespace}...>
            Content: (annotation?)
            </include>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        RV   s   schemaLocation is requiredNt   base_urlRY   RK   t   nsmapRL   RM   RN   R;   (   R7   t   NotImplementedErrorR)   R   R   Ra   R'   RZ   RY   t   addRh   RO   t   attribt   updateR    t   ElementR8   t   appendt   itemsR(   RR   RS   R   R>   (   R*   R:   R;   R\   Rd   Rh   t   newRT   t   keyt   valuet   element_form_defaultt   attribute_form_defaultRg   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   visit_includeÖ   s@    7&	c         C   s"  | j  t j k } | s- t | ƒ \ } } n d } d } | s‚ | j  t j k rZ d } n  |  j | d | d | ƒ} | r‚ | Sn  | j d |  j j ƒ } | d k s¬ | rÇ t	 | d |  j j
 ƒ } n t j | j d ƒ j ƒ  ƒ } t | ƒ }	 d }
 |	 rld } xf |	 D][ } | j  t j k r(q
q
| j  t j t j f k r
| sPt ‚ |  j | | ƒ }
 q
q
Wn  |
 s«t	 | d ƒ } | rœ|  j | j ƒ }
 q«t j ƒ  }
 n  | j d	 ƒ d
 k } | j d ƒ } t j d | d |
 d | d | d	 | d | d | ƒ } | r|  j | | ƒ n  | S(   sê  

        Definition::

            <element
              abstract = Boolean : false
              block = (#all | List of (extension | restriction | substitution))
              default = string
              final = (#all | List of (extension | restriction))
              fixed = string
              form = (qualified | unqualified)
              id = ID
              maxOccurs = (nonNegativeInteger | unbounded) : 1
              minOccurs = nonNegativeInteger : 1
              name = NCName
              nillable = Boolean : false
              ref = QName
              substitutionGroup = QName
              type = QName
              {any attributes with non-schema Namespace}...>
            Content: (annotation?, (
                      (simpleType | complexType)?, (unique | key | keyref)*))
            </element>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        i   i    t
   min_occurst
   max_occurst   formt	   qualifiedR0   t   typet   nillablet   truet   defaultt   type_t	   is_globalN(   R8   R   R   t   _process_occurs_attrsR   RJ   R7   R'   RR   R   RQ   R    t   QNamet   stripR   RO   R   R   R   RP   R>   t	   _get_typet   textt	   xsd_typest   AnyTypeRB   Rm   R,   (   R*   R:   R;   R   Rv   Rw   R=   t   element_formR-   t   childrent   xsd_typeRr   RT   t	   node_typeR{   R}   R   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   visit_element  sP    		c      	   C   sÍ  | j  t j k } | j d ƒ } | ry t j d | ƒ } | ry | j ƒ  d } t | | j ƒ } t	 | |  j ƒ } qy n  | s¡ |  j
 | d | ƒ} | r¡ | Sn  | j d |  j j ƒ } | d k sË | ræ t | d |  j j ƒ }	 n t j | j d ƒ ƒ }	 |  j t | ƒ ƒ \ }
 } | r8|  j | d | ƒ } n3 t | d ƒ } | r_|  j | ƒ } n t j ƒ  } | j d	 ƒ d
 k } | j d ƒ } t j |	 d | d | d
 | ƒ} | rÉ|  j |	 | ƒ n  | S(   s‰  Declares an attribute.

        Definition::

            <attribute
              default = string
              fixed = string
              form = (qualified | unqualified)
              id = ID
              name = NCName
              ref = QName
              type = QName
              use = (optional | prohibited | required): optional
              {any attributes with non-schema Namespace...}>
            Content: (annotation?, (simpleType?))
            </attribute>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        s+   {http://schemas.xmlsoap.org/wsdl/}arrayTypes   ([^\[]+)i    R@   Rx   Ry   R0   Rz   t   uset   requiredR}   R~   (   R8   R   R   R7   t   ret   matcht   groupsR   Rh   R   RD   R'   RS   R   RQ   R    R   t   _pop_annotationR   t   visit_simple_typeRƒ   R…   R†   RB   t	   AttributeR/   (   R*   R:   R;   R   R@   R   R-   R=   t   attribute_formR0   R   Ro   R‰   RŠ   R   R}   t   attr(    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   visit_attributex  s<    c         C   sT  | j  t j k r* | j d ƒ } t } n | j d d ƒ } t } d } t | | j |  j j	 ƒ } |  j
 t | ƒ ƒ \ } } | d }	 |	 j  t j k rÄ |  j |	 | ƒ } t | | |  j ƒ }
 na |	 j  t j k rë |  j |	 | ƒ }
 n: |	 j  t j k r|  j |	 | ƒ }
 n t d |	 j  ƒ ‚ |
 d k	 s7t ‚ | rP|  j | |
 ƒ n  |
 S(   sÞ  
        Definition::

            <simpleType
              final = (#all | (list | union | restriction))
              id = ID
              name = NCName
              {any attributes with non-schema Namespace}...>
            Content: (annotation?, (restriction | list | union))
            </simpleType>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        R0   t	   Anonymouss(   {http://www.w3.org/2001/XMLSchema}stringi    s   Unexpected child: %rN(   R8   R   R   R7   t   Truet   FalseR   Rh   R'   RQ   R‘   R   R"   t   visit_restriction_simple_typeR
   t
   visit_listR   t   visit_unionRP   RO   R1   (   R*   R:   R;   R0   R   t	   base_typeR-   R   Ro   RT   R‰   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR’   ¿  s*    	
c      	   C   s  g  } d } | j  t j k r6 | j d ƒ } t } n | j d ƒ } t } t | | j |  j j	 ƒ } i d d 6| d 6} t
 | t j f | ƒ }	 d }
 |  j t | ƒ ƒ \ } } | rÆ | d j  n d } | t j k r|  j | d | ƒ \ } } |	 d | d | d	 | d
 | ƒ }
 nß | t j k r[|  j | d | ƒ } |	 d	 | d
 | |  }
 nŸ | råd } | t j t j t j t j f k r¯| j d ƒ } |  j | | ƒ } n  |  j | | ƒ } |	 d | d | d	 | d
 | ƒ }
 n |	 d	 | d
 | ƒ }
 | r|  j | |
 ƒ n  |
 S(   sü  
        Definition::

            <complexType
              abstract = Boolean : false
              block = (#all | List of (extension | restriction))
              final = (#all | List of (extension | restriction))
              id = ID
              mixed = Boolean : false
              name = NCName
              {any attributes with non-schema Namespace...}>
            Content: (annotation?, (simpleContent | complexContent |
                      ((group | all | choice | sequence)?,
                      ((attribute | attributeGroup)*, anyAttribute?))))
            </complexType>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        s)   {http://www.w3.org/2001/XMLSchema}anyTypeR0   s   zeep.xsd.dynamic_typesR   t	   _xsd_namei    t
   attributesR#   R-   R   R   N(   R8   R   R   R7   R˜   R™   R   Rh   R'   RQ   Rz   R…   t   ComplexTypeRO   R‘   R   R   t   visit_simple_contentR   t   visit_complex_contentR   R   R   R   t   popR>   t   _process_attributesR1   (   R*   R:   R;   Rˆ   R   R0   R   R-   t   cls_attributest   xsd_clsR‰   R   t	   first_tagRŸ   RH   R   RT   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   visit_complex_typeî  sH    	
$c         C   s¦   t  | ƒ } | d } | j t j k r\ |  j | | ƒ \ } } } i | d 6| d 6| d 6S| j t j k r¢ |  j | | ƒ \ } } } i | d 6| d 6| d 6Sd S(   s0  The complexContent element defines extensions or restrictions on a
        complex type that contains mixed content or elements only.

        Definition::

            <complexContent
              id = ID
              mixed = Boolean
              {any attributes with non-schema Namespace}...>
            Content: (annotation?,  (restriction | extension))
            </complexContent>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        iÿÿÿÿRŸ   R   R"   R#   N(   R   R8   R   R"   t!   visit_restriction_complex_contentR#   t   visit_extension_complex_content(   R*   R:   R;   Rˆ   RT   t   baseR   RŸ   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR¢   :  s     
c         C   sj   t  | ƒ } | d } | j t j k r8 |  j | | ƒ S| j t j k rZ |  j | | ƒ St d ƒ ‚ d S(   s'  Contains extensions or restrictions on a complexType element with
        character data or a simpleType element as content and contains no
        elements.

        Definition::

            <simpleContent
              id = ID
              {any attributes with non-schema Namespace}...>
            Content: (annotation?, (restriction | extension))
            </simpleContent>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        iÿÿÿÿs!   Expected restriction or extensionN(   R   R8   R   R"   t    visit_restriction_simple_contentR#   t   visit_extension_simple_contentRP   (   R*   R:   R;   Rˆ   RT   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR¡   a  s    
c         C   sk   t  | d ƒ } | r" |  j | ƒ S|  j t | ƒ ƒ \ } } | d j t j k rg |  j | d | ƒ Sd S(   sƒ  
        Definition::

            <restriction
              base = QName
              id = ID
              {any attributes with non-schema Namespace}...>
            Content: (annotation?,
                (simpleType?, (
                    minExclusive | minInclusive | maxExclusive | maxInclusive |
                    totalDigits |fractionDigits | length | minLength |
                    maxLength | enumeration | whiteSpace | pattern)*))
            </restriction>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        R«   i    N(   R   Rƒ   R‘   R   R8   R   R   R’   (   R*   R:   R;   t	   base_nameR   Rˆ   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyRš   ~  s    c         C   s(   t  | d ƒ } |  j | ƒ } | g  f S(   sÅ  
        Definition::

            <restriction
              base = QName
              id = ID
              {any attributes with non-schema Namespace}...>
            Content: (annotation?,
                (simpleType?, (
                    minExclusive | minInclusive | maxExclusive | maxInclusive |
                    totalDigits |fractionDigits | length | minLength |
                    maxLength | enumeration | whiteSpace | pattern)*
                )?, ((attribute | attributeGroup)*, anyAttribute?))
            </restriction>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        R«   (   R   Rƒ   (   R*   R:   R;   R®   R   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR¬   ›  s    c   
      C   sÀ   t  | d ƒ } |  j | ƒ } |  j t | ƒ ƒ \ } } d } g  } | r³ | d }	 |	 j t j t j t j	 t j
 f k rž | j d ƒ |  j |	 | ƒ } n  |  j | | ƒ } n  | | | f S(   sî  

        Definition::

            <restriction
              base = QName
              id = ID
              {any attributes with non-schema Namespace}...>
            Content: (annotation?, (group | all | choice | sequence)?,
                    ((attribute | attributeGroup)*, anyAttribute?))
            </restriction>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        R«   i    N(   R   Rƒ   R‘   R   RO   R8   R   R   R   R   R   R£   R>   R¤   (
   R*   R:   R;   R®   R   R   Rˆ   R   RŸ   RT   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR©   µ  s    
'c   
      C   sÀ   t  | d ƒ } |  j | ƒ } |  j t | ƒ ƒ \ } } d } g  } | r³ | d }	 |	 j t j t j t j	 t j
 f k rž | j d ƒ |  j |	 | ƒ } n  |  j | | ƒ } n  | | | f S(   s	  

        Definition::

            <extension
              base = QName
              id = ID
              {any attributes with non-schema Namespace}...>
            Content: (annotation?, (
                        (group | all | choice | sequence)?,
                        ((attribute | attributeGroup)*, anyAttribute?)))
            </extension>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        R«   i    N(   R   Rƒ   R‘   R   RO   R8   R   R   R   R   R   R£   R>   R¤   (
   R*   R:   R;   R®   R   R   Rˆ   R   RŸ   RT   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyRª   ×  s    
'c         C   sU   t  | d ƒ } |  j | ƒ } |  j t | ƒ ƒ \ } } |  j | | ƒ } | | f S(   s  

        Definition::

            <extension
              base = QName
              id = ID
              {any attributes with non-schema Namespace}...>
            Content: (annotation?, ((attribute | attributeGroup)*, anyAttribute?))
            </extension>
        R«   (   R   Rƒ   R‘   R   R¤   (   R*   R:   R;   R®   R   R   Rˆ   RŸ   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR­   û  s
    c         C   s   d S(   sŒ  Defines an annotation.

        Definition::

            <annotation
              id = ID
              {any attributes with non-schema Namespace}...>
            Content: (appinfo | documentation)*
            </annotation>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        N(    (   R*   R:   R;   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   visit_annotation  s    c         C   s@   t  | ƒ \ } } | j d d ƒ } t j d | d | d | ƒ S(   s„  

        Definition::

            <any
              id = ID
              maxOccurs = (nonNegativeInteger | unbounded) : 1
              minOccurs = nonNegativeInteger : 1
              namespace = "(##any | ##other) |
                List of (anyURI | (##targetNamespace |  ##local))) : ##any
              processContents = (lax | skip | strict) : strict
              {any attributes with non-schema Namespace...}>
            Content: (annotation?)
            </any>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        t   processContentst   strictRw   Rv   t   process_contents(   R€   R7   RB   t   Any(   R*   R:   R;   Rv   Rw   R²   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt	   visit_any!  s
    	c         C   sò   t  j t  j t  j t  j t  j t  j g } t | ƒ \ } } t j	 d | d | ƒ } |  j
 t | ƒ ƒ \ } } xj | D]b }	 |	 j | k r§ |  j d |	 j |	 ƒ ‚ n  |  j |	 | ƒ }
 |
 d k	 sË t ‚ | j |
 ƒ qv Wd | k sî t ‚ | S(   s  
        Definition::

            <sequence
              id = ID
              maxOccurs = (nonNegativeInteger | unbounded) : 1
              minOccurs = nonNegativeInteger : 1
              {any attributes with non-schema Namespace}...>
            Content: (annotation?,
                      (element | group | choice | sequence | any)*)
            </sequence>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        Rv   Rw   s%   Unexpected element %s in xsd:sequenceN(   R   R   R   R   R   R   R   R€   RB   t   SequenceR‘   R   R8   t   _create_errorR>   RO   RP   Rn   (   R*   R:   R;   t	   sub_typesRv   Rw   R=   R   Rˆ   RT   t   item(    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   visit_sequence=  s    	c   	      C   sš   t  j t  j g } t j ƒ  } |  j t | ƒ ƒ \ } } xH | D]@ } | j | k sa t | ƒ ‚ |  j	 | | ƒ } | j
 | ƒ q@ Wd | k s– t ‚ | S(   s  Allows the elements in the group to appear (or not appear) in any
        order in the containing element.

        Definition::

            <all
              id = ID
              maxOccurs= 1: 1
              minOccurs= (0 | 1): 1
              {any attributes with non-schema Namespace...}>
            Content: (annotation?, element*)
            </all>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        N(   R   R   R   RB   t   AllR‘   R   R8   RP   R>   Rn   RO   (	   R*   R:   R;   R·   R=   R   Rˆ   RT   R¸   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt	   visit_allf  s    c         C   sÇ   t  | ƒ \ } } |  j | d | d | ƒ} | r7 | St | d |  j j ƒ } |  j t | ƒ ƒ \ } } | d }	 |  j |	 | ƒ }
 t j	 d | d |
 ƒ } | j
 t j k rÃ |  j | | ƒ n  | S(   s²  Groups a set of element declarations so that they can be
        incorporated as a group into complex type definitions.

        Definition::

            <group
              name= NCName
              id = ID
              maxOccurs = (nonNegativeInteger | unbounded) : 1
              minOccurs = nonNegativeInteger : 1
              name = NCName
              ref = QName
              {any attributes with non-schema Namespace}...>
            Content: (annotation?, (all | choice | sequence))
            </group>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        Rv   Rw   R0   i    RT   (   R€   RJ   R   R'   RQ   R‘   R   R>   RB   t   GroupR8   R   R   R2   (   R*   R:   R;   Rv   Rw   R=   R-   R   Rˆ   RT   R¸   t   elm(    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   visit_group‰  s    
c         C   s_   t  | d ƒ } | r* |  j | j ƒ } n( t | ƒ } | d } |  j | | ƒ } t j | ƒ S(   sö  
        Definition::

            <list
              id = ID
              itemType = QName
              {any attributes with non-schema Namespace}...>
            Content: (annotation?, (simpleType?))
            </list>

        The use of the simpleType element child and the itemType attribute is
        mutually exclusive.

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element


        t   itemTypeiÿÿÿÿ(   R   Rƒ   R„   R   R’   R…   t   ListType(   R*   R:   R;   t	   item_typet   sub_typet   subnodesRT   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR›   ´  s    
c   
      C   s|   t  | ƒ \ } } |  j t | ƒ ƒ \ } } g  } x- | D]% } |  j | | ƒ }	 | j |	 ƒ q: Wt j | d | d | ƒS(   s[  
        Definition::

            <choice
              id = ID
              maxOccurs= (nonNegativeInteger | unbounded) : 1
              minOccurs= nonNegativeInteger : 1
              {any attributes with non-schema Namespace}...>
            Content: (annotation?, (element | group | choice | sequence | any)*)
            </choice>
        Rv   Rw   (   R€   R‘   R   R>   Rn   RB   t   Choice(
   R*   R:   R;   Rv   Rw   R   Rˆ   t   choicesRT   R½   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   visit_choiceÒ  s    c   
      C   s°   | j  d ƒ } g  } | rc x… | j ƒ  D]4 } t | | j ƒ } |  j | ƒ } | j | ƒ q( Wn@ |  j t | ƒ ƒ \ } } g  | D] }	 |  j |	 | ƒ ^ q… } t	 j
 | ƒ S(   sÑ  Defines a collection of multiple simpleType definitions.

        Definition::

            <union
              id = ID
              memberTypes = List of QNames
              {any attributes with non-schema Namespace}...>
            Content: (annotation?, (simpleType*))
            </union>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        t   memberTypes(   R7   t   splitR   Rh   Rƒ   Rn   R‘   R   R’   R…   t	   UnionType(
   R*   R:   R;   t   membersR   t   memberR-   R‰   R   t   t(    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyRœ   é  s    %c         C   s   d S(   sK  Specifies that an attribute or element value (or a combination of
        attribute or element values) must be unique within the specified scope.
        The value must be unique or nil.

        Definition::

            <unique
              id = ID
              name = NCName
              {any attributes with non-schema Namespace}...>
            Content: (annotation?, (selector, field+))
            </unique>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        N(    (   R*   R:   R;   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   visit_unique  s    c   	      C   s„   |  j  | ƒ } | r | St | d |  j j ƒ } |  j t | ƒ ƒ \ } } |  j | | ƒ } t j | | ƒ } |  j	 | | ƒ d S(   sì  
        Definition::

            <attributeGroup
              id = ID
              name = NCName
              ref = QName
              {any attributes with non-schema Namespace...}>
            Content: (annotation?),
                     ((attribute | attributeGroup)*, anyAttribute?))
            </attributeGroup>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        R0   N(
   RJ   R   R'   RQ   R‘   R   R¤   RB   t   AttributeGroupR3   (	   R*   R:   R;   R?   R-   R   Rˆ   RŸ   t   attribute_group(    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   visit_attribute_group  s    c         C   s"   | j  d d ƒ } t j d | ƒ S(   s#  
        Definition::

            <anyAttribute
              id = ID
              namespace = ((##any | ##other) |
                List of (anyURI | (##targetNamespace | ##local))) : ##any
              processContents = (lax | skip | strict): strict
              {any attributes with non-schema Namespace...}>
            Content: (annotation?)
            </anyAttribute>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        R°   R±   R²   (   R7   RB   t   AnyAttribute(   R*   R:   R;   R²   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   visit_any_attribute=  s    c         C   s   d S(   s¢  Contains the definition of a notation to describe the format of
        non-XML data within an XML document. An XML Schema notation declaration
        is a reconstruction of XML 1.0 NOTATION declarations.

        Definition::

            <notation
              id = ID
              name = NCName
              public = Public identifier per ISO 8879
              system = anyURI
              {any attributes with non-schema Namespace}...>
            Content: (annotation?)
            </notation>

        :param node: The XML node
        :type node: lxml.etree._Element
        :param parent: The parent XML node
        :type parent: lxml.etree._Element

        N(    (   R*   R:   R;   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   visit_notationS  s    c         C   s1   | d  k	 s t ‚ |  j | ƒ } t | |  j ƒ S(   N(   RO   RP   RA   R   R   (   R*   R0   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyRƒ   k  s    c         C   s¾   t  | t j ƒ s$ t j | ƒ } n  | j d k rK t j d | j ƒ } n  | j t k rº |  j j | j ƒ rº t j	 d | j ƒ t j
 t j d | j d | j ƒ} |  j | d  ƒ n  | S(   Nt   xmls$   http://www.w3.org/XML/1998/namespaces'   Auto importing missing known schema: %sR5   RV   (   t
   isinstanceR    R   R5   t	   localnameR   R'   t   is_importedR_   R`   Rm   R   t   import_Rf   RO   (   R*   R0   t   import_node(    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyRA   p  s    	c         C   sZ   t  | ƒ s d  g  f S| d j t j k rP |  j | d d  ƒ } | | d f Sd  | f S(   Ni    i   (   t   lenRO   R8   R   R   R¯   (   R*   Ro   R   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR‘   Š  s    
c         C   sw   g  } xj | D]b } | j  t j t j t j f k rV |  j | | ƒ } | j | ƒ q |  j d | j  | ƒ ‚ q W| S(   Ns   Unexpected tag `%s`(   R8   R   R   R!   R    R>   Rn   R¶   (   R*   R:   Ro   RŸ   RT   R   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR¤   “  s    !c         C   s   t  | d |  j j d | j ƒS(   NRW   RX   (   R   R'   Rb   RX   (   R*   t   messageR:   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR¶   ž  s    N(@   R   R   t   __doc__R+   R,   R/   R1   R2   R3   R4   R>   RO   RD   RJ   RU   Rf   Ru   R‹   R–   R’   R¨   R¢   R¡   Rš   R¬   R©   Rª   R­   R¯   R´   R¹   R»   R¾   R›   RÆ   Rœ   RÍ   RÐ   RÒ   RÓ   Rƒ   RA   R‘   R¤   R¶   R   R   R   R   R   R    R   R   R   R   R   R   R   RØ   R   R   R!   R$   R6   (    (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR&   #   sx   											#	K	F	\	G	/	L	'				"	$				)	#	+													















c         C   sU   |  j  d d ƒ } t |  j  d d ƒ ƒ } | d k r? d } n t | ƒ } | | f S(   s)   Process the min/max occurrence indicatorst	   maxOccurst   1t	   minOccurst	   unbounded(   R7   t   int(   R:   Rw   Rv   (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyR€   ¹  s    	(#   t   keywordt   loggingRŽ   t   lxmlR    t   zeep.exceptionsR   t   zeep.loaderR   R   t
   zeep.utilsR   R   t   zeep.xsdR   RB   R   R…   t   zeep.xsd.constR   R	   t   zeep.xsd.types.unresolvedR
   R   t	   getLoggerR   R_   t   objectR   R0   t   kwlistR•   t   setattrR&   R€   (    (    (    sE   /data/av2000/b2b/venv/lib/python2.7/site-packages/zeep/xsd/visitor.pyt   <module>   s6   	ÿ ÿ ÿ ÿ š