
e#]c           @   s[  d  Z  d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l	 Z d d l
 m Z e j e  Z d e j f d     YZ d e f d     YZ d	 e j j j f d
     YZ d e f d     YZ d e f d     YZ d d l Z e j j j d e j f d     Y Z d e f d     YZ d e f d     YZ d S(   s  Helper classes that maintain the content model of XMLSchema in the binding
classes.

L{AttributeUse} and L{ElementDeclaration} record information associated with a binding
class, for example the types of values, the original XML QName or NCName, and
the Python field in which the values are stored.  They also provide the
low-level interface to set and get the corresponding values in a binding
instance.

L{Wildcard} holds content-related information used in the content model.
iN(   t   basis(   t   sixt   AttributeUsec           B   s  e  Z d  Z d Z d Z d Z d Z d Z d Z	 e
 Z e
 Z e
 Z d e
 e
 e
 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 e
 d  Z e
 e  d  Z! RS(   s  A helper class that encapsulates everything we need to know
    about the way an attribute is used within a binding class.

    Attributes are stored internally as pairs C{(provided, value)}, where
    C{provided} is a boolean indicating whether a value for the attribute was
    provided externally, and C{value} is an instance of the attribute
    datatype.  The C{provided} flag is used to determine whether an XML
    attribute should be added to a created DOM node when generating the XML
    corresponding to a binding instance.
    c	   	      C   s   | |  _  | |  _ | |  _ | |  _ | |  _ |  j d k	 r] |  j j |  j d t |  _ n  | |  _	 | |  _
 | |  _ t t |   j   d S(   s9	  Create an AttributeUse instance.

        @param name: The name by which the attribute is referenced in the XML
        @type name: L{pyxb.namespace.ExpandedName}

        @param id: The Python identifier for the attribute within the
        containing L{pyxb.basis.binding.complexTypeDefinition}.  This is a
        public identifier, derived from the local part of the attribute name
        and modified to be unique, and is usually used as the name of the
        attribute's inspector method.
        @type id: C{str}

        @param key: The string used to store the attribute
        value in the dictionary of the containing
        L{pyxb.basis.binding.complexTypeDefinition}.  This is mangled so
        that it is unique among and is treated as a Python private member.
        @type key: C{str}

        @param data_type: The class reference to the subclass of
        L{pyxb.binding.basis.simpleTypeDefinition} of which the attribute
        values must be instances.
        @type data_type: C{type}

        @keyword unicode_default: The default value of the attribute as
        specified in the schema, or None if there is no default attribute
        value.  The default value (of the keyword) is C{None}.
        @type unicode_default: C{unicode}

        @keyword fixed: If C{True}, indicates that the attribute, if present,
        must have the value that was given via C{unicode_default}.  The
        default value is C{False}.
        @type fixed: C{bool}

        @keyword required: If C{True}, indicates that the attribute must appear
        in the DOM node used to create an instance of the corresponding
        L{pyxb.binding.basis.complexTypeDefinition}.  The default value is
        C{False}.  No more that one of L{required} and L{prohibited} should be
        assigned C{True}.
        @type required: C{bool}

        @keyword prohibited: If C{True}, indicates that the attribute must
        B{not} appear in the DOM node used to create an instance of the
        corresponding L{pyxb.binding.basis.complexTypeDefinition}.  The
        default value is C{False}.  No more that one of L{required} and
        L{prohibited} should be assigned C{True}.
        @type prohibited: C{bool}

        @raise pyxb.SimpleTypeValueError: the L{unicode_default} cannot be used
        to initialize an instance of L{data_type}
        t	   _from_xmlN(   t   _AttributeUse__namet   _AttributeUse__idt   _AttributeUse__keyt   _AttributeUse__dataTypet   _AttributeUse__unicodeDefaultt   Nonet   Factoryt   Truet   _AttributeUse__defaultValuet   _AttributeUse__fixedt   _AttributeUse__requiredt   _AttributeUse__prohibitedt   superR   t   __init__(	   t   selft   namet   idt   keyt	   data_typet   unicode_defaultt   fixedt   requiredt
   prohibited(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   O   s    4					!			c         C   s   |  j  S(   sZ   The expanded name of the element.

        @rtype: L{pyxb.namespace.ExpandedName}
        (   R   (   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR      s    c         C   s   |  j  S(   s#   The default value of the attribute.(   R   (   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   defaultValue   s    c         C   s   |  j  S(   s9   C{True} iff the value of the attribute cannot be changed.(   R   (   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR      s    c         C   s   |  j  S(   s3   C{True} iff the attribute must be assigned a value.(   R   (   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR      s    c         C   s   |  j  S(   s7   C{True} iff the attribute must not be assigned a value.(   R   (   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR      s    c         C   s   |  j  |  S(   s  C{True} iff the given instance has been explicitly given a value
        for the attribute.

        This is used for things like only generating an XML attribute
        assignment when a value was originally given (even if that value
        happens to be the default).
        (   t   _AttributeUse__getProvided(   R   t   ctd_instance(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   provided   s    c         C   s   |  j  S(   sz   Tag used within Python code for the attribute.

        This is not used directly in the default code generation template.(   R   (   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR      s    c         C   s   |  j  S(   sI   String used as key within object dictionary when storing attribute value.(   R   (   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR      s    c         C   s   |  j  S(   sl   The subclass of L{pyxb.binding.basis.simpleTypeDefinition} of which any attribute value must be an instance.(   R   (   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   dataType   s    c         C   s   t  | |  j t d f  S(   s  Retrieve the value information for this attribute in a binding instance.

        @param ctd_instance: The instance object from which the attribute is to be retrieved.
        @type ctd_instance: subclass of L{pyxb.binding.basis.complexTypeDefinition}
        @return: C{(provided, value)} where C{provided} is a C{bool} and
        C{value} is C{None} or an instance of the attribute's datatype.

        N(   t   getattrR   t   FalseR	   (   R   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt
   __getValue   s    	c         C   s   |  j  |  d S(   Ni    (   t   _AttributeUse__getValue(   R   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   __getProvided   s    c         C   s;   |  j  r* t j t |  |  j |   n  |  j |  d S(   s1   Get the value of the attribute from the instance.i   (   R   t   pyxbt   ProhibitedAttributeErrort   typeR   R#   (   R   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   value   s    	!c         C   s   t  | |  j | | f  S(   N(   t   setattrR   (   R   R   t	   new_valueR   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt
   __setValue   s    c         C   s   |  j  | |  j t  d S(   s}   Set the value of the attribute in the given instance to be its
        default value, and mark that it has not been provided.N(   t   _AttributeUse__setValueR   R!   (   R   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   reset   s    c         C   s8   |  j  |  \ } } | r4 | j | |  j |  n  |  S(   sR   If this attribute as been set, add the corresponding attribute to the DOM element.(   R#   t   addAttributeR   (   R   t   dom_supportR   t   elementR   R(   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   addDOMAttribute   s    c         C   s   |  j  |  \ } } | d k	 r |  j rK t j t |  |  j |   n  |  j r | r |  j sj t	  t j
 t |  |  j |   n  |  j j |  |  j j |  n* |  j r t j
 t |  |  j |   n  d S(   sz  Validate the instance against the requirements imposed by this
        attribute use.

        There is no return value; calls raise an exception if the content does
        not validate.

        @param ctd_instance : An instance of a complex type definition.

        @raise pyxb.ProhibitedAttributeError: when instance has attribute but must not
        @raise pyxb.MissingAttributeError: when instance lacks attribute but
        must have it (including when a required fixed-value attribute is
        missing).
        @raise pyxb.BatchContentValidationError: when instance has attribute but its value is not acceptable
        N(   R#   R	   R   R%   R&   R'   R   R   R   t   AssertionErrort   MissingAttributeErrorR   t   _CheckValidValuet   XsdConstraintsOK(   R   R   R   R(   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   validate   s    	!!	c         C   s  t  } t | t j j  s" t  | d k ra |  j rX t j	 t
 |  |  j |   n  t } n  |  j r t j t
 |  |  j |   n  | d k	 r | s t | |  j  r |  j j | d | } n  |  j r| |  j k rt j t
 |  |  j |   n  |  j | | |  | S(   s  Set the value of the attribute.

        This validates the value against the data type, creating a new instance if necessary.

        @param ctd_instance: The binding instance for which the attribute
        value is to be set
        @type ctd_instance: subclass of L{pyxb.binding.basis.complexTypeDefinition}
        @param new_value: The value for the attribute
        @type new_value: Any value that is permitted as the input parameter to
        the C{Factory} method of the attribute's datatype.
        @param from_xml: Value C{True} iff the new_value is known to be in
        lexical space and must by converted by the type factory.  If C{False}
        (default) the value is only converted if it is not already an instance
        of the attribute's underlying type.
        R   N(   R   t
   isinstancet   xmlt   domt   NodeR2   R	   R   R%   R3   R'   R   R!   R   R&   R   R
   R   R   t   AttributeChangeErrorR,   (   R   R   R*   t   from_xmlR   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   set   s    	!		!%!c      	   C   s  | r t  j |  j  St |  j t j  s1 t  t  j |  j  d t  j |  j  d |  j j	 d t
 d t  d g } |  j r | j d  n& |  j r | j d  n | j d  |  j d  k	 r| j d	  |  j r | j d
  n | j d  | j d |  j g  n  d j |  S(   Ns   : s    (t	   name_onlyt   user_documentations   ), R   R   t   optionals   , R   t   defaultt   =t    (   R   t	   text_typeR   t
   issubclassR   R    t   _TypeBinding_mixinR2   R   t   _descriptionR   R!   R   t   appendR   R   R	   R   t   extendR   t   join(   R   R>   R?   t   desc(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyRG     s     E			N("   t   __name__t
   __module__t   __doc__R	   R   R   R   R   R   R   R!   R   R   R   R   R   R   R   R   R   R   R   R   R   R#   R   R(   R,   R-   R1   R6   R=   R   RG   (    (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   (   s:   
@						
										t   AutomatonConfigurationc           B   s   e  Z d  Z d Z d Z d Z d Z d   Z d   Z	 d   Z
 d   Z e d  Z d   Z e d  Z d	   Z d
   Z d Z d Z d Z d   Z d d  Z d   Z d   Z RS(   s$  State for a L{pyxb.utils.fac.Automaton} monitoring content for an
    incrementally constructed complex type binding instance.

    @warning: This is not an implementation of
    L{pyxb.utils.fac.Configuration_ABC} because we need the L{step} function
    to return a different type of value.i   c         C   s   | |  _  d  S(   N(   t!   _AutomatonConfiguration__instance(   R   t   instance(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   O  s    c         C   s"   |  j  j j   |  _ d |  _ d S(   s   Reset the automaton to its initial state.

        Subsequent transitions are expected based on candidate content to be
        supplied through the L{step} method.N(   RP   t
   _Automatont   newConfigurationt   _AutomatonConfiguration__cfgR	   t   _AutomatonConfiguration__multi(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR-   R  s    c         C   s5   |  j  d k	 r( |  j d k s$ t  d St |  j  S(   s   Return the number of pending configurations.

        The automaton is deterministic if exactly one configuration is
        available.i   N(   RT   R	   RU   R2   t   len(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   nondeterminismCountZ  s    c         C   s`  | | f } g  } |  j  d k r6 |  j d f g } n
 |  j  } x~ | D]v \ } } | j |  } xX | D]P }	 i  }
 | j |
  } | j |	 j | |
  | |	 j   j |  f f  qi WqG Wt	 |  } d | k r d Sd | k r&d |  _  | d \ |  _ } xT | D] } | |  j
  qWn6 | |  j k rJt j |  j
   n  d |  _ | |  _  | S(   s  Attempt a transition from the current state.

        @param value: the content to be supplied.  For success the value must
        be consistent with the recorded symbol (element or wildcard
        declaration) for a transition from the current automaton state.

        @param element_decl: optional
        L{pyxb.binding.content.ElementDeclaration} that is the preferred
        symbol for the transition.

        @return: the cardinal number of successful transitions from the
        current configuration based on the parameters.i    i   N(    (   RU   R	   RT   t   candidateTransitionst   cloneRH   t   applyt   consumedSymbolt   consumingClosureRV   RP   t   PermittedNondeterminismR%   t"   ContentNondeterminismExceededError(   R   R(   t   element_declt   symt	   new_multit   multit   cfgt   pendingt   candt
   transitiont	   clone_mapt   ccfgt   rvt   actionst   fn(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   stepd  s0    
=			c         C   s  |  j  d k r d S|  j d k s( t  |  j  } | rs t t d   |  j    } d t |  k rs |  j  } qs n  d t |  k  s t  d t |  k  r |  j j } | d k r t	 |  j  } n  t
 j d |  n  | d \ |  _ } d |  _  x | D] } | |  j  q Wd S(   s  Resolve any non-determinism in the automaton state.

        If the automaton has reached a single configuration (was
        deterministic), this does nothing.

        If multiple candidate configurations are available, the best one is
        selected and applied, updating the binding instance with the pending
        content.

        "Best" in this case is determined by optionally eliminating
        configurations that are not accepting, then selecting the path where
        the initial transition sorts highest using the binding sort key (based
        on position in the original schema).

        @keyword prefer_accepting: eliminate non-accepting paths if any
        accepting path is present.Nc         S   s   |  d j    S(   Ni    (   t   isAccepting(   t   _ts(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   <lambda>  s    i    i   s   Multiple accepting paths for %s(   RU   R	   RT   R2   t   listt   filterRV   RP   t   _ExpandedNameR'   t   _logt   warning(   R   t   prefer_acceptingRb   RK   Rj   Rk   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   resolveNondeterminism  s&    		c         C   s   g  } t    } |  j } | d k r3 |  j g } n  xN | D]F } x= | j   D]/ } | | k rM | j |  | j |  qM qM Wq: W| S(   s   Return the sequence of acceptable symbols at this state.

        The list comprises the L{pyxb.binding.content.ElementUse} and
        L{pyxb.binding.content.WildcardUse} instances that are used to
        validate proposed symbols, in preferred order.N(   R=   RU   R	   RT   t   acceptableSymbolsRH   t   add(   R   Ri   t   seenRb   Rc   t   u(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   acceptableContent  s    		c         C   s?   |  j  t  |  j } x | j d k	 r4 | j } q W| j   S(   s   Return C{True} iff the automaton is in an accepting state.

        If the automaton has unresolved nondeterminism, it is resolved first,
        preferring accepting states.N(   Rv   R   RT   t   superConfigurationR	   Rm   (   R   t   raise_if_rejectingRc   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyRm     s
    	c         C   sb   |  j  } x( | j   r3 | j d k	 r3 | j } q W| j   s^ t j |  j | | |   n  | S(   s   Check for incomplete content.

        @raises pyxb.IncompleteElementContentError: if a non-accepting state is found
        @return: the topmost configuration (if accepting)
        N(   RT   Rm   R|   R	   R%   t   IncompleteElementContentErrorRP   (   R   t   symbolst
   symbol_setRc   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   _diagnoseIncompleteContent  s    	c         C   s   |  j  d d  S(   s@   Generate the exception explaining why the content is incomplete.N(   R   R	   (   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   diagnoseIncompleteContent  s    i    c         C   s   d |  _  d  |  _ d  |  _ | j } d  } | j | j k s` | j | j k r | j	 | j k r | j
   } | j | j k r g  |  _ q n  | S(   Ni    (   t/   _AutomatonConfiguration__preferredSequenceIndexR	   t/   _AutomatonConfiguration__preferredPendingSymbolt1   _AutomatonConfiguration__pendingNonElementContentt   _validationConfigt   ALWAYSt   contentInfluencesGenerationt   _ContentTypeTagt	   _CT_MIXEDt
   MIXED_ONLYt   orderedContent(   R   RQ   t   vct   preferred_sequence(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   __resetPreferredSequence  s    				6c         C   sq   | d k r |  j } n  |  j } | d k	 rm x= | | D]. } t | t j j j  r8 | j |  q8 q8 Wn  d S(   sA   Extract non-element content from the sequence and return C{None}.N(	   R	   R   R   R7   R%   t   bindingR    t   NonElementContentRH   (   R   R   t   pit   nect   csym(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   __discardPreferredSequence  s    	c   	      C   s  |  j  } |  j } |  j } | d  k	 rC t j d |  d  |  _ n  x1| d  k rv| t |  k rz |  j | |  } Pn  | | } | d 7} | d  k	 r t | t	 j
 j j  r | j |  qF n  | j | j g   } | j | k r | j | j f } Pn  | d  k rF t j d |  | j | j k r3qF n  | j | j k r[|  j | |  } Pn  t	 j |  j |   qF qF W| |  _  | | f S(   Ns   restoring %si   s   orphan %s in content(   R   R   R   R	   Rs   t   infoRV   t1   _AutomatonConfiguration__discardPreferredSequenceR7   R%   R   R    R   RH   t   gett   elementDeclarationR(   t   IGNORE_ONCEt   orphanElementInContentt   GIVE_UPt   OrphanElementContentErrorRP   (	   R   R   R   R   R   t   psymR   R   t   vals(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   __processPreferredSequence  s:    			

$	c         C   s3  |  j    |  j } g  } |  j } | j } | j   } |  j |  } |  j } d } x| rid }	 d } | d k	 r |  j | | |  \ } } n  | j	 |  }
 x%|
 D]} | j
   } t | t  r | j   } n$ t | t  r d } n t s t  | j |  } | d k rq n  | j | d | f  s>q n  | j d  } | d k	 r|| d k	 r|| j |  g  | (n  | j t j | j | | f  |   | }	 d t |  k r| | =n  Pq W|	 d k rW| d k	 rSt j d |  | j | j k rqX n  | j | j k r2|  j |  } qX n  t  j! |  j | | | |   n  Pn  |	 j" |  } qX W|  j# | |  } | rt  j$ |  j | | |   n  xp | d k	 r|  j | | |  \ } } | d k	 r| j% | j | j f k rt  j& |  j | j'   qqqW| d k	 r/| j |  n  | S(   sw   Implement L{pyxb.binding.basis.complexTypeDefinition._validatedChildren}.

        Go there for the interface.
        i    s   invalid %s in contentN((   R-   RT   RP   R   t
   _symbolSett/   _AutomatonConfiguration__resetPreferredSequenceR   R	   t1   _AutomatonConfiguration__processPreferredSequenceRX   R[   R7   t
   ElementUseR   t   WildcardUseR!   R2   R   t   matcht   popRI   RH   R    t   ElementContentt
   matchValueRV   Rs   R   R   t   invalidElementInContentR   R   R%   t#   InvalidPreferredElementContentErrorRZ   R   t   UnprocessedElementContentErrorR   R   R(   (   R   Rc   R   RQ   R   R   R   R   R   t   selected_xitt
   candidatest   xitR   t   edt   matchesR(   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   sequencedChildren/  st    
						
(
!"N(   RL   RM   RN   R	   RP   RT   RU   R]   R   R-   RW   Rl   R   Rv   R{   R!   Rm   R   R   R   R   R   R   R   R   R   (    (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyRO   0  s*   			
	2.					 t
   _FACSymbolc           B   s8   e  Z d  Z d Z d   Z d   Z d   Z d   Z RS(   s   Base class for L{pyxb.utils.fac.Symbol} instances associated with PyXB content models.

    This holds the location in the schema of the L{ElementUse} or
    L{WildcardUse} and documents the methods expected of its children.c         C   s   |  j  S(   N(   t   _FACSymbol__xsdLocation(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   xsdLocation  s    c         C   s    t  d t |   j f   d S(   s  Return the value accepted by L{match} for this symbol.

        A match for an element declaration might have resulted in a type
        change for the value (converting it to an acceptable type).  There is
        no safe place to cache the compatible value calculated in the match
        while other candidates are being considered, so we need to
        re-calculate it if the transition is taken.

        If the match could not have changed the value, the value from the
        symbol may be returned immediately.s   %s._matchValueN(   t   NotImplementedErrorR'   RL   (   R   R`   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    c         C   s    t  d t |   j f   d S(   s  Create a closure that will apply the value from C{sym} to a to-be-supplied instance.

        This is necessary for non-deterministic automata, where we can't store
        the value into the instance field until we know that the transition
        will be taken:

        @return: A closure that takes a L{complexTypeDefinition} instance and
        stores the value from invoking L{matchValue} on C{sym} into the
        appropriate slot.s   %s._consumingClosureN(   R   R'   RL   (   R   R`   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR\     s    
c         C   s    | |  _  t t |   j   d S(   sm   @param xsd_location: the L{location<pyxb.utils.utility.Location>} of the element use or wildcard declaration.N(   R   R   R   R   (   R   t   xsd_location(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    	N(	   RL   RM   RN   R	   R   R   R   R\   R   (    (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s   			R   c           B   s\   e  Z d  Z d	 Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z d   Z RS(
   st  Information about a schema element declaration reference.

    This is used by the FAC content model to identify the location
    within a schema at which an element use appears.  The L{ElementDeclaration}
    is not sufficient since multiple uses in various schema, possibly in
    different namespaces, may refer to the same declaration but be independent
    uses.
    c         C   s   |  j  S(   sc   Return the L{element declaration<pyxb.binding.content.ElementDeclaration>} associated with the use.(   t   _ElementUse__elementDeclaration(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    c         C   s   |  j  j   S(   s   Return the L{element binding<pyxb.binding.content.ElementDeclaration.elementBinding>} associated with the use.

        Equivalent to L{elementDeclaration}().L{elementBinding()<pyxb.binding.content.ElementDeclaration.elementBinding>}.(   R   t   elementBinding(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    c         C   s   |  j  j   j   S(   s   Return the element type.

        Equivalent to L{elementDeclaration}().L{elementBinding()<pyxb.binding.content.ElementDeclaration.elementBinding>}.L{typeDefinition()<pyxb.binding.basis.element.typeDefinition>}.(   R   R   t   typeDefinition(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    c         C   s#   t  t |   j |  | |  _ d  S(   N(   R   R   R   R   (   R   t   element_declarationR   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    c         C   s7   | \ } } |  j  j | |  \ } } | s3 t  | S(   N(   R   t   _matchesR2   (   R   R`   R(   R_   Ri   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    c         C   s   |  | d  S(   Nc         S   s   | j  j |  | j |   S(   N(   R   t   setOrAppendR   (   t   _instt   _eut   _sy(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyRo     s    (    (   R   R`   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR\     s    c         C   s+   | \ } } |  j  j | |  \ } } | S(   s  Satisfy L{pyxb.utils.fac.SymbolMatch_mixin}.

        Determine whether the proposed content encapsulated in C{symbol} is
        compatible with the element declaration.  If so, the accepted value is
        cached internally and return C{True}; otherwise return C{False}.

        @param symbol: a pair C{(value, element_decl)}.
        L{pyxb.binding.content.ElementDeclaration._matches} is used to
        determine whether the proposed content is compatible with this element
        declaration.(   R   R   (   R   t   symbolR(   R_   Ri   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    c         C   s   d |  j  j   |  j   f S(   Ns	   %s per %s(   R   R   R   (   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   __str__  s    N(   RL   RM   RN   R	   R   R   R   R   R   R   R\   R   R   (    (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s   							R   c           B   sJ   e  Z d  Z d Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 RS(   s  Information about a schema wildcard element.

    This is functionally parallel to L{ElementUse}, but references a
    L{Wildcard} that is unique to this instance.  That L{Wildcard} is not
    incorporated into this class is an artifact of the evolution of PyXB.c         C   s   |  j  S(   N(   t!   _WildcardUse__wildcardDeclaration(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   wildcardDeclaration  s    c         C   s   | \ } } | S(   N(    (   R   R`   R(   R_   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    c         C   s   |  j  |  d  S(   s]   Create a closure that will apply the value accepted by L{match} to a to-be-supplied instance.c         S   s   |  j  |  S(   N(   t   _appendWildcardElement(   R   t   _av(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyRo     s    (   R   (   R   R`   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR\     s    c         C   s   | \ } } |  j  j d |  S(   s  Satisfy L{pyxb.utils.fac.SymbolMatch_mixin}.

        Determine whether the proposed content encapsulated in C{symbol} is
        compatible with the wildcard declaration.  If so, the accepted value
        is cached internally and return C{True}; otherwise return C{False}.

        @param symbol: a pair C{(value, element_decl)}.
        L{pyxb.binding.content.Wildcard.matches} is used to determine whether
        the proposed content is compatible with this wildcard.
        N(   R   R   R	   (   R   R   R(   R_   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   
  s    c         C   s#   t  t |   j |  | |  _ d  S(   N(   R   R   R   R   (   R   t   wildcard_declarationR   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    c         C   s   d |  j    f S(   Ns   xs:any per %s(   R   (   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    N(   RL   RM   RN   R	   R   R   R   R\   R   R   R   (    (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s   					t   _PluralBindingc           B   s   e  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 d d  Z d   Z d d  Z d   Z d   Z d e d  Z d   Z d   Z d   Z d   Z RS(   s   Helper for element content that supports multiple occurences.

    This is an adapter for Python list.  Any operation that can mutate an item
    in the list ensures the stored value is compatible with the element for
    which the list holds values.c         O   sS   | j  d d   } t | t j  s0 t    n  | |  _ g  |  _ |  j |  d  S(   Nt   element_binding(	   R   R	   R7   R    R0   t
   ValueErrort   _PluralBinding__elementBindingt   _PluralBinding__listRI   (   R   t   argst   kwR   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   1  s    		c         C   s   |  j  j |  S(   N(   R   t   compatibleValue(   R   t   v(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt	   __convert9  s    c         C   s   |  j  j   S(   N(   R   t   __len__(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   <  s    c         C   s   |  j  j |  S(   N(   R   t   __getitem__(   R   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   ?  s    c         C   sa   t  | t  rA |  j j | g  | D] } |  j |  ^ q"  n |  j j | |  j |   d  S(   N(   R7   t   sliceR   t   __setitem__t   _PluralBinding__convert(   R   R   R(   t   _v(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   B  s    2c         C   s   |  j  j |  d  S(   N(   R   t   __delitem__(   R   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   H  s    c         C   s   |  j  j   S(   N(   R   t   __iter__(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   K  s    c         C   s   |  j  j   S(   N(   R   t   __reversed__(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   N  s    c         C   s   |  j  j |  S(   N(   R   t   __contains__(   R   t   item(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   Q  s    c         C   s   |  j  j |  j |   d  S(   N(   R   RH   R   (   R   t   x(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyRH   U  s    c         C   s    |  j  j t |  j |   d  S(   N(   R   RI   t   mapR   (   R   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyRI   X  s    c         C   s   |  j  j |  S(   N(   R   t   count(   R   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   [  s    i    ic         C   s   |  j  j | | |  S(   N(   R   t   index(   R   R   t   it   j(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   ^  s    c         C   s    |  j  j | |  j |   d  S(   N(   R   t   insertR   (   R   R   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   a  s    c         C   s   |  j  j |  S(   N(   R   R   (   R   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   d  s    c         C   s   |  j  j |  d  S(   N(   R   t   remove(   R   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   g  s    c         C   s   |  j  j   d  S(   N(   R   t   reverse(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   j  s    c         C   s   |  j  j d | d |  d  S(   NR   R   (   R   t   sort(   R   R   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   m  s    c         C   s   |  j  j   S(   N(   R   R   (   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   p  s    c         C   s   t  |  j  S(   N(   t   hasht   __list__(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   __hash__s  s    c         C   sB   | d  k r t St | t  r2 |  j j | j  S|  j j |  S(   N(   R	   R!   R7   R   R   t   __eq__(   R   t   other(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   v  s
    c         C   sB   | d  k r t St | t  r2 |  j j | j  S|  j j |  S(   N(   R	   R!   R7   R   R   t   __lt__(   R   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   }  s
    N(   RL   RM   RN   R	   R   R   R   R   R   R   R   R   R   R   R   RH   RI   R   R   R   R   R   R   R!   R   R   R   R   R   (    (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   &  s2   																		t   ElementDeclarationc           B   s   e  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 e Z d d  Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z e e d  Z d   Z d   Z RS(   s?  Aggregate the information relevant to an element of a complex type.

    This includes the L{original tag name<name>}, the spelling of L{the
    corresponding object in Python <id>}, an L{indicator<isPlural>} of whether
    multiple instances might be associated with the field, and other relevant
    information.
    c         C   s   |  j  S(   s   The L{location<pyxb.utils.utility.Location>} in the schema where the
        element was declared.

        Note that this is not necessarily the same location as its use.(   t    _ElementDeclaration__xsdLocation(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    c         C   s   |  j  S(   sZ   The expanded name of the element.

        @rtype: L{pyxb.namespace.ExpandedName}
        (   t   _ElementDeclaration__name(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    c         C   s   |  j  S(   s   The string name of the binding class field used to hold the element
        values.

        This is the user-visible name, and excepting disambiguation will be
        equal to the local name of the element.(   t   _ElementDeclaration__id(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    c         C   s   |  j  S(   ss   The L{basis.element} instance identifying the information
        associated with the element declaration.
        (   t#   _ElementDeclaration__elementBinding(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    c         C   s   | |  _  |  S(   N(   R   (   R   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   _setElementBinding  s    	c         C   s   |  j  S(   s"  True iff the content model indicates that more than one element
        can legitimately belong to this use.

        This includes elements in particles with maxOccurs greater than one,
        and when multiple elements with the same NCName are declared in the
        same type.
        (   t   _ElementDeclaration__isPlural(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   isPlural  s    c         C   sD   | |  _  | |  _ | |  _ | |  _ | |  _ t t |   j   d S(   s  Create an ElementDeclaration instance.

        @param name: The name by which the element is referenced in the XML
        @type name: L{pyxb.namespace.ExpandedName}

        @param id: The Python name for the element within the containing
        L{pyxb.basis.binding.complexTypeDefinition}.  This is a public
        identifier, albeit modified to be unique, and is usually used as the
        name of the element's inspector method or property.
        @type id: C{str}

        @param key: The string used to store the element
        value in the dictionary of the containing
        L{pyxb.basis.binding.complexTypeDefinition}.  This is mangled so
        that it is unique among and is treated as a Python private member.
        @type key: C{str}

        @param is_plural: If C{True}, documents for the corresponding type may
        have multiple instances of this element.  As a consequence, the value
        of the element will be a list.  If C{False}, the value will be C{None}
        if the element is absent, and a reference to an instance of the type
        identified by L{pyxb.binding.basis.element.typeDefinition} if present.
        @type is_plural: C{bool}

        @param element_binding: Reference to the class that serves as the
        binding for the element.
        N(   R   R   t   _ElementDeclaration__keyR   R   R   R   R   (   R   R   R   R   t	   is_pluralt   locationR   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    					c         C   s)   |  j    r t d |  j  S|  j j   S(   s  Return the default value for this element.

        For plural values, this is an empty collection.  For non-plural
        values, it is C{None} unless the element has a default value, in which
        case it is that value.

        @todo: This should recursively support filling in default content, as
        when the plural list requires a non-zero minimum number of entries.
        R   (   R   R   R   R   (   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    
c         C   s    |  j    r t d |  j  Sd S(   s   Return the reset value for this element.

        For plural values, this is an empty collection.  For non-plural
        values, it is C{None}, corresponding to absence of an assigned
        element.
        R   N(   R   R   R   R	   (   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt
   resetValue  s    c         C   s   t  | |  j |  j    S(   s   Return the value for this use within the given instance.

        Note that this is the L{resetValue()}, not the L{defaultValue()}, if
        the element has not yet been assigned a value.(   R    R   R   (   R   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR(     s    c         C   s   t  | |  j |  j    |  S(   s?   Set the value for this use in the given element to its default.(   R)   R   R   (   R   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR-     s    c         C   s   | d k r |  j |  S| j   r: t j | |   n  |  j d k	 sO t  | j j sm t	 | t j
  r |  j j | d |  j   } n  t | |  j |  | j t j | |    |  S(   s4   Set the value of this element in the given instance.R   N(   R	   R-   t   _isNilR%   t   ContentInNilInstanceErrorR   R2   R   t
   forBindingR7   t   BINDR   R   R)   R   t   _addContentR    R   (   R   R   R(   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR=     s    !c         C   s,   |  j    r |  j | |  S|  j | |  S(   sZ   Invoke either L{set} or L{append}, depending on whether the element
        use is plural.(   R   RH   R=   (   R   R   R(   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    c         C   s   | j    r! t j | |   n  |  j   sE t j | |  |   n  |  j |  } | j j ru |  j j	 |  } n  | j
 |  | j t j | |    | S(   s   Add the given value as another instance of this element within the binding instance.
        @raise pyxb.StructuralBadDocumentError: invoked on an element use that is not plural
        (   R   R%   R   R   t   NonPluralAppendErrorR(   R   R   R   R   RH   R   R    R   (   R   R   R(   t   values(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyRH     s    c   	      C   s  t  | t j  rt|  j } | j |  r9 | j   } n  | d k	 sK t  | j   rl t	 j
 |  |   n  | j | j   |  } | j   } t |  } t  | t j  r t  | |  p | j |  st	 j d t |  | f   qn- t  | t j  rt  | | j  r| } n  | j   s9| j |  ra| j | t	 j j j d  | j  n  | j | |  n t  | t j  r| j |  j   |  } | j | j   j |   nU t  | t   rxC | D] } |  j! | | |  qWn t	 j d t |  | f   d S(   s<  Convert the given value to DOM as an instance of this element.

        @param dom_support: Helper for managing DOM properties
        @type dom_support: L{pyxb.utils.domutils.BindingDOMSupport}
        @param parent: The DOM node within which this element should be generated.
        @type parent: C{xml.dom.Element}
        @param value: The content for this element.  May be text (if the
        element allows mixed content), or an instance of
        L{basis._TypeBinding_mixin}.

        @raise pyxb.AbstractElementError: the binding to be used is abstract
        s7   toDOM with implicit value type %s unrecoverable from %sR'   s)   toDOM with unrecognized value type %s: %sN("   R7   R    RF   R   t   _substitutesFort   _elementR	   R2   t   abstractR%   t   AbstractElementErrort   createChildElementR   R   R'   t   complexTypeDefinitiont   _RequireXSITypet
   LogicErrort	   STD_uniont   _MemberTypest   requireXSITypeR.   t	   namespacet   XMLSchema_instancet   createExpandedNameRr   t
   _toDOM_cscR   t   string_typest   appendChildt   documentt   createTextNodeR   t   toDOM(	   R   R/   t   parentR(   R   R0   t   elt_typet   val_typeR   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR  .  s2    	%$	(c         C   s   | r t  j |  j  St  j |  j  d g } |  j   rJ | j d  n  | j |  j   j d |   t  j d  j	 |  S(   Ns   : s	   MULTIPLE R?   RC   (
   R   RD   R   R   R   RH   R   RG   Rz   RJ   (   R   R>   R?   RK   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyRG   W  s    c         C   s   t  } | |  k r t } nu | d  k	 r0 t  } n` t | t j j  rN t  } nB y" |  j j | d t  } t } Wn t	 j
 t	 j f k
 r n X| | f S(   Nt   _convert_string_values(   R!   R   R	   R7   R8   R9   R:   R   R   R%   t   ValidationErrort   BindingError(   R   R(   R_   t   accept(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   `  s    			
c         C   s   d |  j  t |   f S(   Ns   ED.%s@%x(   R   R   (   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR   x  s    N(   RL   RM   RN   R   R	   R   R   R   R   R   R   R   R   R   R   R!   R   R   R   R   R(   R-   R=   R   RH   R  R   RG   R   R   (    (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s2   							#								)		t   Wildcardc           B   sq   e  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 RS(   s!   Placeholder for wildcard objects.s   ##anys   ##others   ##targetNamespaces   ##localc         C   s   |  j  S(   s  A constraint on the namespace for the wildcard.

        Valid values are:

         - L{Wildcard.NC_any}
         - A tuple ( L{Wildcard.NC_not}, a L{namespace<pyxb.namespace.Namespace>} instance )
         - set(of L{namespace<pyxb.namespace.Namespace>} instances)

        Namespaces are represented by their URIs.  Absence is
        represented by C{None}, both in the "not" pair and in the set.
        (   t   _Wildcard__namespaceConstraint(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   namespaceConstraint  s    t   skipt   laxt   strictc         C   s   |  j  S(   s:   Indicate how this wildcard's contents should be processed.(   t   _Wildcard__processContents(   R   (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   processContents  s    c         C   si   | d  k r d  St | t j  r= t j j | d t } n  t | t j j  se t	 d | f   | S(   Nt   create_if_missings   unexpected non-namespace %s(
   R	   R7   R   R  R%   R  t   NamespaceForURIR   t	   NamespaceR2   (   R   t   nsv(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   __normalizeNamespace  s    (c         O   s   | d } t  | t  r9 | d |  j | d  f } n: t  | t  rs t g  | D] } |  j |  ^ qR  } n  | |  _ | d |  _ t t |   j   d S(   st   
        @keyword namespace_constraint: Required namespace constraint(s)
        @keyword process_contents: Requiredt   namespace_constrainti    i   t   process_contentsN(	   R7   t   tuplet   _Wildcard__normalizeNamespaceR=   R  R!  R   R  R   (   R   R   R   t   nsct   _uri(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s    
 +	c         C   s=  d } t | t j j  rE | j d k	 r t j j | j  } q nQ t | t	 j
  r | j   } | d k	 r | j   j   } q | j j   } n  t | t j j  r | j   r d } n  |  j |  j k r t St |  j t  r0|  j \ } } |  j | k st  | d k rt S| | k r,t St S| |  j k S(   s   Return True iff the value is a valid match against this wildcard.

        Validation per U{Wildcard allows Namespace Name<http://www.w3.org/TR/xmlschema-1/#cvc-wildcard-namespace>}.
        N(   R	   R7   R8   R9   R:   t   namespaceURIR%   R  R$  R    RF   R  R   Rr   R%  t   isAbsentNamespacet   NC_anyR  R   R*  t   NC_notR2   R!   (   R   RQ   R(   t   nst   eltt   _t   constrained_ns(    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR     s,    !	N(   RL   RM   RN   R0  R1  t   NC_targetNamespacet   NC_localR	   R  R  t   PC_skipt   PC_laxt	   PC_strictR!  R"  R+  R   R   (    (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyR  |  s   				(    RN   t   loggingt   xml.domR8   R%   t   pyxb.namespacet   pyxb.utils.fact   pyxb.bindingR    t   pyxb.utils.utilityt
   pyxb.utilsR   t	   getLoggerRL   Rs   t   cscRootR   t   objectRO   t   utilst   fact   SymbolMatch_mixinR   R   R   t   collectionst   utilityt   BackfillComparisonst   MutableSequenceR   R   R  (    (    (    sI   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/content.pyt   <module>   s*    	 ^)@)]