+
    ĜiW                     X    R t ^ RIHtHtHt ^RIHt ^RIHt RR.t	/ t
R
R ltR tR	 tR# )a  A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.

To create a tree walker for a new type of tree, you need to
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method which takes a tree as sole argument and
returns an iterator which generates tokens.
)absolute_importdivisionunicode_literals)	constants)default_etreegetTreeWalkerpprintNc                   V P                  4       p V \        9  d   V R8X  d   ^RIHp VP                  \        V &   MvV R8X  d   ^RIHp VP                  \        V &   MUV R8X  d   ^RIHp VP                  \        V &   M4V R8X  d.   ^RIHp Vf   \        pVP                  ! V3/ VB P                  # \        P                  V 4      # )	a  Get a TreeWalker class for various types of tree with built-in support

:arg str treeType: the name of the tree type required (case-insensitive).
    Supported values are:

    * "dom": The xml.dom.minidom DOM implementation
    * "etree": A generic walker for tree implementations exposing an
      elementtree-like interface (known to work with ElementTree,
      cElementTree and lxml.etree).
    * "lxml": Optimized walker for lxml.etree
    * "genshi": a Genshi stream

:arg implementation: A module implementing the tree type e.g.
    xml.etree.ElementTree or cElementTree (Currently applies to the "etree"
    tree type only).

:arg kwargs: keyword arguments passed to the etree walker--for other
    walkers, this has no effect

:returns: a TreeWalker class

dom)r
   genshi)r   lxml)
etree_lxmletree)r   )lowertreeWalkerCache r
   
TreeWalkerr   r   r   r   getETreeModuleget)treeTypeimplementationkwargsr
   r   r   r   s   &&,    f/Users/mibo/.openclaw/workspace/.venv-ak/lib/python3.14/site-packages/html5lib/treewalkers/__init__.pyr   r      s    0 ~~H&u(+OH%! (.(9(9OH%$(2(=(=OH% %!.''A&ALLLx((    c              #     "   . pV  FR  pVR ,          pVR9   d   VP                  VR,          4       K-  V'       d   R RRRP                  V4      /x  . pVx  KT  	  V'       d   R RRRP                  V4      /x  R# R# 5i)type
Charactersdatar   N)r   SpaceCharacters)appendjoin)tokenspendingCharacterstokenr   s   &   r   concatenateCharacterTokensr$   A   s     V}44$$U6]3 |VRWW=N5OPP$&!K  |VRWW5F-GHH s   9B (B %B c                f   . p^ p\        V 4       EF  pVR,          pVR9   Edd   VR,          '       dy   VR,          \        P                  R,          8w  dV   VR,          \        P                  9   d    \        P                  VR,          ,          pM	VR,          pV: RVR,          : 2pM	VR,          pVP	                  RV,          : RV: R24       V^,          pVR	,          p\        VP                  4       4       Fn  w  w  rp
V'       d:   V\        P                  9   d   \        P                  V,          pMTpV: RV	: 2pMT	pVP	                  RV,          : V: R
V
: R24       Kp  	  VR8X  d   V^,          pEKu  EKx  VR8X  d   V^,          pEK  VR8X  d+   VP	                  RV,          : RVR	,          : R24       EK  VR8X  d   VR,          '       d   VR,          '       dR   TP	                  RV,          : RVR,          : RVR,          : RVR,          '       d
   VR,          MR: R24       EK2  VR,          '       d6   VP	                  RV,          : RVR,          : RVR,          : R24       EKv  VP	                  RV,          : RVR,          : R24       EK  VP	                  RV,          : R24       EK  VR8X  d+   VP	                  RV,          : RVR	,          : R24       EK  VR8X  d   Q R4       h\        RV,          4      h	  RP                  V4      # ) zPretty printer for tree walkers

Takes a TreeWalker instance and pretty prints the output of walking the tree.

:arg walker: a TreeWalker instance

r   EmptyTag	namespacehtml name<>r   z=""EndTagCommentz<!-- z -->DoctypepublicIdz
<!DOCTYPE z "z" "systemIdr   z">z "" "z<!DOCTYPE >r   r   zBconcatenateCharacterTokens should have got rid of all Space tokenszUnknown token type, %s
)StartTagr&   )	r$   r   
namespacesprefixesr   sorteditems
ValueErrorr    )walkeroutputindentr#   r   nsr*   attrsr'   	localnamevalues   &          r   r   r   P   s    FF+F3V}++[!!eK&8I<P<PQW<X&X%););;"++E+,>?B{+B"$eFm4V}MMcFllD9:aKF&ME171F-& I$6$66&//	:&&()4D$DsV|T5IJ 2G z!! " XaKFYMMS6\\5==IJYV}}$$MM#&<<#(==#(#4#48=j8I8I5#4r#Q	#S T
 :&&MM#&<<#(==#(#4#4#6 7
 MMsV||7<V}}#F G v?@\!MMfeFmmDE&&^^^5 5<==} 4@ 99Vr   )N)__doc__
__future__r   r   r   r   r   _utilsr   __all__r   r   r$   r    r   r   <module>rF      s:    C B  "H
%))XIJr   