-
?1;c       sa    d  Z    d k l Z  d k l Z  d k l Z  d k l Z  d k l Z  d k l	 Z	  d k
 Z
  d   Z   d	 f  d
     YZ A d e f d     YZ O d e f d     YZ a d e f d     YZ n d e f d     YZ w d e f d     YZ  d e f d     YZ  d e f d     YZ  d e f d     YZ  d e f d     YZ  d e f d     YZ  d e f d      YZ  d! e f d"     YZ  d# e f d$     YZ  h  e d% <e d& <e d' <e d( <e d) <e d* <e d+ <e d, <e d- <e d. <e d/ <e d0 <e d1 <Z d S(2   s  
A Parsed token that represents an acis specifier on the parsed tree.
WWW: http://4suite.org/XPATH        e-mail: support@4suite.org

Copyright (c) 2000-2001 Fourthought Inc, USA.   All Rights Reserved.
See  http://4suite.org/COPYRIGHT  for license and copyright information
(   s   Node(   s   g_xpathRecognizedNodes(   s   NAMESPACE_NODE(   s   Util(   s   NamespaceNode(   s   GetAllNsNc    sK     y  t  |  |   SWn)  t j
 o  t d |    n Xd  S(   Ns   Invalid axis: %s(   s
   g_classMaps   axiss   KeyErrors   SyntaxError(   s   axis(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   ParsedAxisSpecifier s   s   AxisSpecifierc      s\     " e  i Z $ d   Z ' d   Z - d   Z 6 d d  Z 9 d   Z < d   Z RS(   Nc    s   $ % | |  _ d  S(   N(   s   axiss   selfs   _axis(   s   selfs   axis(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   __init__$ s   c    s   ' * + g  d f Sd S(   sT   
        Always returns a tuple of node-set and 0 if forward, 1 if reverse.
        i    N(    (   s   selfs   contexts   nodeTest(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   select' s   c    s   - . / xk | i D/ ]] } 0 | | | |  i  o 1 | i |  n 2 | i o 3 |  i	 | | | |  n q W4 | d f Sd S(   s3   Select all of the descendants from the context nodei    N(
   s   nodes
   childNodess   childs   nodeTests   contexts   selfs   principalTypes   nodeSets   appends   descendants(   s   selfs   contexts   nodeTests   nodes   nodeSets   child(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   descendants- s    	!s    c    s   6 7 | t |   GHd  S(   N(   s   indents   strs   self(   s   selfs   indent(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   pprint6 s   c    s$   9 : d t  |   t |   f Sd  S(   Ns   <AxisSpecifier at %x: %s>(   s   ids   selfs   repr(   s   self(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   __str__9 s   c    s   < = > |  i Sd S(   s"   Always displays verbose expressionN(   s   selfs   _axis(   s   self(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   __repr__< s   (	   s   Nodes   ELEMENT_NODEs   principalTypes   __init__s   selects   descendantss   pprints   __str__s   __repr__(    (    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   AxisSpecifier  s   	s   ParsedAncestorAxisSpecifierc      s   A B d   Z  RS(   Nc    s   B C D g  } E | i i t i j o
 | i i p
 | i i } G xH G | o= H | | | |  i  o I | i |  n J | i } qG WK | i   L | d f Sd S(   s.   Select all of the ancestors including the rooti   N(   s   nodeSets   contexts   nodes   nodeTypes   Nodes   ATTRIBUTE_NODEs   ownerElements
   parentNodes   parents   nodeTests   selfs   principalTypes   appends   reverse(   s   selfs   contexts   nodeTests   parents   nodeSet(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   selectB s   	2 
(   s   select(    (    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   ParsedAncestorAxisSpecifierA s   s!   ParsedAncestorOrSelfAxisSpecifierc      s   O P d   Z  RS(   Nc    s   P Q R | i } S | | | |  i  o T | g } n
 V g  } W | i t i j o | i	 p | i
 } Y xH Y | o= Z | | | |  i  o [ | i |  n \ | i
 } qs W] | i   ^ | d f Sd S(   s@   Select all of the ancestors including ourselves through the rooti   N(   s   contexts   nodes   nodeTests   selfs   principalTypes   nodeSets   nodeTypes   Nodes   ATTRIBUTE_NODEs   ownerElements
   parentNodes   parents   appends   reverse(   s   selfs   contexts   nodeTests   nodes   parents   nodeSet(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   selectP s   	) 
(   s   select(    (    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys!   ParsedAncestorOrSelfAxisSpecifierO s   s   ParsedAttributeAxisSpecifierc      s   a c e  i Z e d   Z RS(   Nc    s^   e f g | i i } h t | | |  i d  j | o
 | i   p g   } k | d f Sd S(   s2   Select all of the attributes from the context nodec    s   h | | |  |  S(   N(   s   tests   contexts   attrs   pt(   s   attrs   tests   contexts   pt(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   <lambda>h s    i    N(
   s   contexts   nodes
   attributess   attrss   filters   nodeTests   selfs   principalTypes   valuess   rt(   s   selfs   contexts   nodeTests   rts   attrs(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   selecte s
    (   s   Nodes   ATTRIBUTE_NODEs   principalTypes   select(    (    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   ParsedAttributeAxisSpecifiera s   s   ParsedChildAxisSpecifierc      s   n o d   Z  RS(   Nc    sA   o p q t  | | |  i d  s | i i  } t | d f Sd S(   s.   Select all of the children of the context nodec    s   q | | |  |  S(   N(   s   tests   contexts   nodes   pt(   s   nodes   tests   contexts   pt(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   <lambda>q s    i    N(   s   filters   nodeTests   contexts   selfs   principalTypes   nodes
   childNodess   rt(   s   selfs   contexts   nodeTests   rt(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   selecto s   (   s   select(    (    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   ParsedChildAxisSpecifiern s   s#   ParsedDescendantOrSelfAxisSpecifierc      s   w x d   Z  RS(   Nc    sk   x y z | | | i |  i  o { | i g } n
 } g  } ~ |  i | | | i |   | d f Sd S(   s2   Select the context node and all of its descendantsi    N(   s   nodeTests   contexts   nodes   selfs   principalTypes   nodeSets   descendants(   s   selfs   contexts   nodeTests   nodeSet(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   selectx s   	(   s   select(    (    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys#   ParsedDescendantOrSelfAxisSpecifierw s   s   ParsedDescendantAxisSpecifierc      s     d   Z  RS(   Nc    s9     g  }  |  i | | | i |   | d f Sd  S(   Ni    (   s   nodeSets   selfs   descendantss   contexts   nodeTests   node(   s   selfs   contexts   nodeTests   nodeSet(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   select s   	(   s   select(    (    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   ParsedDescendantAxisSpecifier s   s#   ParsedFollowingSiblingAxisSpecifierc      s     d   Z  RS(   Nc    s}      g  }  | i i }  xH  | o=  | | | |  i  o  | i |  n  | i } q$ W | d f Sd S(   s7   Select all of the siblings that follow the context nodei    N(	   s   results   contexts   nodes   nextSiblings   siblings   nodeTests   selfs   principalTypes   append(   s   selfs   contexts   nodeTests   siblings   result(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   select s   	 
(   s   select(    (    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys#   ParsedFollowingSiblingAxisSpecifier s   s   ParsedFollowingAxisSpecifierc      s     d   Z  RS(   Nc    s      g  }  | i }  x  | | i i p | i j o  | i }  xa  | oV  | | | |  i	  o  | i
 |  n  |  i | | | |   | i } qS W | i t i j o | i p | i } q! W | d f Sd S(   si   
        Select all of the nodes the follow the context node,
        not including descendants.
        i    N(   s   results   contexts   nodes   currs   ownerDocuments   nextSiblings   siblings   nodeTests   selfs   principalTypes   appends   descendantss   nodeTypes   Nodes   ATTRIBUTE_NODEs   ownerElements
   parentNode(   s   selfs   contexts   nodeTests   siblings   currs   result(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   select s   	   
.(   s   select(    (    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   ParsedFollowingAxisSpecifier s   s   ParsedNamespaceAxisSpecifierc      s     e  Z  d   Z RS(   Nc    s      | i i t i j o  g  d f Sn  g  }  t | i  }  xs | i   D ]b }  t
 i
 | | |  | i i p | i  }  | | | |  i  o  | i |  n q[ W | d f Sd S(   s-   Select all of the namespaces from the contexti    N(   s   contexts   nodes   nodeTypes   Nodes   ELEMENT_NODEs   results   GetAllNss   nsss   keyss   prefixs   NamespaceNodes   ownerDocuments   nsNodes   nodeTests   selfs   principalTypes   append(   s   selfs   contexts   nodeTests   prefixs   results   nsss   nsNode(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   select s   	 	(   s   NAMESPACE_NODEs   principalTypes   select(    (    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   ParsedNamespaceAxisSpecifier s   	s   ParsedParentAxisSpecifierc      s     d   Z  RS(   Nc    s      | i i t i j o
 | i i p
 | i i }  | o | | | |  i
  o  | g } n
  g  }  | d f Sd S(   s%   Select the parent of the context nodei   N(   s   contexts   nodes   nodeTypes   Nodes   ATTRIBUTE_NODEs   ownerElements
   parentNodes   parents   nodeTests   selfs   principalTypes   result(   s   selfs   contexts   nodeTests   parents   result(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   select s   2 	(   s   select(    (    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   ParsedParentAxisSpecifier s   s#   ParsedPrecedingSiblingAxisSpecifierc      s     d   Z  RS(   Nc    s      g  }  | i i }  xH  | o=  | | | |  i  o  | i |  n  | i } q$ W | i	    | d f Sd S(   s8   Select all of the siblings that precede the context nodei   N(
   s   results   contexts   nodes   previousSiblings   siblings   nodeTests   selfs   principalTypes   appends   reverse(   s   selfs   contexts   nodeTests   siblings   result(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   select s   	 
(   s   select(    (    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys#   ParsedPrecedingSiblingAxisSpecifier s   s   ParsedPrecedingAxisSpecifierc      s     d   Z  RS(   Nc    s:     g  }  | i }  x  | o  | i }  xv  | ok  g  }  | | | |  i	  o  | g } n  |  i
 | | | |   | i |   | i } q= W | i t i j o | i p | i } q! W g  }  x9 t d t |  d  D ] }  | i | |  qW | d f Sd S(   sM   Select all of the nodes the precede the context node, not including ancestorsi   N(   s   doc_lists   contexts   nodes   currs   previousSiblings   sibs   results   nodeTests   selfs   principalTypes   descendantss   appends   nodeTypes   Nodes   ATTRIBUTE_NODEs   ownerElements
   parentNodes   ranges   lens   is   extend(   s   selfs   contexts   nodeTests   doc_lists   currs   is   sibs   result(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   select s(   	 
 
	.	 	(   s   select(    (    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   ParsedPrecedingAxisSpecifier s   s   ParsedSelfAxisSpecifierc      s     d   Z  RS(   Nc    sJ      | | | i |  i  o  | i g d f Sn  g  d f Sd S(   s   Select the context nodei    N(   s   nodeTests   contexts   nodes   selfs   principalType(   s   selfs   contexts   nodeTest(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   select s   (   s   select(    (    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   ParsedSelfAxisSpecifier s   s   ancestors   ancestor-or-selfs   childs   parents
   descendants   descendant-or-selfs	   attributes	   followings   following-siblings	   precedings   preceding-siblings	   namespaces   self(   s   __doc__s   xml.doms   Nodes	   xml.xpaths   g_xpathRecognizedNodess   NAMESPACE_NODEs   Utils   NamespaceNodes   xml.dom.exts   GetAllNss   strings   ParsedAxisSpecifiers   AxisSpecifiers   ParsedAncestorAxisSpecifiers!   ParsedAncestorOrSelfAxisSpecifiers   ParsedAttributeAxisSpecifiers   ParsedChildAxisSpecifiers#   ParsedDescendantOrSelfAxisSpecifiers   ParsedDescendantAxisSpecifiers#   ParsedFollowingSiblingAxisSpecifiers   ParsedFollowingAxisSpecifiers   ParsedNamespaceAxisSpecifiers   ParsedParentAxisSpecifiers#   ParsedPrecedingSiblingAxisSpecifiers   ParsedPrecedingAxisSpecifiers   ParsedSelfAxisSpecifiers
   g_classMap(   s   GetAllNss   strings   ParsedNamespaceAxisSpecifiers   NamespaceNodes   ParsedDescendantAxisSpecifiers   ParsedChildAxisSpecifiers   ParsedFollowingAxisSpecifiers   NAMESPACE_NODEs   ParsedAttributeAxisSpecifiers   ParsedPrecedingAxisSpecifiers   Nodes   Utils
   g_classMaps   g_xpathRecognizedNodess#   ParsedPrecedingSiblingAxisSpecifiers!   ParsedAncestorOrSelfAxisSpecifiers   ParsedSelfAxisSpecifiers   AxisSpecifiers   ParsedAncestorAxisSpecifiers#   ParsedFollowingSiblingAxisSpecifiers   ParsedParentAxisSpecifiers#   ParsedDescendantOrSelfAxisSpecifiers   ParsedAxisSpecifier(    (    sP   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/ParsedAxisSpecifier.pys   ? s.   !	