3 YF@s9ddlZddlZddlZGdddeZddZddZGdd d eZGd d d eZGd d d eZ GdddeZ GdddZ Gddde Z Gddde Z GdddZGdddZGdddZGdddZddZd d!Zd"d#Zd$Zd%Zd&Zd'Zd$Zd%Zd&Zd'Zd(d)ZGd*d+d+ZGd,d-d-ZGd.d/d/Z Gd0d1d1Z!d2d3Z"Gd4d5d5Z#d6d7Z$gZ%d8d9Z&d:d;Z'dd?Z)d@dAZ*dBdCZ+dDdEZ,dFdGZ-dHdIZ.dJdKZ/dLdMZ0dNdOZ1dPdQZ2dRdSZ3dTdUZ4dVdWZ5dXdYZ6dZd[Z7d\d]Z8d^d_Z9d`daZ:dbdcZ;dddeZdjdkZ?dldmZ@dndoZAdpdqZBdrdsZCdtduZDdvdwZEdxdyZFdzd{ZGd|d}ZHd~dZIddZJddZKddZLddZMddZNddZOddZPddZQddZRddZSddZTddZUddZVddZWddZXddZYddZZddZ[ddZ\ddZ]ddZ^ddZ_ddZ`ddZaddZbddZcddZdddZeddZfddZgddZhddZiddZjddÄZkddńZlddDŽZmddɄZndd˄Zodd̈́ZpddτZqddфZrddӄZsddՄZtddׄZuddلZvddۄZwdd݄Zxdd߄ZyddZzddZ{ddZ|ddZ}ddZ~ddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZdd Zd d Zd d ZddZddZddZddZddZddZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zd<d=Zd>d?Zd@dAZdBdCZdDdEZdFdGZdHdIZdJdKZdLdMZdNdOZdPdQZdRdSZdTdUZdVdWZdXdYZdZd[Zd\d]Zd^d_Zd`daZdbdcZdddeZdfdgZdhdiZdjdkZdldmZdndoZdpdqZdrdsZÐdtduZĐdvdwZŐdxdyZƐdzd{Zǐd|d}ZȐd~dZɐddZʐddZːddZ̐ddZ͐ddZΐddZϐddZАddZѐddZҐddZӐddZԐddZՐddZ֐ddZאddZؐddZِddZڐddZېddZܐddZݐddZސddZߐddZddZddZddZddZddZddZddZddZddZddZddÄZdĐdńZdƐdDŽZdȐdɄZdʐd˄Zd̐d̈́ZdΐdτZdАdфZdҐdӄZdԐdՄZd֐dׄZdؐdلZdڐdۄZdܐd݄Zdސd߄ZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZ ddZ ddZ ddZ ddZ dd Zd d Zd d ZddZddZddZddZddZddZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Z d.d/Z!d0d1Z"d2d3Z#d4d5Z$d6d7Z%d8d9Z&d:d;Z'd<d=Z(d>d?Z)d@dAZ*dBdCZ+dDdEZ,dFdGZ-dHdIZ.dJdKZ/dLdMZ0dNdOZ1dPdQZ2dRdSZ3dTdUZ4dVdWZ5dXdYZ6dZd[Z7d\d]Z8d^d_Z9d`daZ:dbdcZ;dddeZ<dfdgZ=dhdiZ>djdkZ?dldmZ@dndoZAdpdqZBdrdsZCdtduZDdvdwZEdxdyZFdzd{ZGd|d}ZHd~dZIddZJddZKddZLddZMddZNddZOddZPddZQddZRddZSddZTddZUddZVddZWddZXddZYddZZddZ[ddZ\ddZ]ddZ^ddZ_ddZ`ddZaddZbddZcddZdddZeddZfddZgddZhddZiddZjddÄZkdĐdńZldƐdDŽZmdȐdɄZndʐd˄Zod̐d̈́ZpdΐdτZqdАdфZrdҐdӄZsdԐdՄZtd֐dׄZudؐdلZvdڐdۄZwdܐd݄Zxdސd߄ZyddZzddZ{ddZ|ddZ}ddZ~ddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZdd ZGd d d eZGd d d eZGdddeZGdddeZGdddeZGdddZGdddeZGdddeZGdddeZGdddZGdddeZGd d!d!e ZGd"d#d#e ZGd$d%d%ZGd&d'd'ZGd(d)d)ZGd*d+d+e!ZGd,d-d-ZGd.d/d/ZGd0d1d1e ZGd2d3d3ZGd4d5d5e#ZGd6d7d7ZGd8d9d9eZGd:d;d;ZGd<d=d=ZdZd$Zd%Zd&ZdZd$Zd%Zd$Zd%Zd&Zd'Zd>Zd?Zd$Zd%Zd&Zd'Zd$Zd%Zd&Zd'ZdZd$Zd%Zd&Zd'Zd>ZÐd?ZĐd@ZŐdAZƐdBZǐdCZȐdDZɐdEZʐdFZːdGZ̐dHZ͐dIZΐdJZϐdKZАdLZѐdMZҐdNZӐdOZԐdPZՐdQZ֐dRZאdSZؐdTZِdUZڐdVZېdWZܐdXZݐdYZސdZZߐd[Zd\Zd]Zd^Zd_Zd`ZdaZdbZdcZddZdeZdfZdgZd&ZdZd$Zd%Zd&Zd'Zd>Zd?Zd@ZdAZdBZdCZdDZdEZdFZdGZdHZdIZd$Zd%Zd&Zd'Zd>Zd?Zd$Zd%Zd'ZdAZdIZ dYZ dhZ diZ dZ d$Zd%Zd'ZdZd$Zd%Zd&Zd'Zd>Zd?Zd@ZdAZdBZdCZdDZdEZdFZdGZdHZ dIZ!dJZ"dKZ#dLZ$dMZ%dNZ&dOZ'dPZ(dQZ)dRZ*dSZ+dTZ,dUZ-dVZ.dWZ/dXZ0dYZ1dZZ2d[Z3d\Z4d]Z5d^Z6d_Z7d`Z8daZ9dbZ:dcZ;ddZ<deZ=dfZ>dgZ?djZ@dkZAdlZBdmZCdnZDdoZEdpZFdqZGdrZHdsZIdtZJduZKdvZLdwZMdxZNdyZOdzZPdhZQd{ZRd|ZSd}ZTd~ZUdZVdZWdZXdZYdZZdZ[dZ\dZ]dZ^dZ_dZ`dZadZbdZcdZddZedZfdZgdZhdZidZjdZkdZldZmdZndZodZpdZqdZrdZsdZtdZudZvdZwdZxdZydZzdZ{dZ|dZ}dZ~dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdÐZdĐZdŐZdƐZdǐZdȐZdɐZdʐZdːZd̐Zd͐ZdΐZdϐZdАZdѐZdҐZdӐZdԐZdՐZd֐ZdאZdؐZdِZdڐZdېZdܐZdݐZdސZdߐZdZdZdZdZdZdZdZdZdZdZdZdZdZÐdZĐdZŐdZƐdZǐdZȐdZɐdZʐdZːdZ̐dZ͐dZΐdZϐdZАdZѐdZҐdZӐdZԐdZՐdZ֐dZאdZؐdZِdZڐdZېdZܐdZݐdZސdZߐd Zd Zd Zd Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Zd!Zd"Zd#Zd$Zd%Zd&Zd'Zd(Zd)Zd*Zd+Zd,Zd-Zd.Zd/Zd0Zd1Zd2Z d3Z d4Z d5Z d6Z d7Zd8Zd9Zd:Zd;Zd<Zd=Zd>Zd?Zd@ZdAZdBZdCZdDZdEZdFZdGZdHZdIZ dJZ!dKZ"dLZ#dMZ$dNZ%dOZ&dPZ'dQZ(dRZ)dSZ*dTZ+dUZ,dVZ-dWZ.dXZ/dYZ0dZZ1d[Z2d\Z3d]Z4d^Z5d_Z6d`Z7daZ8dbZ9dcZ:ddZ;deZ<dfZ=dgZ>dhZ?diZ@djZAdkZBdlZCdmZDdnZEdoZFdpZGdqZHdrZIdsZJdtZKduZLdvZMdwZNdxZOdyZPdzZQd{ZRd|ZSd}ZTd~ZUdZVdZWdZXdZYdZZdZ[dZ\dZ]dZ^dZ_dZ`dZadZbdZcdZddZedZfdZgdZhdZidZjdZkdZldZmdZndZodZpdZqdZrdZsdZtdZudZvdZwdZxdZydZzdZ{dZ|dZ}dZ~dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdÐZdĐZdŐZdƐZdǐZdȐZdɐZdʐZdːZd̐Zd͐ZdΐZdϐZdАZdѐZdҐZdӐZdԐZdՐZd֐ZdאZdؐZdِZdڐZdېZdܐZdݐZdސZdߐZdZdZdZdZdZdZdZdZdZdZdZdZdZÐdZĐdZŐdZƐdZǐdZȐdZɐdZʐdZːdZ̐dZ͐dZΐdZϐdZАdZѐdZҐdZӐdZԐdZՐdZ֐dZאdZؐdZِdZڐdZېdZܐdZݐdZސdZߐd Zd Zd Zd Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Zd!Zd"Zd#Zd$Zd%Zd&Zd'Zd(Zd)Zd*Zd+Zd,Zd-Zd.Zd/Zd0Zd1Zd2Z d3Z d4Z d5Z d6Z d7Zd8Zd9Zd:Zd;Zd<Zd=Zd>Zd?Zd@ZdAZdBZdCZdDZdEZdFZdGZdHZdIZ dJZ!dKZ"dLZ#dMZ$dNZ%dOZ&dPZ'dQZ(dRZ)dSZ*dTZ+dUZ,dVZ-dWZ.dXZ/dYZ0dZZ1d[Z2d\Z3d]Z4d^Z5d_Z6d`Z7daZ8dbZ9dcZ:ddZ;deZ<dfZ=dgZ>dhZ?diZ@djZAdkZBdlZCdmZDdnZEdoZFdpZGdqZHdrZIdsZJdtZKduZLdvZMdwZNdxZOdyZPdzZQd{ZRd|ZSd}ZTd~ZUdZVdZWdZXdZYdZZdZ[dZ\dZ]dZ^dZ_dZ`dZadZbdZcdZddZedZfdZgdZhdZidZjdZkdZldZmdZndZodZpdZqdZrdZsdZtdZudZvdZwdZxdZydZzdZ{dZ|dZ}dZ~dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdÐZdĐZdŐZdƐZdǐZdȐZdɐZdʐZdːZd̐Zd͐ZdΐZdϐZdАZdѐZdҐZdӐZdԐZdՐZd֐ZdאZdؐZdِZdڐZdېZdܐZdݐZdސZdߐZdZdZdZdZdZdZdZdZdZdZdZdZdZÐdZĐdZŐdZƐdZǐdZȐdZɐdZʐdZːdZ̐dZ͐dZΐdZϐdZАdZѐdZҐdZӐdZԐdZՐdZ֐dZאdZؐdZِdZڐdZېdZܐdZݐdZސdZߐd Zd Zd Zd Zd ZdZdZdZdZdZdZdZdZdZdZdZd$Zd%Zd&Zd'Zd>Zd$Zd%Zd&Zd'Zd$Zd%Zd&Zd'ZdZd$Zd%Zd&Zd'Zd>Zd?Zd@ZdAZdBZdCZdDZdEZ dFZ dGZ dHZ dIZ dJZdZd$Zd%Zd$Zd%Zd&Zd'Zd>Zd?Zd@ZdAZdBZdCZdDZdEZdFZdGZdHZ dIZ!dJZ"dKZ#dLZ$dMZ%dNZ&dZ'd$Z(d%Z)d$Z*d%Z+d&Z,d'Z-d>Z.d?Z/d@Z0dAZ1dBZ2dCZ3dDZ4dEZ5dFZ6dGZ7dHZ8dIZ9dJZ:dKZ;dLZ<dMZ=dNZ>dOZ?dPZ@dQZAdRZBdSZCdTZDdUZEdVZFdWZGdXZHdYZIdZZJdZKd$ZLd%ZMd&ZNd'ZOdZPd$ZQd%ZRd&ZSd'ZTd>ZUd?ZVd@ZWdAZXdBZYdCZZdDZ[dEZ\dFZ]dGZ^dHZ_dIZ`dJZadKZbdLZcdMZddNZedOZfdPZgdQZhdZid$Zjd%Zkd&Zld'Zmd>ZndZod$Zpd%Zqd&Zrd'ZsdZtd$Zud%Zvd&Zwd'Zxd>Zyd?Zzd@Z{dAZ|dBZ}dCZ~dDZdEZdFZdGZdHZdIZdJZdKZdLZdMZdNZdOZdZd$Zd%Zd&Zd'Zd>Zd?Zd@ZdAZdBZdCZdDZdEZdFZdGZdHZdIZdJZdKZdLZdMZdNZdOZdPZdQZdRZdSZdTZdUZdVZdWZdZd$Zd%Zd'ZdEZd$ZdZd$Zd%Zd&Zd$Zd'ZdYZdhZdiZdZdZdZdZdZdZd$Zd%Zd&Zd'Zd>ZÐd?ZĐd@ZŐdAZƐdBZǐdCZȐdDZɐdEZʐdFZːdGZ̐dHZ͐dIZΐdJZϐdKZАdLZѐdMZҐdNZӐdOZԐdPZՐdQZ֐dRZאdSZؐdTZِdUZڐdVZېdWZܐdXZݐdYZސdZZߐd[Zd\Zd]Zd^Zd_Zd`ZdZd$Zd%Zd&Zd$Zd%Zd&Zd'Zd>Zd?Zd@ZdAZdBZdCZd$Zd%Zd'ZdAZdZdZdZdZd$Zd%Zd&Zd'Zd>Zd?Zd@Zd$Zd%Zd&Zd'Zd>Zd?Zd@Z dAZ dBZ dCZ dDZ dEZdFZdGZdHZdIZdJZdKZdLZdMZdNZdOZdPZdQZdRZdSZdܐZdݐZdސZdߐZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*d$Z+d%Z,dZ-d$Z.d%Z/d&Z0d'Z1d>Z2dZ3d$Z4d%Z5d$Z6d%Z7d'Z8dAZ9dIZ:dYZ;dhZ<diZ=dZ>dZ?dZ@dZAdZBdZCdZDd ZEdZFd!ZGd"ZHd#ZId$ZJdZKd%ZLdZMd$ZNd%ZOd&ZPd'ZQd$ZRd%ZSd'ZTdAZUdIZVdYZWdhZXdiZYdZZd$Z[d%Z\d&Z]dZ^d$Z_d%Z`d&Zad'Zbd>Zcd?Zdd@ZedAZfdBZgdZhd$Zid%Zjd&Zkd'Zld>Zmd?Znd@ZodAZpdBZqdCZrdDZsdEZtdFZudGZvdHZwdIZxdJZydKZzdLZ{dMZ|dNZ}dOZ~dPZdQZdRZdS((Nc@s eZdZdS) libxmlErrorN)__name__ __module__ __qualname__rr/usr/lib64/python3.6/libxml2.pyrsrc Cs2y"ttj}|dkr |dkr dSWn dSdS)NZ PyCObject PyCapsuler)type_objr)objnrrr checkWrapper s rcCst|}|dkrtj|S|S)Nr)idsysmaxsize)oirrrpos_ids rc@seZdZddZddZdS) treeErrorcCs ||_dS)N)msg)selfrrrr__init__sztreeError.__init__cCs|jS)N)r)rrrr__str__!sztreeError.__str__N)rrrrrrrrrrsrc@seZdZddZddZdS) parserErrorcCs ||_dS)N)r)rrrrrr%szparserError.__init__cCs|jS)N)r)rrrrr'szparserError.__str__N)rrrrrrrrrr$src@seZdZddZddZdS)uriErrorcCs ||_dS)N)r)rrrrrr+szuriError.__init__cCs|jS)N)r)rrrrr-szuriError.__str__N)rrrrrrrrrr*src@seZdZddZddZdS) xpathErrorcCs ||_dS)N)r)rrrrrr1szxpathError.__init__cCs|jS)N)r)rrrrr3szxpathError.__str__N)rrrrrrrrrr0src@s8eZdZddZddZddZddd Zdd d Zd S) ioWrappercCs||_d|_dS)N)_ioWrapper__io_o)rr rrrr7szioWrapper.__init__cCs"|jdkrdS|jjd|_dS)Nr r)rclose)rrrrio_close;s   zioWrapper.io_closecCs|jdkrdS|jjdS)Nr rr )rflush)rrrrio_flushBs  zioWrapper.io_flushr c Cs|jdkrdSy$|dkr$|jj}n |jj|}WnLtk r~ddl}|jd}tdt|td|j|jdkdSX|S)Nr rzfailed to read from Python:zon IO:r r )rread Exceptionrexc_infoprintr )rlenretrerrrio_readHs     zioWrapper.io_readcCs0|jdkrdS|dkr"|jj|S|jj||S)Nr rr )rwrite)rstrr)rrrio_writeZs   zioWrapper.io_writeNr )r r )r )rrrrr"r$r,r/rrrrr6s  rc@s&eZdZd ddZddZddZdS) ioReadWrappercCstj||tj|||_dS)N)rr libxml2modxmlCreateInputBufferr)rr encrrrrbs zioReadWrapper.__init__cCs0td|j|jdkr&tj|jd|_dS)N__del__)r(r"rr2xmlFreeParserInputBuffer)rrrrr5fs   zioReadWrapper.__del__cCs(|j|jdkrtj|jd|_dS)N)r"rr2r6)rrrrr!ms  zioReadWrapper.closeN)r1)rrrrr5r!rrrrr0as r0c@s.eZdZd ddZddZddZdd Zd S) ioWriteWrapperr1cCst|tdkr tdd|_ntt|jdkrbtj|}|dkrNtj||n tj||||_n2tj|}|dkrtj||n tj||||_dS)Nr1zwrite io from a stringr) r r(rrr2ZoutputBufferGetPythonFilerrr)rr r4filerrrrts    zioWriteWrapper.__init__cCs(|j|jdkrtj|jd|_dS)N)r"rr2xmlOutputBufferClose)rrrrr5s  zioWriteWrapper.__del__cCs(|j|jdkrtj|jd|_dS)N)r$rr2r9)rrrrr#s  zioWriteWrapper.flushcCs(|j|jdkrtj|jd|_dS)N)r$rr2r9)rrrrr!s  zioWriteWrapper.closeN)r1)rrrrr5r#r!rrrrr7ss r7c@seZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZddZddZddZddZd d!Zd"dZd#d$Zd%d&Zd'd(Zd)S)* SAXCallbackzBase class for SAX handlerscCsdS)z#called at the start of the documentNr)rrrr startDocumentszSAXCallback.startDocumentcCsdS)z!called at the end of the documentNr)rrrr endDocumentszSAXCallback.endDocumentcCsdS)zcalled at the start of every element, tag is the name of the element, attrs is a dictionary of the element's attributesNr)rtagZattrsrrr startElementszSAXCallback.startElementcCsdS)zOcalled at the start of every element, tag is the name of the elementNr)rr=rrr endElementszSAXCallback.endElementcCsdS)zcalled when character data have been read, data is the string containing the data, multiple consecutive characters() callback are possible.Nr)rdatarrr charactersszSAXCallback.characterscCsdS)zcalled when CDATA section have been read, data is the string containing the data, multiple consecutive cdataBlock() callback are possible.Nr)rr@rrr cdataBlockszSAXCallback.cdataBlockcCsdS)z.called when an entity reference has been foundNr)rnamerrr referenceszSAXCallback.referencecCsdS)z>called when potentially ignorable white spaces have been foundNr)rr@rrrignorableWhitespaceszSAXCallback.ignorableWhitespacecCsdS)zqcalled when a PI has been found, target contains the PI name and data is the associated data in the PINr)rtargetr@rrrprocessingInstructionsz!SAXCallback.processingInstructioncCsdS)zBcalled when a comment has been found, content contains the commentNr)rcontentrrrcommentszSAXCallback.commentcCsdS)zcalled when a DOCTYPE declaration has been found, name is the DTD name and externalID, systemID are the DTD public and system identifier for that DTd if availableNr)rrC externalIDsystemIDrrrexternalSubsetszSAXCallback.externalSubsetcCsdS)zcalled when a DOCTYPE declaration has been found, name is the DTD name and externalID, systemID are the DTD public and system identifier for that DTD if availableNr)rrCrJrKrrrinternalSubsetszSAXCallback.internalSubsetcCsdS)acalled when an ENTITY declaration has been found, name is the entity name and externalID, systemID are the entity public and system identifier for that entity if available, type indicates the entity type, and content reports it's string contentNr)rrCr rJrKrHrrr entityDeclszSAXCallback.entityDeclcCsdS)zcalled when an NOTATION declaration has been found, name is the notation name and externalID, systemID are the notation public and system identifier for that notation if availableNr)rrCrJrKrrr notationDeclszSAXCallback.notationDeclcCsdS)z2called when an ATTRIBUTE definition has been foundNr)relemrCr ZdefiZ defaultValueZnameListrrr attributeDeclszSAXCallback.attributeDeclcCsdS)z0called when an ELEMENT definition has been foundNr)rrCr rHrrr elementDeclszSAXCallback.elementDeclcCsdS)acalled when an unparsed ENTITY declaration has been found, name is the entity name and publicId,, systemID are the entity public and system identifier for that entity if available, and notationName indicate the associated NOTATIONNr)rrCZpublicIdrK notationNamerrrrNscCsdS)Nr)rrrrrwarningszSAXCallback.warningcCs t|dS)N)r)rrrrrerrorszSAXCallback.errorcCs t|dS)N)r)rrrrr fatalErrorszSAXCallback.fatalErrorN)rrr__doc__r;r<r>r?rArBrDrErGrIrLrMrNrOrQrRrTrUrVrrrrr:s*r:c@seZdZdCddZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZeZddZddZddZd dlZeejd d!d"krd#d$Zneeddd%Zee ddd&Zee ddd'Zee ddd(Zee ddd)Zee ddd*Zeeddd+Zeeddd,Zeeddd-Z eeddd.Z!dDd/d0Z"dEd1d2Z#dFd3d4Z$dGd5d6Z%d7d8Z&d9d:Z'd;d<Z(d=d>Z)d?d@Z*e)Z+dAdBZ,dS)HxmlCoreNcCs|dkr||_dSd|_dS)N)r)rr rrrr szxmlCore.__init__cCs0|dkr dStj|j|j}|dkr(dS|dkS)NFT)r2compareNodesEqualr)rotherr*rrr__eq__s zxmlCore.__eq__cCs"|dkr dStj|j|j}| S)NT)r2rYr)rrZr*rrr__ne__szxmlCore.__ne__cCstj|j}|S)N)r2ZnodeHashr)rr*rrr__hash__s zxmlCore.__hash__cCs|jS)N) serialize)rrrrr"szxmlCore.__str__cCs tj|j}|dkrdSt|S)N)r2parentrnodeWrap)rr*rrr get_parent$s zxmlCore.get_parentcCs tj|j}|dkrdSt|S)N)r2childrenrr`)rr*rrr get_children)s zxmlCore.get_childrencCs tj|j}|dkrdSt|S)N)r2lastrr`)rr*rrrget_last.s zxmlCore.get_lastcCs tj|j}|dkrdSt|S)N)r2nextrr`)rr*rrrget_next3s zxmlCore.get_nextcCs"tj|j}|dkrdSt|dS)N)r )r2 propertiesrxmlAttr)rr*rrrget_properties8s zxmlCore.get_propertiescCs tj|j}|dkrdSt|S)N)r2prevrr`)rr*rrrget_prev=s zxmlCore.get_prevcCs tj|jS)N)r2xmlNodeGetContentr)rrrr get_contentBszxmlCore.get_contentcCs tj|jS)N)r2rCr)rrrrget_nameEszxmlCore.get_namecCs tj|jS)N)r2r r)rrrrget_typeGszxmlCore.get_typecCs8tj|j}|dkr.|jdkr*t|jdSdSt|dS)N document_xml document_html)r )rqrr)r2docrr xmlDoc)rr*rrrget_docIs    zxmlCore.get_docrg@cCs|dkr(tj|j}|dkr dSt|S|dkrRtj|j}|dkrHdSt|dS|dkrztj|j}|dkrrdSt|S|dkrtj|j}|dkrdSt|S|dkrtj|j}|dkrdSt|S|dkrtj |j}|dkrdSt|S|dkr tj |jS|d kr tj |jS|d kr6tj |jS|d krtj |j}|dkr~|j d ksn|j d krzt|jdSdSt|dSt|dS)Nr_rh)r rbrdrfrkrHrCr rsrqrr)r2r_rr`rhrirbrdrfrkrmrCr rsrtAttributeError)rattrr*rrr __getattr__WsX                   zxmlCore.__getattr__z Parent nodezFirst child nodezLast sibling nodezNext sibling nodezPrevious sibling nodezList of properieszContent of this nodez Node namez Node typez!The document this node belongs tocCstj|j||S)N)r2Z serializeNoder)rencodingformatrrrr^szxmlCore.serializecCstj|j|||S)N)r2Z saveNodeTor)rr8rzr{rrrsaveToszxmlCore.saveTocCs2|rdd|D}tj|jj||dk||dkS)NcSsg|] }|jqSr)r).0r rrr sz&xmlCore.c14nMemory..r)r2ZxmlC14NDocDumpMemoryrur)rnodes exclusiveprefixes with_commentsrrr c14nMemoryszxmlCore.c14nMemorycCs4|rdd|D}tj|jj||dk||dk|S)NcSsg|] }|jqSr)r)r}r rrrr~sz&xmlCore.c14nSaveTo..r)r2ZxmlC14NDocSaveTorur)rr8rrrrrrr c14nSaveToszxmlCore.c14nSaveTocCs:|j}|dkrdS|j}|j||j|}|j|S)N)rsxpathNewContextsetContextNode xpathEvalxpathFreeContext)rexprrsctxtresrrrrs  zxmlCore.xpathEvalcCs |j|S)N)r)rrrrr xpathEval2szxmlCore.xpathEval2cCs(tj|j|}|dkrdSt|d}|S)a5 Remove a namespace definition from a node. If href is None, remove all of the ns definitions on that node. The removed namespaces are returned as a linked list. Note: If any child nodes referred to the removed namespaces, they will be left with dangling links. You should call renconciliateNs() to fix those pointers. Note: This method does not free memory taken by the ns definitions. You will need to free it manually with the freeNsList() method on the returns xmlNs object. N)r )r2ZxmlNodeRemoveNsDefrxmlNs)rhrefr*Z _xmlCore__tmprrr removeNsDefs  zxmlCore.removeNsDefcCst|S)N)xmlCoreDepthFirstItertor)rrrrwalk_depth_firstszxmlCore.walk_depth_firstcCst|S)N)xmlCoreBreadthFirstItertor)rrrrwalk_breadth_firstszxmlCore.walk_breadth_firstc Cs.y|jjjWn YnXtj|jdS)N)rsZ_ctxtrr2 xmlFreeDocr)rrrrfrees z xmlCore.free)N)Nr)Nr)NrNr)NrNr)-rrrrr[r\r]rrarcrergrjrlrn getContentrorprurfloatversionrypropertyr_rbrdrfrkrhrHrCr rsr^r|rrrrrrr__iter__rrrrrrX s\   /    rXc@s(eZdZddZddZddZeZdS)rcCs||_g|_dS)N)nodeparents)rrrrrrsz!xmlCoreDepthFirstItertor.__init__cCs|S)Nr)rrrrrsz!xmlCoreDepthFirstItertor.__iter__c Csbx\|jr*|j}|jj|j|jj|_|Sy|jj}Wntk rPtYnX|j|_qWdS)N)rrappendrbpop IndexError StopIterationrf)rr*r_rrr__next__s  z!xmlCoreDepthFirstItertor.__next__N)rrrrrrrfrrrrrs rc@s(eZdZddZddZddZeZdS)rcCs||_g|_dS)N)rr)rrrrrr'sz#xmlCoreBreadthFirstItertor.__init__cCs|S)Nr)rrrrr*sz#xmlCoreBreadthFirstItertor.__iter__c Csbx\|jr*|j}|jj|j|jj|_|Sy|jj}Wntk rPtYnX|j|_qWdS)N)rrrrfrrrrb)rr*r_rrrr,s  z#xmlCoreBreadthFirstItertor.__next__N)rrrrrrrfrrrrr&s rcCstj|}|dks|dkr$t|dS|dkr6t|dS|dddkrPt|dS|dkrbt|dS|d krtt|dS|d krt|dS|d krt|dS|d krt |dSt|dS) Nelementtext)r Z attributerZdocument namespaceZ elem_declZattribute_declZ entity_decldtd) r2r xmlNoderirtr xmlElement xmlAttribute xmlEntityxmlDtd)rrCrrrr`=s$         r`cCs|t|}|tgkr&ttt|}|S|tfkrHttt|}t|S|tdksl|tdksl|tdkrp|St|SdS)Nr1rg)r listmapxpathObjectRettupler`)rZotyper*rrrrRs  $rcCstj||||}dS)N)r2xmlRegisterXPathFunction)rrCns_urifr*rrrregisterXPathFunctionbsrr rvcCs8ddl}d|jkr tj||}nddl}|j||}|S)zpRegister a Python written function to for error reporting. The function is called back as f(ctx, error). rNlibxslt)rmodulesr2ZxmlRegisterErrorHandlerrregisterErrorHandler)rctxrr*rrrrrxs   rc@s6eZdZd ddZddZddZdd Zd d ZdS) parserCtxtCoreNcCs|dkr||_dSd|_dS)N)r)rr rrrrszparserCtxtCore.__init__cCs |jdkrtj|jd|_dS)N)rr2xmlFreeParserCtxt)rrrrr5s  zparserCtxtCore.__del__cCstj|j||dS)zRegister an error handler that will be called back as f(arg,msg,severity,reserved). @reserved is currently always None.N)r2ZxmlParserCtxtSetErrorHandlerr)rrargrrrsetErrorHandlerszparserCtxtCore.setErrorHandlercCs tj|jS)zWReturn (f,arg) as previously registered with setErrorHandler or (None,None).)r2ZxmlParserCtxtGetErrorHandlerr)rrrrgetErrorHandlerszparserCtxtCore.getErrorHandlercCstj|j|S)z(Register a local catalog with the parser)r2addLocalCatalogr)rurirrrrszparserCtxtCore.addLocalCatalog)N)rrrrr5rrrrrrrrs  rc@seZdZddZdddZdS) ValidCtxtCorecOsdS)Nr)rargskwrrrrszValidCtxtCore.__init__NcCstj|j|||dS)zy Register error and warning handlers for DTD validation. These will be called back as f(msg,arg) N)r2ZxmlSetValidErrorsr)rerr_func warn_funcrrrrsetValidityErrorHandlersz%ValidCtxtCore.setValidityErrorHandler)N)rrrrrrrrrrsrc@seZdZddZdddZdS)SchemaValidCtxtCorecOsdS)Nr)rrrrrrrszSchemaValidCtxtCore.__init__NcCstj|j|||dS)z| Register error and warning handlers for Schema validation. These will be called back as f(msg,arg) N)r2ZxmlSchemaSetValidErrorsr)rrrrrrrrsz+SchemaValidCtxtCore.setValidityErrorHandler)N)rrrrrrrrrrsrc@seZdZddZdddZdS)relaxNgValidCtxtCorecOsdS)Nr)rrrrrrrszrelaxNgValidCtxtCore.__init__NcCstj|j|||dS)z} Register error and warning handlers for RelaxNG validation. These will be called back as f(msg,arg) N)r2ZxmlRelaxNGSetValidErrorsr)rrrrrrrrsz,relaxNgValidCtxtCore.setValidityErrorHandler)N)rrrrrrrrrrsrcCs|\}}||||t|S)z)Intermediate callback to wrap the locator)xmlTextReaderLocator)Zxxx_todo_changemerZseverityZlocatorrrrrr_xmlTextReaderErrorFuncsrc@s.eZdZd ddZddZddZdd ZdS) xmlTextReaderCoreNcCs"d|_|dkr||_dSd|_dS)N)inputr)rr rrrrs zxmlTextReaderCore.__init__cCs |jdkrtj|jd|_dS)N)rr2xmlFreeTextReader)rrrrr5s  zxmlTextReaderCore.__del__cCs2|dkrtj|jddntj|jt||fdS)z]Register an error handler that will be called back as f(arg,msg,severity,locator).N)r2ZxmlTextReaderSetErrorHandlerrr)rrrrrrSetErrorHandlers z!xmlTextReaderCore.SetErrorHandlercCs$tj|j\}}|dkrdS|SdS)zWReturn (f,arg) as previously registered with setErrorHandler or (None,None).N)NN)r2ZxmlTextReaderGetErrorHandlerr)rrrrrrGetErrorHandlersz!xmlTextReaderCore.GetErrorHandler)N)rrrrr5rrrrrrrs  rcCs tjdS)N)r2xmlPythonCleanupParserrrrr cleanupParsersrcCs dd}tj|tj|dS)NcSs*x$ttD]}||}|dk r |Sq WdS)N)reversed__input_callbacks)URIcbrrrrfindOpenCallbacksz/registerInputCallback..findOpenCallback)r2ZxmlRegisterInputCallbackrr)funcrrrrregisterInputCallbacks rcCs,ttdkrtjttdkr(tjdS)Nr)r)rrr2ZxmlUnregisterInputCallbackrrrrpopInputCallbackss  rcCs&tj||}|dkrtdt|dS)z8Create a parser context for an HTML in-memory document. Nz#htmlCreateMemoryParserCtxt() failed)r )r2htmlCreateMemoryParserCtxtr parserCtxt)buffersizer*rrrrs rcCstj|}|S)zISet and return the previous value for handling HTML omitted tags. )r2htmlHandleOmittedElem)valr*rrrrs rcCstj|}|S)z0Check if an attribute is of content type Script )r2htmlIsScriptAttribute)rCr*rrrr%s rcCs"tj}|dkrtdt|dS)z.Allocate and initialize a new parser context. NzhtmlNewParserCtxt() failed)r )r2htmlNewParserCtxtrr)r*rrrr*srcCs&tj||}|dkrtdt|dS)z3parse an HTML in-memory document and build a tree. NzhtmlParseDoc() failed)r )r2 htmlParseDocrrt)currzr*rrrr0s rcCs&tj||}|dkrtdt|dS)zparse an HTML file and build a tree. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. NzhtmlParseFile() failed)r )r2 htmlParseFilerrt)filenamerzr*rrrr6s rcCs*tj||||}|dkr tdt|dS)z2parse an XML in-memory document and build a tree. NzhtmlReadDoc() failed)r )r2 htmlReadDocrrt)rURLrzoptionsr*rrrr>srcCs*tj||||}|dkr tdt|dS)z6parse an XML from a file descriptor and build a tree. NzhtmlReadFd() failed)r )r2 htmlReadFdrrt)fdrrzrr*rrrrDsrcCs(tj|||}|dkrtdt|dS)z6parse an XML file from the filesystem or the network. NzhtmlReadFile() failed)r )r2 htmlReadFilerrt)rrzrr*rrrrJsrcCs,tj|||||}|dkr"tdt|dS)z2parse an XML in-memory document and build a tree. NzhtmlReadMemory() failed)r )r2htmlReadMemoryrrt)rrrrzrr*rrrrPsrcCstj|}|S)z7Determine if a given attribute is a boolean attribute. )r2htmlIsBooleanAttr)rCr*rrrrZs rcCs&tj||}|dkrtdt|dS)zCreates a new HTML document NzhtmlNewDoc() failed)r )r2 htmlNewDocrrt)r ExternalIDr*rrrr_s rcCs&tj||}|dkrtdt|dS)zWCreates a new HTML document without a DTD node if @URI and @ExternalID are None NzhtmlNewDocNoDtD() failed)r )r2htmlNewDocNoDtDrrt)rrr*rrrres rcCstj|}|S)aSet the default version of SAX used globally by the library. By default, during initialization the default is set to 2. Note that it is generally a better coding style to use xmlSAXVersion() to set up the version explicitly for a given parsing context. )r2ZxmlSAXDefaultVersion)rr*rrrSAXDefaultVersionps rcCs tjdS)z$Initialize the default SAX2 handler N)r2ZxmlDefaultSAXHandlerInitrrrrdefaultSAXHandlerInitysrcCs tjdS)z#Initialize the default SAX handler N)r2docbDefaultSAXHandlerInitrrrrr}srcCs tjdS)z#Initialize the default SAX handler N)r2htmlDefaultSAXHandlerInitrrrrrsrcCstj|||}|S)zAdd an entry in the catalog, it may overwrite existing but different entries. If called before any other catalog routine, allows to override the default shared catalog put in place by xmlInitializeCatalog(); )r2Z xmlCatalogAdd)r origreplacer*rrr catalogAddsrcCs tjdS)z0Free up all the memory associated with catalogs N)r2ZxmlCatalogCleanuprrrrcatalogCleanupsrcCs tj}|S)z1Convert all the SGML catalog entries as XML ones )r2ZxmlCatalogConvert)r*rrrcatalogConvertsrcCs|dk r|jtj|dS)z7Dump all the global catalog content to the given file. N)r#r2ZxmlCatalogDump)outrrr catalogDumpsrcCstj|}|S)zoTry to lookup the catalog reference associated to a public ID DEPRECATED, use xmlCatalogResolvePublic() )r2ZxmlCatalogGetPublic)pubIDr*rrrcatalogGetPublics rcCstj|}|S)zoTry to lookup the catalog reference associated to a system ID DEPRECATED, use xmlCatalogResolveSystem() )r2ZxmlCatalogGetSystem)sysIDr*rrrcatalogGetSystems rcCstj|}|S)z!Remove an entry from the catalog )r2ZxmlCatalogRemove)valuer*rrr catalogRemoves rcCstj||}|S)z:Do a complete resolution lookup of an External Identifier )r2ZxmlCatalogResolve)rrr*rrrcatalogResolves rcCstj|}|S)zETry to lookup the catalog reference associated to a public ID )r2ZxmlCatalogResolvePublic)rr*rrrcatalogResolvePublics rcCstj|}|S)z3Try to lookup the catalog resource for a system ID )r2ZxmlCatalogResolveSystem)rr*rrrcatalogResolveSystems rcCstj|}|S)z*Do a complete resolution lookup of an URI )r2ZxmlCatalogResolveURI)rr*rrrcatalogResolveURIs rcCstj|}|S)z[Used to set the debug level for catalog operation, 0 disable debugging, 1 enable it )r2ZxmlCatalogSetDebug)levelr*rrrcatalogSetDebugs rcCs tjdS)zDo the catalog initialization. this function is not thread safe, catalog initialization should preferably be done once at startup N)r2ZxmlInitializeCatalogrrrrinitializeCatalogsrcCs$tj|}|dkrtdt|dS)zLoad the catalog and build the associated data structures. This can be either an XML Catalog or an SGML Catalog It will recurse in SGML CATALOG entries. On the other hand XML Catalogs are not handled recursively. NzxmlLoadACatalog() failed)r )r2ZxmlLoadACatalogrcatalog)rr*rrr loadACatalogs r cCstj|}|S)zLoad the catalog and makes its definitions effective for the default external entity loader. It will recurse in SGML CATALOG entries. this function is not thread safe, catalog initialization should preferably be done once at startup )r2ZxmlLoadCatalog)rr*rrr loadCatalogs r cCstj|dS)zLoad the catalogs and makes their definitions effective for the default external entity loader. this function is not thread safe, catalog initialization should preferably be done once at startup N)r2ZxmlLoadCatalogs)Zpathssrrr loadCatalogssr cCs$tj|}|dkrtdt|dS)zLoad an SGML super catalog. It won't expand CATALOG or DELEGATE references. This is only needed for manipulating SGML Super Catalogs like adding and removing CATALOG or DELEGATE entries. Nz xmlLoadSGMLSuperCatalog() failed)r )r2ZxmlLoadSGMLSuperCatalogrr )rr*rrrloadSGMLSuperCatalogs r cCs$tj|}|dkrtdt|dS)zcreate a new Catalog. NzxmlNewCatalog() failed)r )r2Z xmlNewCatalogrr )Zsgmlr*rrr newCatalogs rcCs$tj|}|dkrtdt|dS)zjparse an XML file and build a tree. It's like xmlParseFile() except it bypass all catalog lookups. NzxmlParseCatalogFile() failed)r )r2ZxmlParseCatalogFilerrt)rr*rrrparseCatalogFiles rcCstj|}|S)zSThis function is DEPRECATED. Use xmlIsBaseChar_ch or xmlIsBaseCharQ instead )r2Z xmlIsBaseChar)chr*rrr isBaseChars rcCstj|}|S)zMThis function is DEPRECATED. Use xmlIsBlank_ch or xmlIsBlankQ instead )r2Z xmlIsBlank)rr*rrrisBlank s rcCstj|}|S)zKThis function is DEPRECATED. Use xmlIsChar_ch or xmlIsCharQ instead )r2Z xmlIsChar)rr*rrrisChars rcCstj|}|S)z9This function is DEPRECATED. Use xmlIsCombiningQ instead )r2ZxmlIsCombining)rr*rrr isCombinings rcCstj|}|S)zMThis function is DEPRECATED. Use xmlIsDigit_ch or xmlIsDigitQ instead )r2Z xmlIsDigit)rr*rrrisDigits rcCstj|}|S)zSThis function is DEPRECATED. Use xmlIsExtender_ch or xmlIsExtenderQ instead )r2Z xmlIsExtender)rr*rrr isExtender s rcCstj|}|S)z;This function is DEPRECATED. Use xmlIsIdeographicQ instead )r2ZxmlIsIdeographic)rr*rrr isIdeographic&s rcCstj|}|S)zUThis function is DEPRECATED. Use xmlIsPubidChar_ch or xmlIsPubidCharQ instead )r2ZxmlIsPubidChar)rr*rrr isPubidChar+s rcCstj|}|S)z&Convenient way to turn bool into text )r2Z xmlBoolToText)Zboolvalr*rrr boolToText5s rcCs |dk r|jtj||dS)z=Dumps informations about the string, shorten it if necessary N)r#r2ZxmlDebugDumpString)outputr.rrrdebugDumpString:srcCstj||dS)z6Print the xpath error to libxml default error channel N)r2ZxmlShellPrintXPathError)Z errorTyperrrrshellPrintXPathError?srcCs tjdS)z^Free the dictionary mutex. Do not call unless sure the library is not in use anymore ! N)r2ZxmlDictCleanuprrrr dictCleanupGsrcCs tj}|S)zKDo the dictionary mutex initialization. this function is deprecated )r2ZxmlInitializeDict)r*rrrinitializeDictLsrcCstj||}|S)zbRegisters an alias @alias for an encoding named @name. Existing alias will be overwritten. )r2ZxmlAddEncodingAlias)rCaliasr*rrraddEncodingAliasVs r cCs tjdS)z}Cleanup the memory allocated for the char encoding support, it unregisters all the encoding handlers and the aliases. N)r2ZxmlCleanupCharEncodingHandlersrrrrcleanupCharEncodingHandlers\sr!cCs tjdS)zUnregisters all aliases N)r2ZxmlCleanupEncodingAliasesrrrrcleanupEncodingAliasesasr"cCstj|}|S)z%Unregisters an encoding alias @alias )r2ZxmlDelEncodingAlias)rr*rrrdelEncodingAliases r#cCstj|}|S)z-Lookup an encoding name for the given alias. )r2ZxmlGetEncodingAlias)rr*rrr encodingAliasjs r$cCs tjdS)zInitialize the char encoding support, it registers the default encoding supported. NOTE: while public, this function usually doesn't need to be called in normal processing. N)r2ZxmlInitCharEncodingHandlersrrrrinitCharEncodingHandlersosr%cCs tjdS)z:Cleanup up the predefined entities table. Deprecated call N)r2ZxmlCleanupPredefinedEntitiesrrrrcleanupPredefinedEntitieszsr&cCs tjdS)z0Set up the predefined entities. Deprecated call N)r2ZxmlInitializePredefinedEntitiesrrrrinitializePredefinedEntities~sr'cCs$tj|}|dkrtdt|dS)z1Check whether this name is an predefined entity. NzxmlGetPredefinedEntity() failed)r )r2ZxmlGetPredefinedEntityrr)rCr*rrrpredefinedEntitys r(cCs tjdS)z'Additional cleanup for multi-threading N)r2ZxmlCleanupGlobalsrrrrcleanupGlobalssr)cCs tjdS)z.Additional initialisation for multi-threading N)r2ZxmlInitGlobalsrrrr initGlobalssr*cCstj|}|S)N)r2ZxmlThrDefDefaultBufferSize)vr*rrrthrDefDefaultBufferSizes r,cCstj|}|S)N)r2Z'xmlThrDefDoValidityCheckingDefaultValue)r+r*rrr$thrDefDoValidityCheckingDefaultValues r-cCstj|}|S)N)r2Z xmlThrDefGetWarningsDefaultValue)r+r*rrrthrDefGetWarningsDefaultValues r.cCstj|}|S)N)r2ZxmlThrDefIndentTreeOutput)r+r*rrrthrDefIndentTreeOutputs r/cCstj|}|S)N)r2ZxmlThrDefKeepBlanksDefaultValue)r+r*rrrthrDefKeepBlanksDefaultValues r0cCstj|}|S)N)r2Z xmlThrDefLineNumbersDefaultValue)r+r*rrrthrDefLineNumbersDefaultValues r1cCstj|}|S)N)r2ZxmlThrDefLoadExtDtdDefaultValue)r+r*rrrthrDefLoadExtDtdDefaultValues r2cCstj|}|S)N)r2ZxmlThrDefParserDebugEntities)r+r*rrrthrDefParserDebugEntitiess r3cCstj|}|S)N)r2Z#xmlThrDefPedanticParserDefaultValue)r+r*rrr thrDefPedanticParserDefaultValues r4cCstj|}|S)N)r2ZxmlThrDefSaveNoEmptyTags)r+r*rrrthrDefSaveNoEmptyTagss r5cCstj|}|S)N)r2Z'xmlThrDefSubstituteEntitiesDefaultValue)r+r*rrr$thrDefSubstituteEntitiesDefaultValues r6cCstj|}|S)N)r2ZxmlThrDefTreeIndentString)r+r*rrrthrDefTreeIndentStrings r7cCs tjdS)zHCleanup the FTP protocol layer. This cleanup proxy informations. N)r2ZxmlNanoFTPCleanuprrrrnanoFTPCleanupsr8cCs tjdS)zpInitialize the FTP protocol layer. Currently it just checks for proxy informations, and get the hostname N)r2ZxmlNanoFTPInitrrrr nanoFTPInitsr9cCstj|||||dS)zSetup the FTP proxy informations. This can also be done by using ftp_proxy ftp_proxy_user and ftp_proxy_password environment variables. N)r2ZxmlNanoFTPProxy)hostportuserZpasswdr rrr nanoFTPProxysr=cCstj|dS)z(Re)Initialize the FTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like ftp://myproxy/ or ftp://myproxy:3128/ A None URL cleans up proxy informations. N)r2ZxmlNanoFTPScanProxy)rrrrnanoFTPScanProxysr>cCs tjdS)z!Cleanup the HTTP protocol layer. N)r2ZxmlNanoHTTPCleanuprrrrnanoHTTPCleanupsr?cCs tjdS)z[Initialize the HTTP protocol layer. Currently it just checks for proxy informations N)r2ZxmlNanoHTTPInitrrrr nanoHTTPInitsr@cCstj|dS)z(Re)Initialize the HTTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like http://myproxy/ or http://myproxy:3128/ A None URL cleans up proxy informations. N)r2ZxmlNanoHTTPScanProxy)rrrrnanoHTTPScanProxysrAcCs$tj|}|dkrtdt|dS)z8Creates a parser context for an XML in-memory document. NzxmlCreateDocParserCtxt() failed)r )r2ZxmlCreateDocParserCtxtrr)rr*rrrcreateDocParserCtxts rBcCs tjdS)zInitialization function for the XML parser. This is not reentrant. Call once before processing in case of use in multithreaded programs. N)r2Z xmlInitParserrrrr initParsersrCcCstj|}|S)aHSet and return the previous value for default blanks text nodes support. The 1.x version of the parser used an heuristic to try to detect ignorable white spaces. As a result the SAX callback was generating xmlSAX2IgnorableWhitespace() callbacks instead of characters() one, and when using the DOM output text nodes containing those blanks were not generated. The 2.x and later version will switch to the XML standard way and ignorableWhitespace() are only generated when running the parser in validating mode and when the current element doesn't allow CDATA or mixed content. This function is provided as a way to force the standard behavior on 1.X libs and to switch back to the old mode for compatibility when running 1.X client code on 2.X . Upgrade of 1.X code should be done by using xmlIsBlankNode() commodity function to detect the "empty" nodes generated. This value also affect autogeneration of indentation when saving code if blanks sections are kept, indentation is not generated. )r2ZxmlKeepBlanksDefault)rr*rrrkeepBlanksDefaults rDcCstj|}|S)zSet and return the previous value for enabling line numbers in elements contents. This may break on old application and is turned off by default. )r2ZxmlLineNumbersDefault)rr*rrrlineNumbersDefaults rEcCs"tj}|dkrtdt|dS)z.Allocate and initialize a new parser context. NzxmlNewParserCtxt() failed)r )r2ZxmlNewParserCtxtrr)r*rrr newParserCtxt srFcCs&tj||}|dkrtdt|dS)z#Load and parse an external subset. NzxmlParseDTD() failed)r )r2Z xmlParseDTDrr)rSystemIDr*rrrparseDTD&s rHcCs$tj|}|dkrtdt|dS)z2parse an XML in-memory document and build a tree. NzxmlParseDoc() failed)r )r2Z xmlParseDocrrt)rr*rrrparseDoc,s rIcCs$tj|}|dkrtdt|dS)zparse an XML external entity out of context and build a tree. [78] extParsedEnt ::= TextDecl? content This correspond to a "Well Balanced" chunk NzxmlParseEntity() failed)r )r2ZxmlParseEntityrrt)rr*rrr parseEntity2s rJcCs$tj|}|dkrtdt|dS)zparse an XML file and build a tree. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. NzxmlParseFile() failed)r )r2Z xmlParseFilerrt)rr*rrr parseFile:s rKcCs&tj||}|dkrtdt|dS)z/parse an XML in-memory block and build a tree. NzxmlParseMemory() failed)r )r2ZxmlParseMemoryrrt)rrr*rrr parseMemoryBs rLcCstj|}|S)zISet and return the previous value for enabling pedantic warnings. )r2ZxmlPedanticParserDefault)rr*rrrpedanticParserDefaultHs rMcCs*tj||||}|dkr tdt|dS)z2parse an XML in-memory document and build a tree. NzxmlReadDoc() failed)r )r2Z xmlReadDocrrt)rrrzrr*rrrreadDocNsrNcCs*tj||||}|dkr tdt|dS)zparse an XML from a file descriptor and build a tree. NOTE that the file descriptor will not be closed when the reader is closed or reset. NzxmlReadFd() failed)r )r2Z xmlReadFdrrt)rrrzrr*rrrreadFdTsrOcCs(tj|||}|dkrtdt|dS)z6parse an XML file from the filesystem or the network. NzxmlReadFile() failed)r )r2Z xmlReadFilerrt)rrzrr*rrrreadFile\srPcCs,tj|||||}|dkr"tdt|dS)z2parse an XML in-memory document and build a tree. NzxmlReadMemory() failed)r )r2Z xmlReadMemoryrrt)rrrrzrr*rrr readMemorybsrQcCs$tj|}|dkrtdt|dS)zparse an XML in-memory document and build a tree. In the case the document is not Well Formed, a attempt to build a tree is tried anyway NzxmlRecoverDoc() failed)r )r2Z xmlRecoverDocrrt)rr*rrr recoverDochs rRcCs$tj|}|dkrtdt|dS)zparse an XML file and build a tree. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. In the case the document is not Well Formed, it attempts to build a tree anyway NzxmlRecoverFile() failed)r )r2ZxmlRecoverFilerrt)rr*rrr recoverFileps rScCs&tj||}|dkrtdt|dS)zparse an XML in-memory block and build a tree. In the case the document is not Well Formed, an attempt to build a tree is tried anyway NzxmlRecoverMemory() failed)r )r2ZxmlRecoverMemoryrrt)rrr*rrr recoverMemoryys rTcCstj|}|S)a\Set and return the previous value for default entity support. Initially the parser always keep entity references instead of substituting entity values in the output. This function has to be used to change the default parser behavior SAX::substituteEntities() has to be used for changing that on a file by file basis. )r2ZxmlSubstituteEntitiesDefault)rr*rrrsubstituteEntitiesDefaults rUcCstj|}|S)a0Checks that the value conforms to the LanguageID production: NOTE: this is somewhat deprecated, those productions were removed from the XML Second edition. [33] LanguageID ::= Langcode ('-' Subcode)* [34] Langcode ::= ISO639Code | IanaCode | UserCode [35] ISO639Code ::= ([a-z] | [A-Z]) ([a-z] | [A-Z]) [36] IanaCode ::= ('i' | 'I') '-' ([a-z] | [A-Z])+ [37] UserCode ::= ('x' | 'X') '-' ([a-z] | [A-Z])+ [38] Subcode ::= ([a-z] | [A-Z])+ The current REC reference the sucessors of RFC 1766, currently 5646 http://www.rfc-editor.org/rfc/rfc5646.txt langtag = language ["-" script] ["-" region] *("-" variant) *("-" extension) ["-" privateuse] language = 2*3ALPHA ; shortest ISO 639 code ["-" extlang] ; sometimes followed by ; extended language subtags / 4ALPHA ; or reserved for future use / 5*8ALPHA ; or registered language subtag extlang = 3ALPHA ; selected ISO 639 codes *2("-" 3ALPHA) ; permanently reserved script = 4ALPHA ; ISO 15924 code region = 2ALPHA ; ISO 3166-1 code / 3DIGIT ; UN M.49 code variant = 5*8alphanum ; registered variants / (DIGIT 3alphanum) extension = singleton 1*("-" (2*8alphanum)) ; Single alphanumerics ; "x" reserved for private use singleton = DIGIT ; 0 - 9 / %x41-57 ; A - W / %x59-5A ; Y - Z / %x61-77 ; a - w / %x79-7A ; y - z it sounds right to still allow Irregular i-xxx IANA and user codes too The parser below doesn't try to cope with extension or privateuse that could be added but that's not interoperable anyway )r2ZxmlCheckLanguageID)langr*rrrcheckLanguageIDs rWcCstj|||}|S)z#append the char value in the array )r2Z xmlCopyChar)r)rrr*rrrcopyCharsrXcCstj||}|S)z#append the char value in the array )r2ZxmlCopyCharMultiByte)rrr*rrrcopyCharMultiBytes rYcCs(tj|||}|dkrtdt|dS)zCreate a parser context for an external entity Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. Nz"xmlCreateEntityParserCtxt() failed)r )r2ZxmlCreateEntityParserCtxtrr)rIDbaser*rrrcreateEntityParserCtxtsr\cCs$tj|}|dkrtdt|dS)zCreate a parser context for a file content. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. Nz xmlCreateFileParserCtxt() failed)r )r2ZxmlCreateFileParserCtxtrr)rr*rrrcreateFileParserCtxts r]cCs&tj||}|dkrtdt|dS)z7Create a parser context for an XML in-memory document. Nz"xmlCreateMemoryParserCtxt() failed)r )r2ZxmlCreateMemoryParserCtxtrr)rrr*rrrcreateMemoryParserCtxts r^cCs&tj||}|dkrtdt|dS)zCreate a parser context for a file or URL content. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time and for file accesses NzxmlCreateURLParserCtxt() failed)r )r2ZxmlCreateURLParserCtxtrr)rrr*rrrcreateURLParserCtxts r_cCs&tj||}|dkrtdt|dS)zCreate a parser context for a file content. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. Nz!htmlCreateFileParserCtxt() failed)r )r2htmlCreateFileParserCtxtrr)rrzr*rrrr`s r`cCs tjdS)zInitialize the htmlStartCloseIndex for fast lookup of closing tags names. This is not reentrant. Call xmlInitParser() once before processing in case of use in multithreaded programs. N)r2htmlInitAutoCloserrrrrasracCstj|}|S)zgCheck whether the character is allowed by the production [84] Letter ::= BaseChar | Ideographic )r2Z xmlIsLetter)cr*rrrisLetters rccCs"|dkrd}n|j}tj|}|S)z.Pops the top element name from the name stack N)rr2namePop)rctxt__or*rrrrds  rdcCs$|dkrd}n|j}tj||}|S)z3Pushes a new element name on top of the name stack N)rr2namePush)rrrer*rrrrfs  rfcCs8|dkrd}n|j}tj|}|dkr.tdt|dS)z.Pops the top element node from the node stack NznodePop() failed)r )rr2nodePoprr)rrer*rrrrgs rgcCs8|dkrd}n|j}|dkr"d}n|j}tj||}|S)z3Pushes a new element node on top of the node stack N)rr2nodePush)rrreZvalue__or*rrrrhs rhcCstj|||dS)zmInterface to parse an XML file or resource pointed by an URI to build an event flow to the SAX object N)r2ZxmlSAXParseFile)SAXrZrecoverrrr SAXParseFilesrjcCs&tj||}|dkrtdt|dS)z1Create a libxml2 input buffer from a Python file NzxmlCreateInputBuffer() failed)r )r2r3r inputBuffer)r8rzr*rrrcreateInputBuffers rlcCs&tj||}|dkrtdt|dS)z2Create a libxml2 output buffer from a Python file NzxmlCreateOutputBuffer() failed)r )r2ZxmlCreateOutputBufferr outputBuffer)r8rzr*rrrcreateOutputBuffers rncCs*tj||||}|dkr tdt|dS)zCreate a progressive XML parser context to build either an event flow if the SAX object is not None, or a DOM tree otherwise. NzxmlCreatePushParser() failed)r )r2ZxmlCreatePushParserrr)richunkrrr*rrrcreatePushParser#srpcCstj|}|S)zSwitch on the generation of line number for elements nodes. Also returns the number of bytes allocated and not freed by libxml2 since memory debugging was switched on. )r2ZxmlDebugMemory)Zactivater*rrr debugMemory+s rqcCs tjdS)z/dump the memory allocated in the file .memdump N)r2Z xmlDumpMemoryrrrr dumpMemory2srrcCs*tj||||}|dkr tdt|dS)zCreate a progressive HTML parser context to build either an event flow if the SAX object is not None, or a DOM tree otherwise. NzhtmlCreatePushParser() failed)r )r2htmlCreatePushParserrr)rirorrr*rrrrs6srscCstj|||dS)znInterface to parse an HTML file or resource pointed by an URI to build an event flow to the SAX object N)r2htmlSAXParseFile)rirrzrrrrt>srtcCs tj}|S)z8Returns the total amount of memory allocated by libxml2 )r2Z xmlMemoryUsed)r*rrr memoryUsedCsrucCs$tj|}|dkrtdt|dS)zCreate a new Node NzxmlNewNode() failed)r )r2Z xmlNewNoderr)rCr*rrrnewNodeHs rvcCs tjdS)aCleanup function for the XML library. It tries to reclaim all parsing related global memory allocated for the library processing. It doesn't deallocate any document related memory. Calling this function should not prevent reusing the library but one should call xmlCleanupParser() only when the process has finished using the library or XML document built with it. N)r2rrrrrpythonCleanupParserNsrwcCstj|}|S)z-Set the entity resolver as a python function )r2ZxmlSetEntityLoader)Zresolverr*rrrsetEntityLoaderXs rxcCs tjdS)zFCleanup the default Schemas type library associated to RelaxNG N)r2ZxmlRelaxNGCleanupTypesrrrrrelaxNGCleanupTypesasrycCs tj}|S)z&Initilize the default type libraries. )r2ZxmlRelaxNGInitTypes)r*rrrrelaxNGInitTypesfsrzcCs&tj||}|dkrtdt|dS)zmCreate an XML RelaxNGs parse context for that memory buffer expected to contain an XML RelaxNGs file. Nz#xmlRelaxNGNewMemParserCtxt() failed)r )r2ZxmlRelaxNGNewMemParserCtxtrrelaxNgParserCtxt)rrr*rrrrelaxNGNewMemParserCtxtks r|cCs$tj|}|dkrtdt|dS)zmCreate an XML RelaxNGs parse context for that file/resource expected to contain an XML RelaxNGs file. Nz xmlRelaxNGNewParserCtxt() failed)r )r2ZxmlRelaxNGNewParserCtxtrr{)rr*rrrrelaxNGNewParserCtxtrs r}cCstj||||}|S)zBuilds the QName @prefix:@ncname in @memory if there is enough space and prefix is not None nor empty, otherwise allocate a new string. If prefix is None or empty it returns ncname. )r2Z xmlBuildQName)ZncnameprefixZmemoryr)r*rrr buildQName}srcCs tj}|S)z3get the default compression mode used, ZLIB based. )r2ZxmlGetCompressMode)r*rrr compressModesrcCstj||}|S)z7Try to find if the document correspond to an XHTML DTD )r2Z xmlIsXHTML)rKZpublicIDr*rrrisXHTMLs rcCs$tj|}|dkrtdt|dS)z-Creation of a new node containing a comment. NzxmlNewComment() failed)r )r2Z xmlNewCommentrr)rHr*rrr newComments rcCs$tj|}|dkrtdt|dS)zCreates a new XML document NzxmlNewDoc() failed)r )r2Z xmlNewDocrrt)rr*rrrnewDocs rcCs&tj||}|dkrtdt|dS)zhCreation of a processing instruction element. Use xmlDocNewPI preferably to get string interning NzxmlNewPI() failed)r )r2ZxmlNewPIrr)rCrHr*rrrnewPIs rcCs$tj|}|dkrtdt|dS)zCreation of a new text node. NzxmlNewText() failed)r )r2Z xmlNewTextrr)rHr*rrrnewTexts rcCs&tj||}|dkrtdt|dS)zTCreation of a new text node with an extra parameter for the content's length NzxmlNewTextLen() failed)r )r2Z xmlNewTextLenrr)rHr)r*rrr newTextLens rcCstj|dS)zqset the default compression mode used, ZLIB based Correct values: 0 (uncompressed) to 9 (max compression) N)r2ZxmlSetCompressMode)moderrrsetCompressModesrcCstj||}|S)z;Check that a value conforms to the lexical space of NCName )r2ZxmlValidateNCName)rspacer*rrrvalidateNCNames rcCstj||}|S)z s rcCstj|}|S)z7Check whether the character is part of Po UCS Category )r2Z xmlUCSIsCatPo)rr*rrr uCSIsCatPoC s rcCstj|}|S)z7Check whether the character is part of Ps UCS Category )r2Z xmlUCSIsCatPs)rr*rrr uCSIsCatPsH s rcCstj|}|S)z6Check whether the character is part of S UCS Category )r2Z xmlUCSIsCatS)rr*rrr uCSIsCatSM s rcCstj|}|S)z7Check whether the character is part of Sc UCS Category )r2Z xmlUCSIsCatSc)rr*rrr uCSIsCatScR s rcCstj|}|S)z7Check whether the character is part of Sk UCS Category )r2Z xmlUCSIsCatSk)rr*rrr uCSIsCatSkW s rcCstj|}|S)z7Check whether the character is part of Sm UCS Category )r2Z xmlUCSIsCatSm)rr*rrr uCSIsCatSm\ s rcCstj|}|S)z7Check whether the character is part of So UCS Category )r2Z xmlUCSIsCatSo)rr*rrr uCSIsCatSoa s rcCstj|}|S)z6Check whether the character is part of Z UCS Category )r2Z xmlUCSIsCatZ)rr*rrr uCSIsCatZf s rcCstj|}|S)z7Check whether the character is part of Zl UCS Category )r2Z xmlUCSIsCatZl)rr*rrr uCSIsCatZlk s r cCstj|}|S)z7Check whether the character is part of Zp UCS Category )r2Z xmlUCSIsCatZp)rr*rrr uCSIsCatZpp s r cCstj|}|S)z7Check whether the character is part of Zs UCS Category )r2Z xmlUCSIsCatZs)rr*rrr uCSIsCatZsu s r cCstj|}|S)z:Check whether the character is part of Cherokee UCS Block )r2ZxmlUCSIsCherokee)rr*rrr uCSIsCherokeez s r cCstj|}|S)zRCheck whether the character is part of CombiningDiacriticalMarks UCS Block )r2Z!xmlUCSIsCombiningDiacriticalMarks)rr*rrruCSIsCombiningDiacriticalMarks s r cCstj|}|S)z\Check whether the character is part of CombiningDiacriticalMarksforSymbols UCS Block )r2Z+xmlUCSIsCombiningDiacriticalMarksforSymbols)rr*rrr(uCSIsCombiningDiacriticalMarksforSymbols s rcCstj|}|S)zKCheck whether the character is part of CombiningHalfMarks UCS Block )r2ZxmlUCSIsCombiningHalfMarks)rr*rrruCSIsCombiningHalfMarks s rcCstj|}|S)zQCheck whether the character is part of CombiningMarksforSymbols UCS Block )r2Z xmlUCSIsCombiningMarksforSymbols)rr*rrruCSIsCombiningMarksforSymbols s rcCstj|}|S)zHCheck whether the character is part of ControlPictures UCS Block )r2ZxmlUCSIsControlPictures)rr*rrruCSIsControlPictures s rcCstj|}|S)zHCheck whether the character is part of CurrencySymbols UCS Block )r2ZxmlUCSIsCurrencySymbols)rr*rrruCSIsCurrencySymbols s rcCstj|}|S)zICheck whether the character is part of CypriotSyllabary UCS Block )r2ZxmlUCSIsCypriotSyllabary)rr*rrruCSIsCypriotSyllabary s rcCstj|}|S)z:Check whether the character is part of Cyrillic UCS Block )r2ZxmlUCSIsCyrillic)rr*rrr uCSIsCyrillic s rcCstj|}|S)zKCheck whether the character is part of CyrillicSupplement UCS Block )r2ZxmlUCSIsCyrillicSupplement)rr*rrruCSIsCyrillicSupplement s rcCstj|}|S)z9Check whether the character is part of Deseret UCS Block )r2ZxmlUCSIsDeseret)rr*rrr uCSIsDeseret s rcCstj|}|S)zcCstj|}|S)zICheck whether the character is part of LinearBSyllabary UCS Block )r2ZxmlUCSIsLinearBSyllabary)rr*rrruCSIsLinearBSyllabary s r?cCstj|}|S)zFCheck whether the character is part of LowSurrogates UCS Block )r2ZxmlUCSIsLowSurrogates)rr*rrruCSIsLowSurrogates s r@cCstj|}|S)z;Check whether the character is part of Malayalam UCS Block )r2ZxmlUCSIsMalayalam)rr*rrruCSIsMalayalam s rAcCstj|}|S)zXCheck whether the character is part of MathematicalAlphanumericSymbols UCS Block )r2Z'xmlUCSIsMathematicalAlphanumericSymbols)rr*rrr$uCSIsMathematicalAlphanumericSymbols s rBcCstj|}|S)zNCheck whether the character is part of MathematicalOperators UCS Block )r2ZxmlUCSIsMathematicalOperators)rr*rrruCSIsMathematicalOperators s rCcCstj|}|S)z[Check whether the character is part of MiscellaneousMathematicalSymbols-A UCS Block )r2Z)xmlUCSIsMiscellaneousMathematicalSymbolsA)rr*rrr&uCSIsMiscellaneousMathematicalSymbolsA s rDcCstj|}|S)z[Check whether the character is part of MiscellaneousMathematicalSymbols-B UCS Block )r2Z)xmlUCSIsMiscellaneousMathematicalSymbolsB)rr*rrr&uCSIsMiscellaneousMathematicalSymbolsB s rEcCstj|}|S)zMCheck whether the character is part of MiscellaneousSymbols UCS Block )r2ZxmlUCSIsMiscellaneousSymbols)rr*rrruCSIsMiscellaneousSymbols s rFcCstj|}|S)zVCheck whether the character is part of MiscellaneousSymbolsandArrows UCS Block )r2Z%xmlUCSIsMiscellaneousSymbolsandArrows)rr*rrr"uCSIsMiscellaneousSymbolsandArrows s rGcCstj|}|S)zOCheck whether the character is part of MiscellaneousTechnical UCS Block )r2ZxmlUCSIsMiscellaneousTechnical)rr*rrruCSIsMiscellaneousTechnical s rHcCstj|}|S)z;Check whether the character is part of Mongolian UCS Block )r2ZxmlUCSIsMongolian)rr*rrruCSIsMongolian s rIcCstj|}|S)zGCheck whether the character is part of MusicalSymbols UCS Block )r2ZxmlUCSIsMusicalSymbols)rr*rrruCSIsMusicalSymbols s rJcCstj|}|S)z9Check whether the character is part of Myanmar UCS Block )r2ZxmlUCSIsMyanmar)rr*rrr uCSIsMyanmar s rKcCstj|}|S)z=Check whether the character is part of NumberForms UCS Block )r2ZxmlUCSIsNumberForms)rr*rrruCSIsNumberForms s rLcCstj|}|S)z7Check whether the character is part of Ogham UCS Block )r2Z xmlUCSIsOgham)rr*rrr uCSIsOgham s rMcCstj|}|S)z;Check whether the character is part of OldItalic UCS Block )r2ZxmlUCSIsOldItalic)rr*rrruCSIsOldItalic s rNcCstj|}|S)zTCheck whether the character is part of OpticalCharacterRecognition UCS Block )r2Z#xmlUCSIsOpticalCharacterRecognition)rr*rrr uCSIsOpticalCharacterRecognition s rOcCstj|}|S)z7Check whether the character is part of Oriya UCS Block )r2Z xmlUCSIsOriya)rr*rrr uCSIsOriya s rPcCstj|}|S)z9Check whether the character is part of Osmanya UCS Block )r2ZxmlUCSIsOsmanya)rr*rrr uCSIsOsmanya s rQcCstj|}|S)zKCheck whether the character is part of PhoneticExtensions UCS Block )r2ZxmlUCSIsPhoneticExtensions)rr*rrruCSIsPhoneticExtensions s rRcCstj|}|S)z s r]cCstj|}|S)zZCheck whether the character is part of SupplementalMathematicalOperators UCS Block )r2Z)xmlUCSIsSupplementalMathematicalOperators)rr*rrr&uCSIsSupplementalMathematicalOperatorsD s r^cCstj|}|S)zVCheck whether the character is part of SupplementaryPrivateUseArea-A UCS Block )r2Z$xmlUCSIsSupplementaryPrivateUseAreaA)rr*rrr!uCSIsSupplementaryPrivateUseAreaAJ s r_cCstj|}|S)zVCheck whether the character is part of SupplementaryPrivateUseArea-B UCS Block )r2Z$xmlUCSIsSupplementaryPrivateUseAreaB)rr*rrr!uCSIsSupplementaryPrivateUseAreaBP s r`cCstj|}|S)z8Check whether the character is part of Syriac UCS Block )r2ZxmlUCSIsSyriac)rr*rrr uCSIsSyriacV s racCstj|}|S)z9Check whether the character is part of Tagalog UCS Block )r2ZxmlUCSIsTagalog)rr*rrr uCSIsTagalog[ s rbcCstj|}|S)z:Check whether the character is part of Tagbanwa UCS Block )r2ZxmlUCSIsTagbanwa)rr*rrr uCSIsTagbanwa` s rccCstj|}|S)z6Check whether the character is part of Tags UCS Block )r2Z xmlUCSIsTags)rr*rrr uCSIsTagse s rdcCstj|}|S)z7Check whether the character is part of TaiLe UCS Block )r2Z xmlUCSIsTaiLe)rr*rrr uCSIsTaiLej s recCstj|}|S)zKCheck whether the character is part of TaiXuanJingSymbols UCS Block )r2ZxmlUCSIsTaiXuanJingSymbols)rr*rrruCSIsTaiXuanJingSymbolso s rfcCstj|}|S)z7Check whether the character is part of Tamil UCS Block )r2Z xmlUCSIsTamil)rr*rrr uCSIsTamilu s rgcCstj|}|S)z8Check whether the character is part of Telugu UCS Block )r2ZxmlUCSIsTelugu)rr*rrr uCSIsTeluguz s rhcCstj|}|S)z8Check whether the character is part of Thaana UCS Block )r2ZxmlUCSIsThaana)rr*rrr uCSIsThaana s ricCstj|}|S)z6Check whether the character is part of Thai UCS Block )r2Z xmlUCSIsThai)rr*rrr uCSIsThai s rjcCstj|}|S)z9Check whether the character is part of Tibetan UCS Block )r2ZxmlUCSIsTibetan)rr*rrr uCSIsTibetan s rkcCstj|}|S)z:Check whether the character is part of Ugaritic UCS Block )r2ZxmlUCSIsUgaritic)rr*rrr uCSIsUgaritic s rlcCstj|}|S)z[Check whether the character is part of UnifiedCanadianAboriginalSyllabics UCS Block )r2Z*xmlUCSIsUnifiedCanadianAboriginalSyllabics)rr*rrr'uCSIsUnifiedCanadianAboriginalSyllabics s rmcCstj|}|S)zKCheck whether the character is part of VariationSelectors UCS Block )r2ZxmlUCSIsVariationSelectors)rr*rrruCSIsVariationSelectors s rncCstj|}|S)zUCheck whether the character is part of VariationSelectorsSupplement UCS Block )r2Z$xmlUCSIsVariationSelectorsSupplement)rr*rrr!uCSIsVariationSelectorsSupplement s rocCstj|}|S)zeZdZdddZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Z!d@dAZ"dBdCZ#dDdEZ$dFdGZ%dHdIZ&dJdKZ'dLdMZ(dNdOZ)dPdQZ*dRdSZ+dTdUZ,dVdWZ-dXdYZ.dZd[Z/d\d]Z0d^d_Z1d`daZ2dbdcZ3dddeZ4dfdgZ5dhdiZ6djdkZ7dldmZ8dndoZ9dpdqZ:drdsZ;dtduZdzd{Z?d|d}Z@d~dZAddZBddZCddZDddZEddZFddZGddZHddZIddZJddZKddZLddZMddZNddZOddZPddZQddZRddZSddZTddZUddZVddZWddZXddZYddZZddZ[ddZ\ddZ]ddZ^ddZ_ddZ`ddZaddZbddÄZcddńZdddDŽZeddɄZfdd˄Zgdd̈́ZhdS)rNcCs,t|dkrtd||_tj||ddS)Nrz'xmlNode got a wrong wrapper object type)r )r TypeErrorrrXr)rr rrrr s zxmlNode.__init__cCsd|jtt|fS)Nz)rCintr)rrrr__repr__ szxmlNode.__repr__cCs&tj|j}|dkrdSt|d}|S)zGet the namespace of a node N)r )r2Z xmlNodeGetNsrr)rr* _xmlNode__tmprrrns s   z xmlNode.nscCs&tj|j}|dkrdSt|d}|S)zGet the namespace of a node N)r )r2ZxmlNodeGetNsDefsrr)rr*rxrrrnsDefs s   zxmlNode.nsDefscCstj||j|dS)zIDumps debug information for the element node, it is recursive N)r2ZxmlDebugDumpNoder)rrdepthrrr debugDumpNode szxmlNode.debugDumpNodecCstj||j|dS)zQDumps debug information for the list of element node, it is recursive N)r2ZxmlDebugDumpNodeListr)rrr{rrrdebugDumpNodeList szxmlNode.debugDumpNodeListcCstj||j|dS)zMDumps debug information for the element node, it is not recursive N)r2ZxmlDebugDumpOneNoder)rrr{rrrdebugDumpOneNode szxmlNode.debugDumpOneNodecCstj|j}|S)zCount the children of @node. )r2ZxmlLsCountNoder)rr*rrr lsCountNode s zxmlNode.lsCountNodecCstj||jdS)z,Dump to @output the type and name of @node. N)r2Z xmlLsOneNoder)rrrrr lsOneNode szxmlNode.lsOneNodecCstj|jdS)zPrint node to the output FILE N)r2ZxmlShellPrintNoder)rrrrshellPrintNode szxmlNode.shellPrintNodecCs@|dkrd}n|j}tj|j|}|dkr2tdt|d}|S)a9Add a new node to @parent, at the end of the child (or property) list merging adjacent TEXT nodes (in which case @cur is freed) If the new node is ATTRIBUTE, it is added into properties instead of children. If there is an attribute with equal name, it is first destroyed. NzxmlAddChild() failed)r )rr2Z xmlAddChildrr)rrcur__or*rxrrraddChild s zxmlNode.addChildcCs@|dkrd}n|j}tj|j|}|dkr2tdt|d}|S)zyAdd a list of node at the end of the child list of the parent merging adjacent TEXT nodes (@cur may be freed) NzxmlAddChildList() failed)r )rr2ZxmlAddChildListrr)rrrr*rxrrr addChildList s zxmlNode.addChildListcCstj|j|dS)zAppend the extra substring to the node content. NOTE: In contrast to xmlNodeSetContent(), @content is supposed to be raw text, so unescaped XML special chars are allowed, entity references are not supported. N)r2ZxmlNodeAddContentr)rrHrrr addContent szxmlNode.addContentcCstj|j||dS)zAppend the extra substring to the node content. NOTE: In contrast to xmlNodeSetContentLen(), @content is supposed to be raw text, so unescaped XML special chars are allowed, entity references are not supported. N)r2ZxmlNodeAddContentLenr)rrHr)rrr addContentLen# szxmlNode.addContentLencCs@|dkrd}n|j}tj|j|}|dkr2tdt|d}|S)aAdd a new node @elem as the next sibling of @cur If the new node was already inserted in a document it is first unlinked from its existing context. As a result of text merging @elem may be freed. If the new node is ATTRIBUTE, it is added into properties instead of children. If there is an attribute with equal name, it is first destroyed. NzxmlAddNextSibling() failed)r )rr2ZxmlAddNextSiblingrr)rrPelem__or*rxrrraddNextSibling* s zxmlNode.addNextSiblingcCs@|dkrd}n|j}tj|j|}|dkr2tdt|d}|S)aAdd a new node @elem as the previous sibling of @cur merging adjacent TEXT nodes (@elem may be freed) If the new node was already inserted in a document it is first unlinked from its existing context. If the new node is ATTRIBUTE, it is added into properties instead of children. If there is an attribute with equal name, it is first destroyed. NzxmlAddPrevSibling() failed)r )rr2ZxmlAddPrevSiblingrr)rrPrr*rxrrraddPrevSibling8 s zxmlNode.addPrevSiblingcCs@|dkrd}n|j}tj|j|}|dkr2tdt|d}|S)zAdd a new element @elem to the list of siblings of @cur merging adjacent TEXT nodes (@elem may be freed) If the new element was already inserted in a document it is first unlinked from its existing context. NzxmlAddSibling() failed)r )rr2Z xmlAddSiblingrr)rrPrr*rxrrr addSiblingG s zxmlNode.addSiblingcCs,tj|j|}|dkrtdt|d}|S)zDo a copy of the node. NzxmlCopyNode() failed)r )r2Z xmlCopyNoderrr)rextendedr*rxrrrcopyNodeS s  zxmlNode.copyNodecCs*tj|j}|dkrtdt|d}|S)zqDo a recursive copy of the node list. Use xmlDocCopyNodeList() if possible to ensure string interning. NzxmlCopyNodeList() failed)r )r2ZxmlCopyNodeListrrr)rr*rxrrr copyNodeListZ s   zxmlNode.copyNodeListcCs@|dkrd}n|j}tj|j|}|dkr2tdt|d}|S)zDo a copy of the attribute. NzxmlCopyProp() failed)r )rr2 xmlCopyProprri)rrrr*rxrrrcopyPropb s zxmlNode.copyPropcCs@|dkrd}n|j}tj|j|}|dkr2tdt|d}|S)z Do a copy of an attribute list. NzxmlCopyPropList() failed)r )rr2xmlCopyPropListrri)rrrr*rxrrr copyPropListk s zxmlNode.copyPropListcCsB|dkrd}n|j}tj|j||}|dkr4tdt|d}|S)z+Do a copy of the node to a given document. NzxmlDocCopyNode() failed)r )rr2xmlDocCopyNoderr)rrsrdoc__or*rxrrr docCopyNodet s zxmlNode.docCopyNodecCs@|dkrd}n|j}tj||j}|dkr2tdt|d}|S)z&Do a recursive copy of the node list. NzxmlDocCopyNodeList() failed)r )rr2xmlDocCopyNodeListrr)rrsrr*rxrrrdocCopyNodeList} s zxmlNode.docCopyNodeListcCs<|dkrd}n|j}tj||j}|dkr.dSt|d}|S)zvSet the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...). N)r )rr2xmlDocSetRootElementr)rrsrr*rxrrrdocSetRootElement s zxmlNode.docSetRootElementcCs&tj|j}|dkrdSt|d}|S)aFinds the first child node of that element which is a Element node Note the handling of entities references is different than in the W3C DOM element traversal spec since we don't have back reference from entities content to entities references. N)r )r2ZxmlFirstElementChildrr)rr*rxrrrfirstElementChild s   zxmlNode.firstElementChildcCstj|jdS)zFree a node, this is a recursive behaviour, all the children are freed too. This doesn't unlink the child from the list, use xmlUnlinkNode() first. N)r2Z xmlFreeNoder)rrrrfreeNode szxmlNode.freeNodecCstj|jdS)zlFree a node and all its siblings, this is a recursive behaviour, all the children are freed too. N)r2ZxmlFreeNodeListr)rrrr freeNodeList szxmlNode.freeNodeListcCs&|dkrd}n|j}tj||j}|S)aSearches for the BASE URL. The code should work on both XML and HTML document even if base mechanisms are completely different. It returns the base as defined in RFC 2396 sections 5.1.1. Base URI within Document Content and 5.1.2. Base URI from the Encapsulating Entity However it does not return the document base (5.1.3), use doc->URL in this case N)rr2xmlNodeGetBase)rrsrr*rrrgetBase s zxmlNode.getBasecCstj|j}|S)aRead the value of a node, this can be either the text carried directly by this node if it's a TEXT node or the aggregate string of the values carried by this node child's (TEXT and ENTITY_REF). Entity references are substituted. )r2rmr)rr*rrrr s zxmlNode.getContentcCstj|j}|S)zSearches the language of a node, i.e. the values of the xml:lang attribute or the one carried by the nearest ancestor. )r2ZxmlNodeGetLangr)rr*rrrgetLang s zxmlNode.getLangcCstj|j}|S)zSearches the space preserving behaviour of a node, i.e. the values of the xml:space attribute or the one carried by the nearest ancestor. )r2ZxmlNodeGetSpacePreserver)rr*rrrgetSpacePreserve s zxmlNode.getSpacePreservecCs*tj|j||}|dkrdSt|d}|S)aSearch for an attribute associated to a node This attribute has to be anchored in the namespace specified. This does the entity substitution. This function looks in DTD attribute declaration for #FIXED or default declaration values unless DTD use has been turned off. Note that a namespace of None indicates to use the default namespace. N)r )r2Z xmlHasNsProprri)rrC nameSpacer*rxrrr hasNsProp s  zxmlNode.hasNsPropcCs(tj|j|}|dkrdSt|d}|S)zSearch an attribute associated to a node This function also looks in DTD attribute declaration for #FIXED or default declaration values unless DTD use has been turned off. N)r )r2Z xmlHasProprri)rrCr*rxrrrhasProp s  zxmlNode.hasPropcCstj|j}|S)zgChecks whether this node is an empty or whitespace only (and possibly ignorable) text-node. )r2ZxmlIsBlankNoder)rr*rrr isBlankNode s zxmlNode.isBlankNodecCstj|j}|S)zIs this node a Text node ? )r2Z xmlNodeIsTextr)rr*rrrisText s zxmlNode.isTextcCs*tj|j}|dkrtdt|d}|S)z!Search the last child of a node. NzxmlGetLastChild() failed)r )r2ZxmlGetLastChildrrr)rr*rxrrr lastChild s   zxmlNode.lastChildcCs&tj|j}|dkrdSt|d}|S)aFinds the last child node of that element which is a Element node Note the handling of entities references is different than in the W3C DOM element traversal spec since we don't have back reference from entities content to entities references. N)r )r2ZxmlLastElementChildrr)rr*rxrrrlastElementChild s   zxmlNode.lastElementChildcCstj|j}|S)zGet line number of @node. Try to override the limitation of lines being store in 16 bits ints if XML_PARSE_BIG_LINES parser option was used )r2Z xmlGetLineNor)rr*rrrlineNo s zxmlNode.lineNocCs(|dkrd}n|j}tj||j|}|S)zBuilds the string equivalent to the text contained in the Node list made of TEXTs and ENTITY_REFs, contrary to xmlNodeListGetString() this function doesn't do any character encoding handling. N)rr2xmlNodeListGetRawString)rrsinLinerr*rrrlistGetRawString s zxmlNode.listGetRawStringcCs(|dkrd}n|j}tj||j|}|S)zlBuild the string equivalent to the text contained in the Node list made of TEXTs and ENTITY_REFs N)rr2xmlNodeListGetString)rrsrrr*rrr listGetString s zxmlNode.listGetStringcCsD|dkrd}n|j}tj|j|||}|dkr6tdt|d}|S)aQCreation of a new child element, added at the end of @parent children list. @ns and @content parameters are optional (None). If @ns is None, the newly created element inherits the namespace of @parent. If @content is non None, a child list containing the TEXTs and ENTITY_REFs node will be created. NOTE: @content is supposed to be a piece of XML CDATA, so it allows entity references. XML special chars must be escaped first by using xmlEncodeEntitiesReentrant(), or xmlNewTextChild() should be used. NzxmlNewChild() failed)r )rr2 xmlNewChildrr)rryrCrHns__or*rxrrrnewChild s  zxmlNode.newChildcCs.tj|j||}|dkr tdt|d}|S)aWCreation of a new Namespace. This function will refuse to create a namespace with a similar prefix than an existing one present on this node. Note that for a default namespace, @prefix should be None. We use href==None in the case of an element creation where the namespace was not defined. NzxmlNewNs() failed)r )r2ZxmlNewNsrrr)rrr~r*rxrrrnewNs% s  z xmlNode.newNscCsD|dkrd}n|j}tj|j|||}|dkr6tdt|d}|S)zPCreate a new property tagged with a namespace and carried by a node. NzxmlNewNsProp() failed)r )rr2 xmlNewNsProprri)rryrCrrr*rxrrr newNsProp1 s zxmlNode.newNsPropcCsD|dkrd}n|j}tj|j|||}|dkr6tdt|d}|S)zPCreate a new property tagged with a namespace and carried by a node. NzxmlNewNsPropEatName() failed)r )rr2xmlNewNsPropEatNamerri)rryrCrrr*rxrrrnewNsPropEatName; s zxmlNode.newNsPropEatNamecCs.tj|j||}|dkr tdt|d}|S)z)Create a new property carried by a node. NzxmlNewProp() failed)r )r2Z xmlNewProprrri)rrCrr*rxrrrnewPropE s  zxmlNode.newPropcCsD|dkrd}n|j}tj|j|||}|dkr6tdt|d}|S)aCreation of a new child element, added at the end of @parent children list. @ns and @content parameters are optional (None). If @ns is None, the newly created element inherits the namespace of @parent. If @content is non None, a child TEXT node will be created containing the string @content. NOTE: Use xmlNewChild() if @content will contain entities that need to be preserved. Use this function, xmlNewTextChild(), if you need to ensure that reserved XML chars that might appear in @content, such as the ampersand, greater-than or less-than signs, are automatically replaced by their XML escaped entity representations. NzxmlNewTextChild() failed)r )rr2xmlNewTextChildrr)rryrCrHrr*rxrrr newTextChildL s  zxmlNode.newTextChildcCs&tj|j}|dkrdSt|d}|S)a&Finds the first closest next sibling of the node which is an element node. Note the handling of entities references is different than in the W3C DOM element traversal spec since we don't have back reference from entities content to entities references. N)r )r2ZxmlNextElementSiblingrr)rr*rxrrrnextElementSibling_ s   zxmlNode.nextElementSiblingcCstj|j|}|S)arSearch and get the value of an attribute associated to a node This does the entity substitution. This function looks in DTD attribute declaration for #FIXED or default declaration values unless DTD use has been turned off. This function is similar to xmlGetProp except it will accept only an attribute in no namespace. )r2ZxmlGetNoNsPropr)rrCr*rrrnoNsPropj szxmlNode.noNsPropcCstj|j}|S)z0Build a structure based Path for the given node )r2ZxmlGetNodePathr)rr*rrrnodePatht s zxmlNode.nodePathcCstj|j||}|S)aFSearch and get the value of an attribute associated to a node This attribute has to be anchored in the namespace specified. This does the entity substitution. This function looks in DTD attribute declaration for #FIXED or default declaration values unless DTD use has been turned off. )r2Z xmlGetNsPropr)rrCrr*rrrnsPropy szxmlNode.nsPropcCs&tj|j}|dkrdSt|d}|S)a*Finds the first closest previous sibling of the node which is an element node. Note the handling of entities references is different than in the W3C DOM element traversal spec since we don't have back reference from entities content to entities references. N)r )r2ZxmlPreviousElementSiblingrr)rr*rxrrrpreviousElementSibling s   zxmlNode.previousElementSiblingcCstj|j|}|S)aSearch and get the value of an attribute associated to a node This does the entity substitution. This function looks in DTD attribute declaration for #FIXED or default declaration values unless DTD use has been turned off. NOTE: this function acts independently of namespaces associated to the attribute. Use xmlGetNsProp() or xmlGetNoNsProp() for namespace aware processing. )r2Z xmlGetPropr)rrCr*rrrprop sz xmlNode.propcCs&|dkrd}n|j}tj||j}|S)a!This function checks that all the namespaces declared within the given tree are properly declared. This is needed for example after Copy or Cut and then paste operations. The subtree may still hold pointers to namespace declarations outside the subtree or invalid/masked. As much as possible the function try to reuse the existing namespaces found in the new environment. If not possible the new namespaces are redeclared on @tree at the top of the given subtree. N)rr2xmlReconciliateNs)rrsrr*rrrreconciliateNs s zxmlNode.reconciliateNscCs@|dkrd}n|j}tj|j|}|dkr2tdt|d}|S)zUnlink the old node from its current context, prune the new one at the same place. If @cur was already inserted in a document it is first unlinked from its existing context. NzxmlReplaceNode() failed)r )rr2ZxmlReplaceNoderr)rrrr*rxrrr replaceNode s zxmlNode.replaceNodecCsB|dkrd}n|j}tj||j|}|dkr4tdt|d}|S)aSearch a Ns registered under a given name space for a document. recurse on the parents until it finds the defined namespace or return None otherwise. @nameSpace can be None, this is a search for the default namespace. We don't allow to cross entities boundaries. If you don't declare the namespace within those you will be in troubles !!! A warning is generated to cover this case. NzxmlSearchNs() failed)r )rr2 xmlSearchNsrr)rrsrrr*rxrrrsearchNs s zxmlNode.searchNscCsB|dkrd}n|j}tj||j|}|dkr4tdt|d}|S)zSearch a Ns aliasing a given URI. Recurse on the parents until it finds the defined namespace or return None otherwise. NzxmlSearchNsByHref() failed)r )rr2xmlSearchNsByHrefrr)rrsrrr*rxrrrsearchNsByHref s zxmlNode.searchNsByHrefcCstj|j|dS)z\Set (or reset) the base URI of a node, i.e. the value of the xml:base attribute. N)r2ZxmlNodeSetBaser)rrrrrsetBase szxmlNode.setBasecCstj|j|dS)a Replace the content of a node. NOTE: @content is supposed to be a piece of XML CDATA, so it allows entity references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant() resp. xmlEncodeSpecialChars(). N)r2ZxmlNodeSetContentr)rrHrrr setContent szxmlNode.setContentcCstj|j||dS)a Replace the content of a node. NOTE: @content is supposed to be a piece of XML CDATA, so it allows entity references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant() resp. xmlEncodeSpecialChars(). N)r2ZxmlNodeSetContentLenr)rrHr)rrr setContentLen szxmlNode.setContentLencCstj|j|dS)zRSet the language of a node, i.e. the values of the xml:lang attribute. N)r2ZxmlNodeSetLangr)rrVrrrsetLang szxmlNode.setLangcCs&|dkrd}n|j}tj|j|dS)z|dkrd}n|j}tj|j|||}|dkr6tdt|S)z-Create a new xmlXPathObjectPtr of type range NzxmlXPtrNewRange() failed)rr2ZxmlXPtrNewRangerr)rZ startindexr Zendindexrr*rrrxpointerNewRangekszxmlNode.xpointerNewRangecCs:|dkrd}n|j}tj|j|}|dkr2tdt|S)z;Create a new xmlXPathObjectPtr of type range using 2 nodes NzxmlXPtrNewRangeNodes() failed)rr2ZxmlXPtrNewRangeNodesrr)rr rr*rrrxpointerNewRangeNodessszxmlNode.xpointerNewRangeNodes)N)irrrrrwryrzr|r}r~rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrr s                                          rc@sfeZdZdddZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Z!d@dAZ"dBdCZ#dDdEZ$dFdGZ%dHdIZ&dJdKZ'dLdMZ(dNdOZ)dPdQZ*dRdSZ+dTdUZ,dVdWZ-dXdYZ.dZd[Z/d\d]Z0d^d_Z1d`daZ2dbdcZ3dddeZ4dfdgZ5dhdiZ6djdkZ7dldmZ8dndoZ9dpdqZ:drdsZ;dtduZdzd{Z?d|d}Z@d~dZAddZBddZCddZDddZEddZFddZGddZHddZIddZJddZKddZLddZMddZNddZOddZPddZQddZRddZSddZTddZUddZVddZWddZXddZYddZZddZ[ddZ\ddZ]ddZ^ddZ_ddZ`ddZaddZbddÄZcddńZdddDŽZeddɄZfdd˄Zgdd̈́ZhddτZiddфZjddӄZkddՄZlddׄZmdS)rtNcCs,t|dkrtd||_tj||ddS)Nrz&xmlDoc got a wrong wrapper object type)r )rrurrr)rr rrrr|s zxmlDoc.__init__cCsd|jtt|fS)Nz)rCrvr)rrrrrwszxmlDoc.__repr__cCstj|j||}|S)zThe HTML DTD allows a tag to implicitly close other tags. The list is kept in htmlStartClose array. This function checks if the element or one of it's children would autoclose the given tag. )r2htmlAutoCloseTagr)rrCrPr*rrrrszxmlDoc.htmlAutoCloseTagcCstj|j|}|S)zThe HTML DTD allows a tag to implicitly close other tags. The list is kept in htmlStartClose array. This function checks if a tag is autoclosed by one of it's child )r2htmlIsAutoClosedr)rrPr*rrrrszxmlDoc.htmlIsAutoClosedcCs*|dkrd}n|j}tj||j||dS)zDump an HTML document. N)rr2htmlDocContentDumpFormatOutput)rbufrzr{buf__orrrrsz%xmlDoc.htmlDocContentDumpFormatOutputcCs(|dkrd}n|j}tj||j|dS)z:Dump an HTML document. Formating return/spaces are added. N)rr2htmlDocContentDumpOutput)rrrzrrrrrszxmlDoc.htmlDocContentDumpOutputcCstj||j}|S)z'Dump an HTML document to an open FILE. )r2 htmlDocDumpr)rrr*rrrrszxmlDoc.htmlDocDumpcCstj|j}|S)z,Encoding definition lookup in the Meta tags )r2htmlGetMetaEncodingr)rr*rrrrs zxmlDoc.htmlGetMetaEncodingcCs(|dkrd}n|j}tj||j|dS)znDump an HTML node, recursive behaviour,children are printed too, and formatting returns are added. N)rr2htmlNodeDumpFile)rrrrrrrrszxmlDoc.htmlNodeDumpFilecCs,|dkrd}n|j}tj||j|||}|S)zDump an HTML node, recursive behaviour,children are printed too. TODO: if encoding == None try to save in the doc encoding N)rr2htmlNodeDumpFileFormat)rrrrzr{rr*rrrrs zxmlDoc.htmlNodeDumpFileFormatcCs@|dkrd}n|j}|dkr"d}n|j}tj||j|||dS)zLDump an HTML node, recursive behaviour,children are printed too. N)rr2htmlNodeDumpFormatOutput)rrrrzr{rrrrrrszxmlDoc.htmlNodeDumpFormatOutputcCs>|dkrd}n|j}|dkr"d}n|j}tj||j||dS)zuDump an HTML node, recursive behaviour,children are printed too, and formatting returns/spaces are added. N)rr2htmlNodeDumpOutput)rrrrzrrrrrrszxmlDoc.htmlNodeDumpOutputcCstj||j}|S)zYDump an HTML document to a file. If @filename is "-" the stdout file is used. )r2 htmlSaveFiler)rrr*rrrrszxmlDoc.htmlSaveFilecCstj||j|}|S)zkDump an HTML document to a file using a given encoding and formatting returns/spaces are added. )r2htmlSaveFileEncr)rrrzr*rrrrszxmlDoc.htmlSaveFileEnccCstj||j||}|S)z8Dump an HTML document to a file using a given encoding. )r2htmlSaveFileFormatr)rrrzr{r*rrrr szxmlDoc.htmlSaveFileFormatcCstj|j|}|S)zSets the current encoding in the Meta tags NOTE: this will not change the document content encoding, just the META flag associated. )r2htmlSetMetaEncodingr)rrzr*rrrr!szxmlDoc.htmlSetMetaEncodingcCstj||j}|S)z_Check the document for potential content problems, and output the errors to @output )r2ZxmlDebugCheckDocumentr)rrr*rrrdebugCheckDocumentszxmlDoc.debugCheckDocumentcCstj||jdS)z9Dumps debug information for the document, it's recursive N)r2ZxmlDebugDumpDocumentr)rrrrrdebugDumpDocumentszxmlDoc.debugDumpDocumentcCstj||jdS)zIDumps debug information cncerning the document, not recursive N)r2ZxmlDebugDumpDocumentHeadr)rrrrrdebugDumpDocumentHeadszxmlDoc.debugDumpDocumentHeadcCstj||jdS)zODumps debug information for all the entities in use by the document N)r2ZxmlDebugDumpEntitiesr)rrrrrdebugDumpEntitiesszxmlDoc.debugDumpEntitiescCs4tj|j|||||}|dkr&tdt|d}|S)z)Register a new entity for this document. NzxmlAddDocEntity() failed)r )r2ZxmlAddDocEntityrrr)rrCr rrGrHr* _xmlDoc__tmprrr addDocEntitys  zxmlDoc.addDocEntitycCs4tj|j|||||}|dkr&tdt|d}|S)z=Register a new entity for this document DTD external subset. NzxmlAddDtdEntity() failed)r )r2ZxmlAddDtdEntityrrr)rrCr rrGrHr*r&rrr addDtdEntitys  zxmlDoc.addDtdEntitycCs,tj|j|}|dkrtdt|d}|S)z:Do an entity lookup in the document entity hash table and NzxmlGetDocEntity() failed)r )r2ZxmlGetDocEntityrrr)rrCr*r&rrr docEntitys  zxmlDoc.docEntitycCs,tj|j|}|dkrtdt|d}|S)z5Do an entity lookup in the DTD entity hash table and NzxmlGetDtdEntity() failed)r )r2ZxmlGetDtdEntityrrr)rrCr*r&rrr dtdEntitys  zxmlDoc.dtdEntitycCstj|j|}|S)zTODO: remove xmlEncodeEntities, once we are not afraid of breaking binary compatibility People must migrate their code to xmlEncodeEntitiesReentrant ! This routine will issue a warning when encountered. )r2ZxmlEncodeEntitiesr)rrr*rrrencodeEntities#szxmlDoc.encodeEntitiescCstj|j|}|S)aDo a global encoding of a string, replacing the predefined entities and non ASCII values with their entities and CharRef counterparts. Contrary to xmlEncodeEntities, this routine is reentrant, and result must be deallocated. )r2ZxmlEncodeEntitiesReentrantr)rrr*rrrencodeEntitiesReentrant+szxmlDoc.encodeEntitiesReentrantcCstj|j|}|S)zDo a global encoding of a string, replacing the predefined entities this routine is reentrant, and result must be deallocated. )r2ZxmlEncodeSpecialCharsr)rrr*rrrencodeSpecialChars3szxmlDoc.encodeSpecialCharscCs4tj|j|||||}|dkr&tdt|d}|S)aQCreate a new entity, this differs from xmlAddDocEntity() that if the document is None or has no internal subset defined, then an unlinked entity structure will be returned, it is then the responsability of the caller to link it to the document later or free it when not needed anymore. NzxmlNewEntity() failed)r )r2Z xmlNewEntityrrr)rrCr rrGrHr*r&rrr newEntity:s  zxmlDoc.newEntitycCs,tj|j|}|dkrtdt|d}|S)z=Do an entity lookup in the internal and external subsets and NzxmlGetParameterEntity() failed)r )r2ZxmlGetParameterEntityrrr)rrCr*r&rrrparameterEntityFs  zxmlDoc.parameterEntitycCs*tj|j}|dkrtdt|d}|S)zCreate an XML RelaxNGs parser context for that document. Note: since the process of compiling a RelaxNG schemas modifies the document, the @doc parameter is duplicated internally. Nz#xmlRelaxNGNewDocParserCtxt() failed)r )r2ZxmlRelaxNGNewDocParserCtxtrrr{)rr*r&rrrrelaxNGNewDocParserCtxtQs   zxmlDoc.relaxNGNewDocParserCtxtcCs&|dkrd}n|j}tj||j}|S)z$Validate a document tree in memory. N)rr2xmlRelaxNGValidateDoc)rrrer*rrrrelaxNGValidateDoc[s zxmlDoc.relaxNGValidateDoccCs<|dkrd}n|j}|dkr"d}n|j}tj||j|}|S)zValidate a full subtree when xmlRelaxNGValidatePushElement() returned 0 and the content of the node has been expanded. N)rr2xmlRelaxNGValidateFullElement)rrrPrerr*rrrrelaxNGValidateFullElementbsz!xmlDoc.relaxNGValidateFullElementcCs<|dkrd}n|j}|dkr"d}n|j}tj||j|}|S)z7Pop the element end from the RelaxNG validation stack. N)rr2xmlRelaxNGValidatePopElement)rrrPrerr*rrrrelaxNGValidatePopElementmsz xmlDoc.relaxNGValidatePopElementcCs<|dkrd}n|j}|dkr"d}n|j}tj||j|}|S)z:Push a new element start on the RelaxNG validation stack. N)rr2xmlRelaxNGValidatePushElement)rrrPrerr*rrrrelaxNGValidatePushElementvsz!xmlDoc.relaxNGValidatePushElementcCs,tj|j|}|dkrtdt|d}|S)zDo a copy of the document info. If recursive, the content tree will be copied too as well as DTD, namespaces and entities. NzxmlCopyDoc() failed)r )r2Z xmlCopyDocrrrt)r recursiver*r&rrrcopyDocs  zxmlDoc.copyDoccCsB|dkrd}n|j}tj||j|}|dkr4tdt|d}|S)z+Do a copy of the node to a given document. NzxmlDocCopyNode() failed)r )rr2rrr)rrrnode__or*r&rrrrs zxmlDoc.copyNodecCs@|dkrd}n|j}tj|j|}|dkr2tdt|d}|S)z&Do a recursive copy of the node list. NzxmlDocCopyNodeList() failed)r )rr2rrr)rrr;r*r&rrrrs zxmlDoc.copyNodeListcCs0tj|j|||}|dkr"tdt|d}|S)z)Create the internal subset of a document NzxmlCreateIntSubset() failed)r )r2ZxmlCreateIntSubsetrrr)rrCrrGr*r&rrrcreateIntSubsets  zxmlDoc.createIntSubsetcCstj|j}|S)z5get the compression ratio for a document, ZLIB based )r2ZxmlGetDocCompressModer)rr*rrrdocCompressModes zxmlDoc.docCompressModecCstj||j}|S)z&Dump an XML document to an open FILE. )r2Z xmlDocDumpr)rrr*rrrdumpsz xmlDoc.dumpcCs(|dkrd}n|j}tj||j|dS)zQDump an XML/HTML node, recursive behaviour, children are printed too. N)rr2Z xmlElemDump)rrrrrrrelemDumpszxmlDoc.elemDumpcCstj||j|}|S)z&Dump an XML document to an open FILE. )r2ZxmlDocFormatDumpr)rrr{r*rrr formatDumpszxmlDoc.formatDumpcCstj|jdS)zIFree up all the structures used by a document, tree included. N)r2rr)rrrrfreeDocszxmlDoc.freeDoccCs*tj|j}|dkrtdt|d}|S)zvGet the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...). NzxmlDocGetRootElement() failed)r )r2ZxmlDocGetRootElementrrr)rr*r&rrrgetRootElements   zxmlDoc.getRootElementcCs*tj|j}|dkrtdt|d}|S)z&Get the internal subset of a document NzxmlGetIntSubset() failed)r )r2ZxmlGetIntSubsetrrr)rr*r&rrr intSubsets   zxmlDoc.intSubsetcCs.tj|j||}|dkr tdt|d}|S)z1Creation of a new node containing a CDATA block. NzxmlNewCDataBlock() failed)r )r2ZxmlNewCDataBlockrrr)rrHr)r*r&rrr newCDataBlocks  zxmlDoc.newCDataBlockcCs,tj|j|}|dkrtdt|d}|S)z,Creation of a new character reference node. NzxmlNewCharRef() failed)r )r2Z xmlNewCharRefrrr)rrCr*r&rrr newCharRefs  zxmlDoc.newCharRefcCs,tj|j|}|dkrtdt|d}|S)zJCreation of a new node containing a comment within a document. NzxmlNewDocComment() failed)r )r2ZxmlNewDocCommentrrr)rrHr*r&rrr newDocComments  zxmlDoc.newDocCommentcCs*tj|j}|dkrtdt|d}|S)z!Creation of a new Fragment node. NzxmlNewDocFragment() failed)r )r2ZxmlNewDocFragmentrrr)rr*r&rrrnewDocFragments   zxmlDoc.newDocFragmentcCsD|dkrd}n|j}tj|j|||}|dkr6tdt|d}|S)atCreation of a new node element within a document. @ns and @content are optional (None). NOTE: @content is supposed to be a piece of XML CDATA, so it allow entities references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you don't need entities support. NzxmlNewDocNode() failed)r )rr2 xmlNewDocNoderr)rryrCrHrr*r&rrr newDocNodes zxmlDoc.newDocNodecCsD|dkrd}n|j}tj|j|||}|dkr6tdt|d}|S)atCreation of a new node element within a document. @ns and @content are optional (None). NOTE: @content is supposed to be a piece of XML CDATA, so it allow entities references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you don't need entities support. NzxmlNewDocNodeEatName() failed)r )rr2xmlNewDocNodeEatNamerr)rryrCrHrr*r&rrrnewDocNodeEatNames zxmlDoc.newDocNodeEatNamecCs.tj|j||}|dkr tdt|d}|S)z.Creation of a processing instruction element. NzxmlNewDocPI() failed)r )r2Z xmlNewDocPIrrr)rrCrHr*r&rrrnewDocPIs  zxmlDoc.newDocPIcCs.tj|j||}|dkr tdt|d}|S)z-Create a new property carried by a document. NzxmlNewDocProp() failed)r )r2Z xmlNewDocProprrri)rrCrr*r&rrr newDocProps  zxmlDoc.newDocPropcCsD|dkrd}n|j}tj|j|||}|dkr6tdt|d}|S)zcCreation of a new node element within a document. @ns and @content are optional (None). NzxmlNewDocRawNode() failed)r )rr2xmlNewDocRawNoderr)rryrCrHrr*r&rrr newDocRawNodes zxmlDoc.newDocRawNodecCs,tj|j|}|dkrtdt|d}|S)z/Creation of a new text node within a document. NzxmlNewDocText() failed)r )r2Z xmlNewDocTextrrr)rrHr*r&rrr newDocText s  zxmlDoc.newDocTextcCs.tj|j||}|dkr tdt|d}|S)zzCreation of a new text node with an extra content length parameter. The text node pertain to a given document. NzxmlNewDocTextLen() failed)r )r2ZxmlNewDocTextLenrrr)rrHr)r*r&rrr newDocTextLen's  zxmlDoc.newDocTextLencCs0tj|j|||}|dkr"tdt|d}|S)zrCreation of a new DTD for the external subset. To create an internal subset, use xmlCreateIntSubset(). NzxmlNewDtd() failed)r )r2Z xmlNewDtdrrr)rrCrrGr*r&rrrnewDtd/s  z xmlDoc.newDtdcCs.tj|j||}|dkr tdt|d}|S)z\Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!! NzxmlNewGlobalNs() failed)r )r2ZxmlNewGlobalNsrrr)rrr~r*r&rrr newGlobalNs7s  zxmlDoc.newGlobalNscCs,tj|j|}|dkrtdt|d}|S)z"Creation of a new reference node. NzxmlNewReference() failed)r )r2ZxmlNewReferencerrr)rrCr*r&rrr newReference?s  zxmlDoc.newReferencecCsB|dkrd}n|j}|dkr"d}n|j}tj||j||||dS)zDump an XML node, recursive behaviour, children are printed too. Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was called N)rr2xmlNodeDumpOutput)rrrrr{rzrrrrrnodeDumpOutputFszxmlDoc.nodeDumpOutputcCs&|dkrd}n|j}tj|j|}|S)aSearches for the BASE URL. The code should work on both XML and HTML document even if base mechanisms are completely different. It returns the base as defined in RFC 2396 sections 5.1.1. Base URI within Document Content and 5.1.2. Base URI from the Encapsulating Entity However it does not return the document base (5.1.3), use doc->URL in this case N)rr2r)rrrr*rrr nodeGetBaseQs zxmlDoc.nodeGetBasecCs(|dkrd}n|j}tj|j||}|S)zBuilds the string equivalent to the text contained in the Node list made of TEXTs and ENTITY_REFs, contrary to xmlNodeListGetString() this function doesn't do any character encoding handling. N)rr2r)rrrlist__or*rrrnodeListGetRawString]s zxmlDoc.nodeListGetRawStringcCs(|dkrd}n|j}tj|j||}|S)zlBuild the string equivalent to the text contained in the Node list made of TEXTs and ENTITY_REFs N)rr2r)rrrrXr*rrrnodeListGetStringgs zxmlDoc.nodeListGetStringcCs&|dkrd}n|j}tj|j|}|S)a!This function checks that all the namespaces declared within the given tree are properly declared. This is needed for example after Copy or Cut and then paste operations. The subtree may still hold pointers to namespace declarations outside the subtree or invalid/masked. As much as possible the function try to reuse the existing namespaces found in the new environment. If not possible the new namespaces are redeclared on @tree at the top of the given subtree. N)rr2r)rtreetree__or*rrrros zxmlDoc.reconciliateNscCstj||j}|S)zDump an XML document to a file. Will use compression if compiled in and enabled. If @filename is "-" the stdout file is used. )r2Z xmlSaveFiler)rrr*rrrsaveFile~szxmlDoc.saveFilecCstj||j|}|S)z:Dump an XML document, converting it to the given encoding )r2ZxmlSaveFileEncr)rrrzr*rrr saveFileEncszxmlDoc.saveFileEnccCs(|dkrd}n|j}tj||j|}|S)zDump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is not available after this call. N)rr2 xmlSaveFileTo)rrrzrr*rrr saveFileTos zxmlDoc.saveFileTocCstj||j|}|S)adDump an XML document to a file. Will use compression if compiled in and enabled. If @filename is "-" the stdout file is used. If @format is set then the document will be indented on output. Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was called )r2ZxmlSaveFormatFiler)rrr{r*rrrsaveFormatFileszxmlDoc.saveFormatFilecCstj||j||}|S)z*Dump an XML document to a file or an URL. )r2ZxmlSaveFormatFileEncr)rrrzr{r*rrrsaveFormatFileEncszxmlDoc.saveFormatFileEnccCs*|dkrd}n|j}tj||j||}|S)zDump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is not available after this call. N)rr2xmlSaveFormatFileTo)rrrzr{rr*rrrsaveFormatFileTos zxmlDoc.saveFormatFileTocCsB|dkrd}n|j}tj|j||}|dkr4tdt|d}|S)aSearch a Ns registered under a given name space for a document. recurse on the parents until it finds the defined namespace or return None otherwise. @nameSpace can be None, this is a search for the default namespace. We don't allow to cross entities boundaries. If you don't declare the namespace within those you will be in troubles !!! A warning is generated to cover this case. NzxmlSearchNs() failed)r )rr2rrr)rrrr;r*r&rrrrs zxmlDoc.searchNscCsB|dkrd}n|j}tj|j||}|dkr4tdt|d}|S)zSearch a Ns aliasing a given URI. Recurse on the parents until it finds the defined namespace or return None otherwise. NzxmlSearchNsByHref() failed)r )rr2rrr)rrrr;r*r&rrrrs zxmlDoc.searchNsByHrefcCstj|j|dS)zxset the compression ratio for a document, ZLIB based Correct values: 0 (uncompressed) to 9 (max compression) N)r2ZxmlSetDocCompressModer)rrrrrsetDocCompressModeszxmlDoc.setDocCompressModecCs&|dkrd}n|j}tj||jdS)zchildren is a list containing possibly comments, PIs, etc ...). N)r )rr2rr)rrootZroot__or*r&rrrsetRootElements zxmlDoc.setRootElementcCs&|dkrd}n|j}tj||jdS)zJupdate all nodes under the tree to point to the right document N)rr2r)rr[r\rrrrszxmlDoc.setTreeDoccCs,tj|j|}|dkrtdt|d}|S)zParse the value string and build the node list associated. Should produce a flat tree with only TEXTs and ENTITY_REFs. NzxmlStringGetNodeList() failed)r )r2ZxmlStringGetNodeListrrr)rrr*r&rrrstringGetNodeLists  zxmlDoc.stringGetNodeListcCs.tj|j||}|dkr tdt|d}|S)zParse the value string and build the node list associated. Should produce a flat tree with only TEXTs and ENTITY_REFs. Nz xmlStringLenGetNodeList() failed)r )r2ZxmlStringLenGetNodeListrrr)rrr)r*r&rrrstringLenGetNodeLists  zxmlDoc.stringLenGetNodeListcCs,tj|j|}|dkrtdt|d}|S)z,Search the attribute declaring the given ID NzxmlGetID() failed)r )r2ZxmlGetIDrrri)rrZr*r&rrrrZs  z xmlDoc.IDcCs<|dkrd}n|j}|dkr"d}n|j}tj|j||}|S)zDetermine whether an attribute is of type ID. In case we have DTD(s) then this is done if DTD loading has been requested. In the case of HTML documents parsed with the HTML parser, then ID detection is done systematically. N)rr2r)rrPrxrrr*rrrrsz xmlDoc.isIDcCstj|j|}|S)zSearch in the DtDs whether an element accept Mixed content (or ANY) basically if it is supposed to accept text childs )r2ZxmlIsMixedElementr)rrCr*rrrisMixedElementszxmlDoc.isMixedElementcCs<|dkrd}n|j}|dkr"d}n|j}tj|j||}|S)zDetermine whether an attribute is of type Ref. In case we have DTD(s) then this is simple, otherwise we use an heuristic: name Ref (upper or lowercase). N)rr2r)rrPrxrrr*rrrrsz xmlDoc.isRefcCs&|dkrd}n|j}tj|j|}|S)zORemove the given attribute from the ID table maintained internally. N)rr2 xmlRemoveID)rrxrr*rrrremoveIDs zxmlDoc.removeIDcCs&|dkrd}n|j}tj|j|}|S)zPRemove the given attribute from the Ref table maintained internally. N)rr2 xmlRemoveRef)rrxrr*rrr removeRef!s zxmlDoc.removeRefcCs@|dkrd}n|j}|dkr"d}n|j}tj||j|||}|S)aDoes the validation related extra step of the normalization of attribute values: If the declared value is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by single space (#x20) character. Also check VC: Standalone Document Declaration in P32, and update ctxt->valid accordingly N)rr2#xmlValidCtxtNormalizeAttributeValue)rrrPrCrrerr*rrr validCtxtNormalizeAttributeValue)s z'xmlDoc.validCtxtNormalizeAttributeValuecCs*|dkrd}n|j}tj|j|||}|S)aDoes the validation related extra step of the normalization of attribute values: If the declared value is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by single space (#x20) character. N)rr2r)rrPrCrrr*rrrr9s z#xmlDoc.validNormalizeAttributeValuecCs&|dkrd}n|j}tj||j}|S)zTry to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree. N)rr2xmlValidateDocument)rrrer*rrrvalidateDocumentEs zxmlDoc.validateDocumentcCs&|dkrd}n|j}tj||j}|S)aDoes the final step for the document validation once all the incremental validation steps have been completed basically it does the following checks described by the XML Rec Check all the IDREF/IDREFS attributes definition for validity N)rr2xmlValidateDocumentFinal)rrrer*rrrvalidateDocumentFinalOs zxmlDoc.validateDocumentFinalcCs<|dkrd}n|j}|dkr"d}n|j}tj||j|}|S)aTry to validate the document against the dtd instance Basically it does check all the definitions in the DtD. Note the the internal subset (if present) is de-coupled (i.e. not used), which could give problems if ID or IDREF is present. N)rr2xmlValidateDtd)rrrredtd__or*rrr validateDtdZszxmlDoc.validateDtdcCs&|dkrd}n|j}tj||j}|S)aDoes the final step for the dtds validation once all the subsets have been parsed basically it does the following checks described by the XML Rec - check that ENTITY and ENTITIES type attributes default or possible values matches one of the defined entities. - check that NOTATION type attributes default or possible values matches one of the defined notations. N)rr2xmlValidateDtdFinal)rrrer*rrrvalidateDtdFinalgs zxmlDoc.validateDtdFinalcCs<|dkrd}n|j}|dkr"d}n|j}tj||j|}|S)z-Try to validate the subtree under an element N)rr2xmlValidateElement)rrrPrerr*rrrvalidateElementtszxmlDoc.validateElementcCs(|dkrd}n|j}tj||j|}|S)zbValidate that the given name match a notation declaration. - [ VC: Notation Declared ] N)rr2xmlValidateNotationUse)rrrSrer*rrrvalidateNotationUse}s zxmlDoc.validateNotationUsec CsT|dkrd}n|j}|dkr"d}n|j}|dkr6d}n|j}tj||j|||}|S)aTry to validate a single attribute for an element basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Value Type ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity Name ] - [ VC: Notation Attributes ] The ID/IDREF uniqueness and matching are done separately N)rr2xmlValidateOneAttribute) rrrPrxrrerrr*rrrvalidateOneAttributeszxmlDoc.validateOneAttributecCs<|dkrd}n|j}|dkr"d}n|j}tj||j|}|S)a]Try to validate a single element and it's attributes, basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC: Required Attribute ] Then call xmlValidateOneAttribute() for each attribute present. The ID/IDREF checkings are done separately N)rr2xmlValidateOneElement)rrrPrerr*rrrvalidateOneElementszxmlDoc.validateOneElementc CsV|dkrd}n|j}|dkr"d}n|j}|dkr6d}n|j}tj||j||||} | S)aTry to validate a single namespace declaration for an element basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Value Type ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity Name ] - [ VC: Notation Attributes ] The ID/IDREF uniqueness and matching are done separately N)rr2xmlValidateOneNamespace) rrrPr~ryrrerrr*rrrvalidateOneNamespaceszxmlDoc.validateOneNamespacecCs>|dkrd}n|j}|dkr"d}n|j}tj||j||}|S)z/Pop the element end from the validation stack. N)rr2xmlValidatePopElement)rrrPqnamererr*rrrvalidatePopElementszxmlDoc.validatePopElementcCs>|dkrd}n|j}|dkr"d}n|j}tj||j||}|S)z2Push a new element start on the validation stack. N)rr2xmlValidatePushElement)rrrPrrerr*rrrvalidatePushElementszxmlDoc.validatePushElementcCs&|dkrd}n|j}tj||j}|S)zTry to validate a the root element basically it does the following check as described by the XML-1.0 recommendation: - [ VC: Root Element Type ] it doesn't try to recurse or apply other check to the element N)rr2xmlValidateRoot)rrrer*rrr validateRoots zxmlDoc.validateRootcCstj|j}|S)z=Implement the XInclude substitution on the XML document @doc )r2ZxmlXIncludeProcessr)rr*rrrxincludeProcesss zxmlDoc.xincludeProcesscCstj|j|}|S)z=Implement the XInclude substitution on the XML document @doc )r2ZxmlXIncludeProcessFlagsr)rrr*rrrxincludeProcessFlagsszxmlDoc.xincludeProcessFlagscCs&|dkrd}n|j}tj||j}|S)zuSetup an xmltextReader to parse a preparsed XML document. This reuses the existing @reader xmlTextReader. N)rr2xmlReaderNewWalker)rreader reader__or*rrr NewWalkers zxmlDoc.NewWalkercCs*tj|j}|dkrtdt|d}|S)z2Create an xmltextReader for a preparsed document. NzxmlReaderWalker() failed)r )r2ZxmlReaderWalkerrrr)rr*r&rrr readerWalkers   zxmlDoc.readerWalkercCs*tj|j}|dkrtdt|d}|S)zCreate an XML Schemas parse context for that document. NB. The document may be modified during the parsing process. Nz"xmlSchemaNewDocParserCtxt() failed)r )r2ZxmlSchemaNewDocParserCtxtrrr)rr*r&rrrschemaNewDocParserCtxts   zxmlDoc.schemaNewDocParserCtxtcCs&|dkrd}n|j}tj||j}|S)z$Validate a document tree in memory. N)rr2xmlSchemaValidateDoc)rrrer*rrrschemaValidateDocs zxmlDoc.schemaValidateDoccCs*tj|j}|dkrtdt|d}|S)zCreate a new xmlXPathContext NzxmlXPathNewContext() failed)r )r2ZxmlXPathNewContextrrr )rr*r&rrrr s   zxmlDoc.xpathNewContextcCstj|j}|S)amCall this routine to speed up XPath computation on static documents. This stamps all the element nodes with the document order Like for line information, the order is kept in the element->content field, the value stored is actually - the node number (starting at -1) to be able to differentiate from line numbers. )r2ZxmlXPathOrderDocElemsr)rr*rrrxpathOrderDocElemss zxmlDoc.xpathOrderDocElemscCsV|dkrd}n|j}|dkr"d}n|j}tj|j||}|dkrHtdt|d}|S)zCreate a new XPointer context NzxmlXPtrNewContext() failed)r )rr2rrr )rherer Zhere__or r*r&rrrr s zxmlDoc.xpointerNewContext)N)nrrrrrwrrrrrrrrrrrrr r!r"r#r$r%r'r(r)r*r+r,r-r.r/r0r2r4r6r8r:rrr<r=r>r?r@rArBrCrDrErFrGrIrKrLrMrOrPrQrRrSrTrVrWrYrZrr]r^r`rarbrdrrrerrgrrhrirZrrjrrlrnrprrrrtrwryr{r}rrrrrrrrrrrrrrr rrrrrt{s                                       rtc@seZdZdddZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Z!d@dAZ"dBdCZ#dDdEZ$dFdGZ%dHdIZ&dJdKZ'dLdMZ(dNdOZ)dPdQZ*dRdSZ+dTdUZ,dVdWZ-dXdYZ.dZd[Z/d\d]Z0d^d_Z1d`daZ2dbdcZ3dddeZ4dfdgZ5dhdiZ6djdkZ7dldmZ8dndoZ9dpdqZ:drdsZ;dtduZdzd{Z?d|d}Z@d~dZAddZBddZCddZDddZEddZFddZGddZHddZIddZJddZKddZLddZMddZNddZOddZPddZQddZRddZSddZTddZUdS)rNcCs||_tj||ddS)N)r )rrr)rr rrrr*szparserCtxt.__init__cCs |jdkrtj|jd|_dS)N)rr2r)rrrrr5.s  zparserCtxt.__del__cCs*tj|j}|dkrtdt|d}|S)z-Get the document tree from a parser context. NzxmlParserGetDoc() failed)r )r2ZxmlParserGetDocrrrt)rr*_parserCtxt__tmprrrrs4s   zparserCtxt.doccCstj|j}|S)z4Get the validity information from a parser context. )r2ZxmlParserGetIsValidr)rr*rrrisValid;s zparserCtxt.isValidcCstj|j|dS)zmyDoc is not freed. N)r2htmlFreeParserCtxtr)rrrrrszparserCtxt.htmlFreeParserCtxtcCstj|j}|S)zcparse Reference declarations [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';' )r2htmlParseCharRefr)rr*rrrrs zparserCtxt.htmlParseCharRefcCstj|j|||}|S)zParse a Chunk of memory )r2htmlParseChunkr)rror terminater*rrrrszparserCtxt.htmlParseChunkcCstj|j}|S)zZparse an HTML document (and build a tree if using the standard SAX interface). )r2htmlParseDocumentr)rr*rrrrs zparserCtxt.htmlParseDocumentcCstj|jdS)zparse an HTML element, this is highly recursive this is kept for compatibility with previous code versions [39] element ::= EmptyElemTag | STag content ETag [41] Attribute ::= Name Eq AttValue N)r2htmlParseElementr)rrrrrszparserCtxt.htmlParseElementcCstj|j}|S)aThis function provides the current index of the parser relative to the start of the current entity. This function is computed in bytes from the beginning starting at zero and finishing at the size in byte of the file if parsing a file. The function is of constant cost if the input is UTF-8 but can be costly if run on non-UTF-8 input. )r2ZxmlByteConsumedr)rr*rrr byteConsumeds zparserCtxt.byteConsumedcCstj|jdS)zMClear (release owned resources) and reinitialize a parser context N)r2ZxmlClearParserCtxtr)rrrrclearParserCtxtszparserCtxt.clearParserCtxtcCs2tj|j||||}|dkr$tdt|d}|S)zkparse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context NzxmlCtxtReadDoc() failed)r )r2ZxmlCtxtReadDocrrrt)rrrrzrr*rrrr ctxtReadDocs  zparserCtxt.ctxtReadDoccCs2tj|j||||}|dkr$tdt|d}|S)zparse an XML from a file descriptor and build a tree. This reuses the existing @ctxt parser context NOTE that the file descriptor will not be closed when the reader is closed or reset. NzxmlCtxtReadFd() failed)r )r2Z xmlCtxtReadFdrrrt)rrrrzrr*rrrr ctxtReadFds  zparserCtxt.ctxtReadFdcCs0tj|j|||}|dkr"tdt|d}|S)zoparse an XML file from the filesystem or the network. This reuses the existing @ctxt parser context NzxmlCtxtReadFile() failed)r )r2ZxmlCtxtReadFilerrrt)rrrzrr*rrrr ctxtReadFiles  zparserCtxt.ctxtReadFilecCs4tj|j|||||}|dkr&tdt|d}|S)zkparse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context NzxmlCtxtReadMemory() failed)r )r2ZxmlCtxtReadMemoryrrrt)rrrrrzrr*rrrrctxtReadMemorys  zparserCtxt.ctxtReadMemorycCstj|jdS)zReset a parser context N)r2Z xmlCtxtResetr)rrrr ctxtResetszparserCtxt.ctxtResetcCstj|j||||}|S)zReset a push parser context )r2ZxmlCtxtResetPushr)rrorrrzr*rrr ctxtResetPushszparserCtxt.ctxtResetPushcCstj|j|}|S)z*Applies the options to the parser context )r2ZxmlCtxtUseOptionsr)rrr*rrrctxtUseOptionsszparserCtxt.ctxtUseOptionscCstj|j}|S)zInitialize a parser context )r2ZxmlInitParserCtxtr)rr*rrrinitParserCtxts zparserCtxt.initParserCtxtcCstj|j|||}|S)zParse a Chunk of memory )r2Z xmlParseChunkr)rrorrr*rrr parseChunkszparserCtxt.parseChunkcCstj|j}|S)zparse an XML document (and build a tree if using the standard SAX interface). [1] document ::= prolog element Misc* [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)? )r2ZxmlParseDocumentr)rr*rrr parseDocuments zparserCtxt.parseDocumentcCstj|j}|S)zparse a general parsed entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. [78] extParsedEnt ::= TextDecl? content )r2ZxmlParseExtParsedEntr)rr*rrrparseExtParsedEnts zparserCtxt.parseExtParsedEntcCstj|j||dS)zSetup the parser context to parse a new buffer; Clears any prior contents from the parser context. The buffer parameter must not be None, but the filename parameter can be N)r2ZxmlSetupParserForBufferr)rrrrrrsetupParserForBufferszparserCtxt.setupParserForBuffercCstj|jdS)z!Blocks further parser processing N)r2Z xmlStopParserr)rrrr stopParserszparserCtxt.stopParsercCstj|j|||||}|S)zThis function is deprecated, we now always process entities content through xmlStringDecodeEntities TODO: remove it in next major release. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';' )r2ZxmlDecodeEntitiesr)rr)whatr end2end3r*rrrdecodeEntities szparserCtxt.decodeEntitiescCs&|dkrd}n|j}tj|j|dS)zDefault handling of defined entities, when should we define a new input stream ? When do we just handle that as a set of chars ? OBSOLETE: to be removed at some point. N)rr2xmlHandleEntity)rZentityZ entity__orrr handleEntityszparserCtxt.handleEntitycCstj|j}|S)aCparse an XML namespace name. TODO: this seems not in use anymore, the namespace handling is done on top of the SAX interfaces, i.e. not on raw input. [NS 3] NCName ::= (Letter | '_') (NCNameChar)* [NS 4] NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender )r2ZxmlNamespaceParseNCNamer)rr*rrrnamespaceParseNCNames zparserCtxt.namespaceParseNCNamecCstj|j}|S)a!parse a namespace prefix declaration TODO: this seems not in use anymore, the namespace handling is done on top of the SAX interfaces, i.e. not on raw input. [NS 1] NSDef ::= PrefixDef Eq SystemLiteral [NS 2] PrefixDef ::= 'xmlns' (':' NCName)? )r2ZxmlNamespaceParseNSDefr)rr*rrrnamespaceParseNSDef&s zparserCtxt.namespaceParseNSDefcCstj|jdS)z"Skip to the next char input char. N)r2Z xmlNextCharr)rrrrnextChar/szparserCtxt.nextCharcCstj|j}|S)a parse a value for an attribute Note: the parser won't do substitution of entities here, this will be handled later in xmlStringGetNodeList [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'" 3.3.3 Attribute-Value Normalization: Before the value of an attribute is passed to the application or checked for validity, the XML processor must normalize it as follows: - a character reference is processed by appending the referenced character to the attribute value - an entity reference is processed by recursively processing the replacement text of the entity - a whitespace character (#x20, #xD, #xA, #x9) is processed by appending #x20 to the normalized value, except that only a single #x20 is appended for a "#xD#xA" sequence that is part of an external parsed entity or the literal entity value of an internal parsed entity - other characters are processed by appending them to the normalized value If the declared value is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by a single space (#x20) character. All attributes for which no declaration has been read should be treated by a non-validating parser as if declared CDATA. )r2ZxmlParseAttValuer)rr*rrr parseAttValue3s zparserCtxt.parseAttValuecCstj|jdS)z: parse the Attribute list def for an element [52] AttlistDecl ::= '' [53] AttDef ::= S Name S AttType S DefaultDecl N)r2ZxmlParseAttributeListDeclr)rrrrparseAttributeListDeclOsz!parserCtxt.parseAttributeListDeclcCstj|jdS)zParse escaped pure raw content. [18] CDSect ::= CDStart CData CDEnd [19] CDStart ::= '' Char*)) [21] CDEnd ::= ']]>' N)r2ZxmlParseCDSectr)rrrr parseCDSectUszparserCtxt.parseCDSectcCstj|j|dS)aparse a CharData section. if we are within a CDATA section ']]>' marks an end of section. The right angle bracket (>) may be represented using the string ">", and must, for compatibility, be escaped using ">" or a character reference when it appears in the string "]]>" in content, when that string is not marking the end of a CDATA section. [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) N)r2ZxmlParseCharDatar)rZcdatarrr parseCharData[szparserCtxt.parseCharDatacCstj|j}|S)zparse Reference declarations [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';' [ WFC: Legal Character ] Characters referred to using character references must match the production for Char. )r2ZxmlParseCharRefr)rr*rrr parseCharRefes zparserCtxt.parseCharRefcCstj|jdS)zSkip an XML (SGML) comment The spec says that "For compatibility, the string "--" (double-hyphen) must not occur within comments. " [15] Comment ::= '' N)r2ZxmlParseCommentr)rrrr parseCommentmszparserCtxt.parseCommentcCstj|jdS)zhParse a content: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)* N)r2ZxmlParseContentr)rrrr parseContenttszparserCtxt.parseContentcCstj|jdS)a)parse a DOCTYPE declaration [28] doctypedecl ::= '' [ VC: Root Element Type ] The Name in the document type declaration must match the element type of the root element. N)r2ZxmlParseDocTypeDeclr)rrrrparseDocTypeDeclyszparserCtxt.parseDocTypeDeclcCstj|jdS)zparse an XML element, this is highly recursive [39] element ::= EmptyElemTag | STag content ETag [ WFC: Element Type Match ] The Name in an element's end-tag must match the element type in the start-tag. N)r2ZxmlParseElementr)rrrr parseElementszparserCtxt.parseElementcCstj|j}|S)zparse an Element declaration. [45] elementdecl ::= '' [ VC: Unique Element Type Declaration ] No element type may be declared more than once )r2ZxmlParseElementDeclr)rr*rrrparseElementDecls zparserCtxt.parseElementDeclcCstj|j}|S)zYparse the XML encoding name [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')* )r2ZxmlParseEncNamer)rr*rrr parseEncNames zparserCtxt.parseEncNamecCstj|j}|S)zparse the XML encoding declaration [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'") this setups the conversion filters. )r2ZxmlParseEncodingDeclr)rr*rrrparseEncodingDecls zparserCtxt.parseEncodingDeclcCstj|jdS)zrparse an end of tag [42] ETag ::= '' With namespace [NS 9] ETag ::= '' N)r2ZxmlParseEndTagr)rrrr parseEndTagszparserCtxt.parseEndTagcCstj|jdS)aparse ' [72] PEDecl ::= '' [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?) [74] PEDef ::= EntityValue | ExternalID [76] NDataDecl ::= S 'NDATA' S Name [ VC: Notation Declared ] The Name must match the declared name of a notation. N)r2ZxmlParseEntityDeclr)rrrrparseEntityDeclszparserCtxt.parseEntityDeclcCs*tj|j}|dkrtdt|d}|S)aparse ENTITY references declarations [68] EntityRef ::= '&' Name ';' [ WFC: Entity Declared ] In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, or a document with "standalone='yes'", the Name given in the entity reference must match that in an entity declaration, except that well-formed documents need not declare any of the following entities: amp, lt, gt, apos, quot. The declaration of a parameter entity must precede any reference to it. Similarly, the declaration of a general entity must precede any reference to it which appears in a default value in an attribute-list declaration. Note that if entities are declared in the external subset or in external parameter entities, a non-validating processor is not obligated to read and process their declarations; for such documents, the rule that an entity must be declared is a well-formedness constraint only if standalone='yes'. [ WFC: Parsed Entity ] An entity reference must not contain the name of an unparsed entity NzxmlParseEntityRef() failed)r )r2ZxmlParseEntityRefrrr)rr*rrrrparseEntityRefs   zparserCtxt.parseEntityRefcCstj|j||dS)zparse Markup declarations from an external subset [30] extSubset ::= textDecl? extSubsetDecl [31] extSubsetDecl ::= (markupdecl | conditionalSect | PEReference | S) * N)r2ZxmlParseExternalSubsetr)rrrGrrrparseExternalSubsetszparserCtxt.parseExternalSubsetcCstj|jdS)asparse Markup declarations [29] markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment [ VC: Proper Declaration/PE Nesting ] Parameter-entity replacement text must be properly nested with markup declarations. That is to say, if either the first character or the last character of a markup declaration (markupdecl above) is contained in the replacement text for a parameter-entity reference, both must be contained in the same replacement text. [ WFC: PEs in Internal Subset ] In the internal DTD subset, parameter-entity references can occur only where markup declarations can occur, not within markup declarations. (This does not apply to references that occur in external parameter entities or to the external subset.) N)r2ZxmlParseMarkupDeclr)rrrrparseMarkupDeclszparserCtxt.parseMarkupDeclcCstj|jdS)zOparse an XML Misc* optional field. [27] Misc ::= Comment | PI | S N)r2Z xmlParseMiscr)rrrr parseMiscszparserCtxt.parseMisccCstj|j}|S)zparse an XML name. [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender [5] Name ::= (Letter | '_' | ':') (NameChar)* [6] Names ::= Name (#x20 Name)* )r2Z xmlParseNamer)rr*rrr parseNames zparserCtxt.parseNamecCstj|jdS)avxmlParseNamespace: parse specific PI '' Hence there is actually 3 choices: 'PUBLIC' S PubidLiteral 'PUBLIC' S PubidLiteral S SystemLiteral and 'SYSTEM' S SystemLiteral See the NOTE on xmlParseExternalID(). N)r2ZxmlParseNotationDeclr)rrrrparseNotationDeclszparserCtxt.parseNotationDeclcCstj|jdS)aparse PEReference declarations The entity content is handled directly by pushing it's content as a new input stream. [69] PEReference ::= '%' Name ';' [ WFC: No Recursion ] A parsed entity must not contain a recursive reference to itself, either directly or indirectly. [ WFC: Entity Declared ] In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, or a document with "standalone='yes'", ... ... The declaration of a parameter entity must precede any reference to it... [ VC: Entity Declared ] In a document with an external subset or external parameter entities with "standalone='no'", ... ... The declaration of a parameter entity must precede any reference to it... [ WFC: In DTD ] Parameter-entity references may only appear in the DTD. NOTE: misleading but this is handled. N)r2ZxmlParsePEReferencer)rrrrparsePEReferenceszparserCtxt.parsePEReferencecCstj|jdS)zparse an XML Processing Instruction. [16] PI ::= '' Char*)))? '?>' The processing is transfered to SAX once parsed. N)r2Z xmlParsePIr)rrrrparsePIszparserCtxt.parsePIcCstj|j}|S)zbparse the name of a PI [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l')) )r2ZxmlParsePITargetr)rr*rrr parsePITargets zparserCtxt.parsePITargetcCstj|j}|S)znparse an XML public literal [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'" )r2ZxmlParsePubidLiteralr)rr*rrrparsePubidLiterals zparserCtxt.parsePubidLiteralcCstj|j}|S)zParse and return a string between quotes or doublequotes TODO: Deprecated, to be removed at next drop of binary compatibility )r2ZxmlParseQuotedStringr)rr*rrrparseQuotedString%s zparserCtxt.parseQuotedStringcCstj|jdS)aLparse and handle entity references in content, depending on the SAX interface, this may end-up in a call to character() if this is a CharRef, a predefined entity, if there is no reference() callback. or if the parser was asked to switch to that mode. [67] Reference ::= EntityRef | CharRef N)r2ZxmlParseReferencer)rrrrparseReference,szparserCtxt.parseReferencecCstj|j}|S)aparse the XML standalone declaration [32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no')'"')) [ VC: Standalone Document Declaration ] TODO The standalone document declaration must have the value "no" if any external markup declarations contain declarations of: - attributes with default values, if elements to which these attributes apply appear in the document without specifications of values for these attributes, or - entities (other than amp, lt, gt, apos, quot), if references to those entities appear in the document, or - attributes with values subject to normalization, where the attribute appears in the document with a value which will change as a result of normalization, or - element types with element content, if white space occurs directly within any instance of those types. )r2ZxmlParseSDDeclr)rr*rrr parseSDDecl4s zparserCtxt.parseSDDeclcCstj|j}|S)aparse a start of tag either for rule element or EmptyElement. In both case we don't parse the tag closing chars. [40] STag ::= '<' Name (S Attribute)* S? '>' [ WFC: Unique Att Spec ] No attribute name may appear more than once in the same start-tag or empty-element tag. [44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>' [ WFC: Unique Att Spec ] No attribute name may appear more than once in the same start-tag or empty-element tag. With namespace: [NS 8] STag ::= '<' QName (S Attribute)* S? '>' [NS 10] EmptyElement ::= '<' QName (S Attribute)* S? '/>' )r2ZxmlParseStartTagr)rr*rrr parseStartTagHs zparserCtxt.parseStartTagcCstj|j}|S)zZparse an XML Literal [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'") )r2ZxmlParseSystemLiteralr)rr*rrrparseSystemLiteralVs zparserCtxt.parseSystemLiteralcCstj|jdS)z~parse an XML declaration header for external entities [77] TextDecl ::= '' N)r2ZxmlParseTextDeclr)rrrr parseTextDecl\szparserCtxt.parseTextDeclcCstj|j}|S)zparse the XML version. [24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ") [25] Eq ::= S? '=' S? )r2ZxmlParseVersionInfor)rr*rrrparseVersionInfoas zparserCtxt.parseVersionInfocCstj|j}|S)zwparse the XML version value. [26] VersionNum ::= '1.' [0-9]+ In practice allow [0-9].[0-9]+ at that level )r2ZxmlParseVersionNumr)rr*rrrparseVersionNumgs zparserCtxt.parseVersionNumcCstj|jdS)zoparse an XML declaration header [23] XMLDecl ::= '' N)r2ZxmlParseXMLDeclr)rrrr parseXMLDeclmszparserCtxt.parseXMLDeclcCstj|jdS)aw[69] PEReference ::= '%' Name ';' [ WFC: No Recursion ] A parsed entity must not contain a recursive reference to itself, either directly or indirectly. [ WFC: Entity Declared ] In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, or a document with "standalone='yes'", ... ... The declaration of a parameter entity must precede any reference to it... [ VC: Entity Declared ] In a document with an external subset or external parameter entities with "standalone='no'", ... ... The declaration of a parameter entity must precede any reference to it... [ WFC: In DTD ] Parameter-entity references may only appear in the DTD. NOTE: misleading but this is handled. A PEReference may have been detected in the current input stream the handling is done accordingly to http://www.w3.org/TR/REC-xml#entproc i.e. - Included in literal in entity values - Included as Parameter Entity reference within DTDs N)r2ZxmlParserHandlePEReferencer)rrrrparserHandlePEReferencersz"parserCtxt.parserHandlePEReferencecCstj|jdS)a TODO: Remove, now deprecated ... the test is done directly in the content parsing routines. [67] Reference ::= EntityRef | CharRef [68] EntityRef ::= '&' Name ';' [ WFC: Entity Declared ] the Name given in the entity reference must match that in an entity declaration, except that well-formed documents need not declare any of the following entities: amp, lt, gt, apos, quot. [ WFC: Parsed Entity ] An entity reference must not contain the name of an unparsed entity [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';' A PEReference may have been detected in the current input stream the handling is done accordingly to http://www.w3.org/TR/REC-xml#entproc N)r2ZxmlParserHandleReferencer)rrrrparserHandleReferences z parserCtxt.parserHandleReferencecCstj|j}|S)zqxmlPopInput: the current input pointed by ctxt->input came to an end pop it and return the next char. )r2Z xmlPopInputr)rr*rrrpopInputs zparserCtxt.popInputcCstj|j}|S)aTrickery: parse an XML name but without consuming the input flow Needed for rollback cases. Used only when parsing entities references. TODO: seems deprecated now, only used in the default part of xmlParserHandleReference [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender [5] Name ::= (Letter | '_' | ':') (NameChar)* [6] Names ::= Name (S Name)* )r2Z xmlScanNamer)rr*rrrscanNames zparserCtxt.scanNamecCstj|j}|S)zskip all blanks character found at that point in the input streams. It pops up finished entities in the process if allowable at that point. )r2ZxmlSkipBlankCharsr)rr*rrrskipBlankCharss zparserCtxt.skipBlankCharscCstj|j|||||}|S)zTakes a entity string content and process to do the adequate substitutions. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';' )r2ZxmlStringDecodeEntitiesr)rr.rr rrr*rrrstringDecodeEntitiesszparserCtxt.stringDecodeEntitiescCstj|j||||||}|S)zTakes a entity string content and process to do the adequate substitutions. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';' )r2ZxmlStringLenDecodeEntitiesr)rr.r)rr rrr*rrrstringLenDecodeEntitiessz"parserCtxt.stringLenDecodeEntities)N)Vrrrrr5rsrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)s           rc@sfeZdZdddZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ dS)riNcCs,t|dkrtd||_tj||ddS)Nrz'xmlAttr got a wrong wrapper object type)r )rrurrr)rr rrrrs zxmlAttr.__init__cCsd|jtt|fS)Nz)rCrvr)rrrrrwszxmlAttr.__repr__cCstj||j|dS)z*Dumps debug information for the attribute N)r2ZxmlDebugDumpAttrr)rrr{rrr debugDumpAttrszxmlAttr.debugDumpAttrcCstj||j|dS)z/Dumps debug information for the attribute list N)r2ZxmlDebugDumpAttrListr)rrr{rrrdebugDumpAttrListszxmlAttr.debugDumpAttrListcCs@|dkrd}n|j}tj||j}|dkr2tdt|d}|S)zDo a copy of the attribute. NzxmlCopyProp() failed)r )rr2rrri)rrF target__or* _xmlAttr__tmprrrrs zxmlAttr.copyPropcCs@|dkrd}n|j}tj||j}|dkr2tdt|d}|S)z Do a copy of an attribute list. NzxmlCopyPropList() failed)r )rr2rrri)rrFrr*rrrrrs zxmlAttr.copyPropListcCstj|jdS)z1Free one attribute, all the content is freed too N)r2Z xmlFreePropr)rrrrfreePropszxmlAttr.freePropcCstj|jdS)zQFree a property and all its siblings, all the children are freed too. N)r2ZxmlFreePropListr)rrrr freePropListszxmlAttr.freePropListcCstj|j}|S)zUnlink and free one attribute, all the content is freed too Note this doesn't work for namespace definition attributes )r2Z xmlRemovePropr)rr*rrr removeProps zxmlAttr.removePropcCs&|dkrd}n|j}tj||j}|S)zORemove the given attribute from the ID table maintained internally. N)rr2rk)rrsrr*rrrrls zxmlAttr.removeIDcCs&|dkrd}n|j}tj||j}|S)zPRemove the given attribute from the Ref table maintained internally. N)rr2rm)rrsrr*rrrrns zxmlAttr.removeRef)N)rrrrrwrrrrrrrrlrnrrrrris    ric@seZdZdddZddZdS)rNcCs,t|dkrtd||_tj||ddS)Nrz,xmlAttribute got a wrong wrapper object type)r )rrurrr)rr rrrr s zxmlAttribute.__init__cCsd|jtt|fS)Nz")rCrvr)rrrrrwszxmlAttribute.__repr__)N)rrrrrwrrrrr s rc@sfeZdZdddZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ dS)r NcCs|dkr||_dSd|_dS)N)r)rr rrrrszcatalog.__init__cCs |jdkrtj|jd|_dS)N)rr2ZxmlFreeCatalog)rrrrr5s  zcatalog.__del__cCstj|j|||}|S)zYAdd an entry in the catalog, it may overwrite existing but different entries. )r2ZxmlACatalogAddr)rr rrr*rrradd!sz catalog.addcCstj|j}|S)zCheck is a catalog is empty )r2ZxmlCatalogIsEmptyr)rr*rrrcatalogIsEmpty's zcatalog.catalogIsEmptycCstj|j}|S)z1Convert all the SGML catalog entries as XML ones )r2ZxmlConvertSGMLCatalogr)rr*rrrconvertSGMLCatalog,s zcatalog.convertSGMLCatalogcCstj|j|dS)z*Dump the given catalog to the given file. N)r2ZxmlACatalogDumpr)rrrrrr>1sz catalog.dumpcCstj|j|}|S)z!Remove an entry from the catalog )r2ZxmlACatalogRemover)rrr*rrrremove5szcatalog.removecCstj|j||}|S)z:Do a complete resolution lookup of an External Identifier )r2ZxmlACatalogResolver)rrrr*rrrresolve:szcatalog.resolvecCstj|j|}|S)z_Try to lookup the catalog local reference associated to a public ID in that catalog )r2ZxmlACatalogResolvePublicr)rrr*rrr resolvePublic?szcatalog.resolvePubliccCstj|j|}|S)z3Try to lookup the catalog resource for a system ID )r2ZxmlACatalogResolveSystemr)rrr*rrr resolveSystemEszcatalog.resolveSystemcCstj|j|}|S)z*Do a complete resolution lookup of an URI )r2ZxmlACatalogResolveURIr)rrr*rrr resolveURIJszcatalog.resolveURI)N)rrrrr5rrrr>rrrrrrrrrr s  r c@sVeZdZdddZddZddZdd Zd d Zd d ZddZ ddZ ddZ dS)rNcCs,t|dkrtd||_tj||ddS)Nrz&xmlDtd got a wrong wrapper object type)r )rrurrr)rr rrrrPs zxmlDtd.__init__cCsd|jtt|fS)Nz)rCrvr)rrrrrwUszxmlDtd.__repr__cCstj||jdS)z$Dumps debug information for the DTD N)r2ZxmlDebugDumpDTDr)rrrrr debugDumpDTD\szxmlDtd.debugDumpDTDcCs*tj|j}|dkrtdt|d}|S)zDo a copy of the dtd. NzxmlCopyDtd() failed)r )r2Z xmlCopyDtdrrr)rr* _xmlDtd__tmprrrcopyDtdds   zxmlDtd.copyDtdcCstj|jdS)zFree a DTD structure. N)r2Z xmlFreeDtdr)rrrrfreeDtdkszxmlDtd.freeDtdcCs.tj|j||}|dkr tdt|d}|S)zQSearch the DTD for the description of this attribute on this element. NzxmlGetDtdAttrDesc() failed)r )r2ZxmlGetDtdAttrDescrrr)rrPrCr*rrrr dtdAttrDescss  zxmlDtd.dtdAttrDesccCs,tj|j|}|dkrtdt|d}|S)z3Search the DTD for the description of this element NzxmlGetDtdElementDesc() failed)r )r2ZxmlGetDtdElementDescrrr)rrCr*rrrrdtdElementDesc{s  zxmlDtd.dtdElementDesccCs0tj|j|||}|dkr"tdt|d}|S)z[Search the DTD for the description of this qualified attribute on this element. NzxmlGetDtdQAttrDesc() failed)r )r2ZxmlGetDtdQAttrDescrrr)rrPrCr~r*rrrr dtdQAttrDescs  zxmlDtd.dtdQAttrDesccCs.tj|j||}|dkr tdt|d}|S)z3Search the DTD for the description of this element NzxmlGetDtdQElementDesc() failed)r )r2ZxmlGetDtdQElementDescrrr)rrCr~r*rrrrdtdQElementDescs  zxmlDtd.dtdQElementDesc)N) rrrrrwrrrrrrrrrrrrOs rc@seZdZdddZddZdS)rNcCs,t|dkrtd||_tj||ddS)Nrz*xmlElement got a wrong wrapper object type)r )rrurrr)rr rrrrs zxmlElement.__init__cCsd|jtt|fS)Nz )rCrvr)rrrrrwszxmlElement.__repr__)N)rrrrrwrrrrrs rc@s&eZdZdddZddZddZdS) rNcCs,t|dkrtd||_tj||ddS)Nrz)xmlEntity got a wrong wrapper object type)r )rrurrr)rr rrrrs zxmlEntity.__init__cCsd|jtt|fS)Nz)rCrvr)rrrrrwszxmlEntity.__repr__cCs&|dkrd}n|j}tj||jdS)zDefault handling of defined entities, when should we define a new input stream ? When do we just handle that as a set of chars ? OBSOLETE: to be removed at some point. N)rr2r)rrrerrrrszxmlEntity.handleEntity)N)rrrrrwrrrrrrs rc@sVeZdZdddZddZddZdd Zd d Zd d ZddZ ddZ ddZ dS)rNcCs|dkr||_dSd|_dS)N)r)rr rrrrszError.__init__cCstj|j}|S)z'The error code, e.g. an xmlParserError )r2ZxmlErrorGetCoder)rr*rrrrs z Error.codecCstj|j}|S)z+What part of the library raised this error )r2ZxmlErrorGetDomainr)rr*rrrdomains z Error.domaincCstj|j}|S)z the filename )r2ZxmlErrorGetFiler)rr*rrrr8s z Error.filecCstj|j}|S)zhow consequent is the error )r2ZxmlErrorGetLevelr)rr*rrrrs z Error.levelcCstj|j}|S)zthe line number if available )r2ZxmlErrorGetLiner)rr*rrrlines z Error.linecCstj|j}|S)z)human-readable informative error message )r2ZxmlErrorGetMessager)rr*rrrmessages z Error.messagecCs&|dkrd}n|j}tj|j|}|S)z*Save the original error to the new place. N)rr2Z xmlCopyError)rZtoZto__or*rrr copyErrors zError.copyErrorcCstj|jdS)zCleanup the error. N)r2Z xmlResetErrorr)rrrr resetErrorszError.resetError)N) rrrrrrr8rrrrrrrrrrs  rc@seZdZd&ddZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZddZddZddZd d!Zd"d#Zd$d%ZdS)'rNcCs,t|dkrtd||_tj||ddS)Nrz%xmlNs got a wrong wrapper object type)r )rrurrr)rr rrrrs zxmlNs.__init__cCsd|jtt|fS)Nz)rCrvr)rrrrrwszxmlNs.__repr__cCs*tj|j}|dkrtdt|d}|S)zDo a copy of the namespace. NzxmlCopyNamespace() failed)r )r2ZxmlCopyNamespacerrr)rr* _xmlNs__tmprrr copyNamespaces   zxmlNs.copyNamespacecCs*tj|j}|dkrtdt|d}|S)z Do a copy of an namespace list. NzxmlCopyNamespaceList() failed)r )r2ZxmlCopyNamespaceListrrr)rr*r rrrcopyNamespaceLists   zxmlNs.copyNamespaceListcCstj|jdS)z1Free up the structures associated to a namespace N)r2Z xmlFreeNsr)rrrrfreeNssz xmlNs.freeNscCstj|jdS)zLFree up all the structures associated to the chained namespaces. N)r2Z xmlFreeNsListr)rrrr freeNsListszxmlNs.freeNsListcCsD|dkrd}n|j}tj||j||}|dkr6tdt|d}|S)aQCreation of a new child element, added at the end of @parent children list. @ns and @content parameters are optional (None). If @ns is None, the newly created element inherits the namespace of @parent. If @content is non None, a child list containing the TEXTs and ENTITY_REFs node will be created. NOTE: @content is supposed to be a piece of XML CDATA, so it allows entity references. XML special chars must be escaped first by using xmlEncodeEntitiesReentrant(), or xmlNewTextChild() should be used. NzxmlNewChild() failed)r )rr2rrr)rr_rCrH parent__or*r rrrrs  zxmlNs.newChildcCsD|dkrd}n|j}tj||j||}|dkr6tdt|d}|S)atCreation of a new node element within a document. @ns and @content are optional (None). NOTE: @content is supposed to be a piece of XML CDATA, so it allow entities references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you don't need entities support. NzxmlNewDocNode() failed)r )rr2rHrr)rrsrCrHrr*r rrrrIs zxmlNs.newDocNodecCsD|dkrd}n|j}tj||j||}|dkr6tdt|d}|S)atCreation of a new node element within a document. @ns and @content are optional (None). NOTE: @content is supposed to be a piece of XML CDATA, so it allow entities references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you don't need entities support. NzxmlNewDocNodeEatName() failed)r )rr2rJrr)rrsrCrHrr*r rrrrK&s zxmlNs.newDocNodeEatNamecCsD|dkrd}n|j}tj||j||}|dkr6tdt|d}|S)zcCreation of a new node element within a document. @ns and @content are optional (None). NzxmlNewDocRawNode() failed)r )rr2rNrr)rrsrCrHrr*r rrrrO4s zxmlNs.newDocRawNodecCs,tj|j|}|dkrtdt|d}|S)z8Creation of a new node element. @ns is optional (None). NzxmlNewNodeEatName() failed)r )r2ZxmlNewNodeEatNamerrr)rrCr*r rrrnewNodeEatName>s  zxmlNs.newNodeEatNamecCsD|dkrd}n|j}tj||j||}|dkr6tdt|d}|S)zPCreate a new property tagged with a namespace and carried by a node. NzxmlNewNsProp() failed)r )rr2rrri)rrrCrr;r*r rrrrEs zxmlNs.newNsPropcCsD|dkrd}n|j}tj||j||}|dkr6tdt|d}|S)zPCreate a new property tagged with a namespace and carried by a node. NzxmlNewNsPropEatName() failed)r )rr2rrri)rrrCrr;r*r rrrrOs zxmlNs.newNsPropEatNamecCsD|dkrd}n|j}tj||j||}|dkr6tdt|d}|S)aCreation of a new child element, added at the end of @parent children list. @ns and @content parameters are optional (None). If @ns is None, the newly created element inherits the namespace of @parent. If @content is non None, a child TEXT node will be created containing the string @content. NOTE: Use xmlNewChild() if @content will contain entities that need to be preserved. Use this function, xmlNewTextChild(), if you need to ensure that reserved XML chars that might appear in @content, such as the ampersand, greater-than or less-than signs, are automatically replaced by their XML escaped entity representations. NzxmlNewTextChild() failed)r )rr2rrr)rr_rCrHrr*r rrrrYs  zxmlNs.newTextChildcCs&|dkrd}n|j}tj||jdS)z/Associate a namespace to a node, a posteriori. N)rr2r)rrr;rrrrlsz xmlNs.setNscCsD|dkrd}n|j}tj||j||}|dkr6tdt|d}|S)zqSet (or reset) an attribute carried by a node. The ns structure must be in scope, this is not checked NzxmlSetNsProp() failed)r )rr2rrri)rrrCrr;r*r rrrrrs zxmlNs.setNsPropcCs(|dkrd}n|j}tj||j|}|S)z'Remove an attribute carried by a node. N)rr2r)rrrCr;r*rrrr|s zxmlNs.unsetNsPropcCstj|jdS)zNamespace nodes in libxml don't match the XPath semantic. In a node set the namespace nodes are duplicated and the next pointer is set to the parent node in the XPath semantic. Check if such a node needs to be freed N)r2ZxmlXPathNodeSetFreeNsr)rrrrxpathNodeSetFreeNsszxmlNs.xpathNodeSetFreeNs)N)rrrrrwr r r r rrIrKrOrrrrrrrrrrrrrs$      rc@sfeZdZdddZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ dS)rmNcCs||_tj||ddS)N)r )rr7r)rr rrrrszoutputBuffer.__init__cCs*|dkrd}n|j}tj|j|||dS)zDump an HTML document. N)rr2r)rrrzr{rrrrrsz+outputBuffer.htmlDocContentDumpFormatOutputcCs(|dkrd}n|j}tj|j||dS)z:Dump an HTML document. Formating return/spaces are added. N)rr2r)rrrzrrrrrsz%outputBuffer.htmlDocContentDumpOutputcCs@|dkrd}n|j}|dkr"d}n|j}tj|j||||dS)zLDump an HTML node, recursive behaviour,children are printed too. N)rr2r)rrsrrzr{rrrrrrsz%outputBuffer.htmlNodeDumpFormatOutputcCs>|dkrd}n|j}|dkr"d}n|j}tj|j|||dS)zuDump an HTML node, recursive behaviour,children are printed too, and formatting returns/spaces are added. N)rr2r)rrsrrzrrrrrrszoutputBuffer.htmlNodeDumpOutputcCsB|dkrd}n|j}|dkr"d}n|j}tj|j|||||dS)zDump an XML node, recursive behaviour, children are printed too. Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was called N)rr2rU)rrsrrr{rzrrrrrrVszoutputBuffer.nodeDumpOutputcCs(|dkrd}n|j}tj|j||}|S)zDump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is not available after this call. N)rr2r_)rrrzrr*rrrr`s zoutputBuffer.saveFileTocCs*|dkrd}n|j}tj|j|||}|S)zDump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is not available after this call. N)rr2rc)rrrzr{rr*rrrrds zoutputBuffer.saveFormatFileTocCstj|j}|S)zKGives a pointer to the data currently held in the output buffer )r2ZxmlOutputBufferGetContentr)rr*rrrrs zoutputBuffer.getContentcCstj|j||}|S)zWrite the content of the array in the output I/O buffer This routine handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e. will store in case of partial or delayed writes. )r2ZxmlOutputBufferWriter)rr)rr*rrrr-szoutputBuffer.writecCstj|j|}|S)zWrite the content of the string in the output I/O buffer This routine handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e. will store in case of partial or delayed writes. )r2ZxmlOutputBufferWriteStringr)rr.r*rrr writeStringszoutputBuffer.writeString)N)rrrrrrrrrVr`rdrr-rrrrrrms      rmc@sFeZdZdddZddZddZdd Zd d Zd d ZddZ dS)rkNcCs||_tj||ddS)N)r )rr0r)rr rrrrszinputBuffer.__init__cCs |jdkrtj|jd|_dS)N)rr2r6)rrrrr5s  zinputBuffer.__del__cCstj|j|}|S)aYGrow up the content of the input buffer, the old data are preserved This routine handle the I18N transcoding to internal UTF-8 This routine is used when operating the parser in normal (pull) mode TODO: one should be able to remove one extra copy by copying directly onto in->buffer or in->raw )r2ZxmlParserInputBufferGrowr)rr)r*rrrgrowszinputBuffer.growcCstj|j||}|S)zPush the content of the arry in the input buffer This routine handle the I18N transcoding to internal UTF-8 This is used when operating the parser in progressive (push) mode. )r2ZxmlParserInputBufferPushr)rr)rr*rrrpushszinputBuffer.pushcCstj|j|}|S)zRefresh the content of the input buffer, the old data are considered consumed This routine handle the I18N transcoding to internal UTF-8 )r2ZxmlParserInputBufferReadr)rr)r*rrrr%szinputBuffer.readcCs,|dkrd}n|j}tj||j|||}|S)z%Setup an XML reader with new options N)rr2xmlTextReaderSetup)rrrrzrrr*rrrSetups zinputBuffer.SetupcCs2tj|j|}|dkrtdt|d}||_|S)z2Create an xmlTextReader structure fed with @input NzxmlNewTextReader() failed)r )r2ZxmlNewTextReaderrrrr)rrr*Z_inputBuffer__tmprrr newTextReader"s  zinputBuffer.newTextReader)N) rrrrr5rrr%rrrrrrrks    rkc@s6eZdZd ddZddZddZdd Zd d ZdS) rNcCs|dkr||_dSd|_dS)N)r)rr rrrr+szxmlReg.__init__cCs |jdkrtj|jd|_dS)N)rr2ZxmlRegFreeRegexp)rrrrr5/s  zxmlReg.__del__cCstj|j|}|S)z4Check if the regular expression generates the value )r2Z xmlRegexpExecr)rrHr*rrr regexpExec8szxmlReg.regexpExeccCstj|j}|S)z/Check if the regular expression is determinist )r2ZxmlRegexpIsDeterministr)rr*rrrregexpIsDeterminist=s zxmlReg.regexpIsDeterministcCstj||jdS)z5Print the content of the compiled regular expression N)r2ZxmlRegexpPrintr)rrrrr regexpPrintBszxmlReg.regexpPrint)N)rrrrr5rrrrrrrr*s   rc@s.eZdZd ddZddZddZdd ZdS) r{NcCs|dkr||_dSd|_dS)N)r)rr rrrrGszrelaxNgParserCtxt.__init__cCs |jdkrtj|jd|_dS)N)rr2ZxmlRelaxNGFreeParserCtxt)rrrrr5Ks  zrelaxNgParserCtxt.__del__cCs*tj|j}|dkrtdt|d}|S)zparse a schema definition resource and build an internal XML Shema struture which can be used to validate instances. NzxmlRelaxNGParse() failed)r )r2ZxmlRelaxNGParserr relaxNgSchema)rr*Z_relaxNgParserCtxt__tmprrr relaxNGParseTs   zrelaxNgParserCtxt.relaxNGParsecCstj|j|}|S)zSemi private function used to pass informations to a parser context which are a combination of xmlRelaxNGParserFlag . )r2ZxmlRelaxParserSetFlagr)rrr*rrrrelaxParserSetFlag\sz$relaxNgParserCtxt.relaxParserSetFlag)N)rrrrr5rrrrrrr{Fs  r{c@s>eZdZdddZddZddZdd Zd d Zd d ZdS)rNcCs|dkr||_dSd|_dS)N)r)rr rrrrcszrelaxNgSchema.__init__cCs |jdkrtj|jd|_dS)N)rr2ZxmlRelaxNGFree)rrrrr5gs  zrelaxNgSchema.__del__cCstj||jdS)zDump a RelaxNG structure back N)r2ZxmlRelaxNGDumpr)rrrrr relaxNGDumppszrelaxNgSchema.relaxNGDumpcCstj||jdS)z#Dump the transformed RelaxNG tree. N)r2ZxmlRelaxNGDumpTreer)rrrrrrelaxNGDumpTreetszrelaxNgSchema.relaxNGDumpTreecCs0tj|j}|dkrtdt|d}||_|S)zOCreate an XML RelaxNGs validation context based on the given schema NzxmlRelaxNGNewValidCtxt() failed)r )r2ZxmlRelaxNGNewValidCtxtrrrelaxNgValidCtxtschema)rr*Z_relaxNgSchema__tmprrrrelaxNGNewValidCtxtxs   z!relaxNgSchema.relaxNGNewValidCtxtcCs&|dkrd}n|j}tj||j}|S)a7Use RelaxNG to validate the document as it is processed. Activation is only possible before the first Read(). if @schema is None, then RelaxNG validation is desactivated. @ The @schema should not be freed until the reader is deallocated or its use has been deactivated. N)rr2xmlTextReaderRelaxNGSetSchema)rrrr*rrrRelaxNGSetSchemas zrelaxNgSchema.RelaxNGSetSchema)N) rrrrr5rrr!r#rrrrrbs    rc@sNeZdZdddZddZddZdd Zd d Zd d ZddZ ddZ dS)rNcCsd|_||_tj||ddS)N)r )r rrr)rr rrrrszrelaxNgValidCtxt.__init__cCs |jdkrtj|jd|_dS)N)rr2ZxmlRelaxNGFreeValidCtxt)rrrrr5s  zrelaxNgValidCtxt.__del__cCs&|dkrd}n|j}tj|j|}|S)z$Validate a document tree in memory. N)rr2r1)rrsrr*rrrr2s z#relaxNgValidCtxt.relaxNGValidateDoccCs<|dkrd}n|j}|dkr"d}n|j}tj|j||}|S)zValidate a full subtree when xmlRelaxNGValidatePushElement() returned 0 and the content of the node has been expanded. N)rr2r3)rrsrPrrr*rrrr4sz+relaxNgValidCtxt.relaxNGValidateFullElementcCs<|dkrd}n|j}|dkr"d}n|j}tj|j||}|S)z7Pop the element end from the RelaxNG validation stack. N)rr2r5)rrsrPrrr*rrrr6sz*relaxNgValidCtxt.relaxNGValidatePopElementcCstj|j||}|S)z;check the CData parsed for validation in the current stack )r2ZxmlRelaxNGValidatePushCDatar)rr@r)r*rrrrelaxNGValidatePushCDatasz)relaxNgValidCtxt.relaxNGValidatePushCDatacCs<|dkrd}n|j}|dkr"d}n|j}tj|j||}|S)z:Push a new element start on the RelaxNG validation stack. N)rr2r7)rrsrPrrr*rrrr8sz+relaxNgValidCtxt.relaxNGValidatePushElementcCs(|dkrd}n|j}tj||j|}|S)zUse RelaxNG schema context to validate the document as it is processed. Activation is only possible before the first Read(). If @ctxt is None, then RelaxNG schema validation is deactivated. N)rr2 xmlTextReaderRelaxNGValidateCtxt)rrrrr*rrrRelaxNGValidateCtxts z$relaxNgValidCtxt.RelaxNGValidateCtxt)N) rrrrr5r2r4r6r$r8r&rrrrrs     rc@s&eZdZdddZddZddZdS) rNcCs|dkr||_dSd|_dS)N)r)rr rrrrszSchemaParserCtxt.__init__cCs |jdkrtj|jd|_dS)N)rr2ZxmlSchemaFreeParserCtxt)rrrrr5s  zSchemaParserCtxt.__del__cCs*tj|j}|dkrtdt|d}|S)zparse a schema definition resource and build an internal XML Shema struture which can be used to validate instances. NzxmlSchemaParse() failed)r )r2ZxmlSchemaParserrSchema)rr*Z_SchemaParserCtxt__tmprrr schemaParses   zSchemaParserCtxt.schemaParse)N)rrrrr5r(rrrrrs  rc@s6eZdZd ddZddZddZdd Zd d ZdS) r'NcCs|dkr||_dSd|_dS)N)r)rr rrrrszSchema.__init__cCs |jdkrtj|jd|_dS)N)rr2Z xmlSchemaFree)rrrrr5s  zSchema.__del__cCs&|dkrd}n|j}tj||j}|S)a9Use XSD Schema to validate the document as it is processed. Activation is only possible before the first Read(). if @schema is None, then Schema validation is desactivated. @ The @schema should not be freed until the reader is deallocated or its use has been deactivated. N)rr2xmlTextReaderSetSchema)rrrr*rrr SetSchemas zSchema.SetSchemacCstj||jdS)zDump a Schema structure. N)r2Z xmlSchemaDumpr)rrrrr schemaDump szSchema.schemaDumpcCs0tj|j}|dkrtdt|d}||_|S)zOCreate an XML Schemas validation context based on the given schema. NzxmlSchemaNewValidCtxt() failed)r )r2ZxmlSchemaNewValidCtxtrrSchemaValidCtxtr )rr*Z _Schema__tmprrrschemaNewValidCtxt s   zSchema.schemaNewValidCtxt)N)rrrrr5r*r+r-rrrrr's   r'c@sfeZdZdddZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ dS)r,NcCsd|_||_tj||ddS)N)r )r rrr)rr rrrrszSchemaValidCtxt.__init__cCs |jdkrtj|jd|_dS)N)rr2ZxmlSchemaFreeValidCtxt)rrrrr5s  zSchemaValidCtxt.__del__cCs(|dkrd}n|j}tj||j|}|S)zUse W3C XSD schema context to validate the document as it is processed. Activation is only possible before the first Read(). If @ctxt is None, then XML Schema validation is deactivated. N)rr2xmlTextReaderSchemaValidateCtxt)rrrrr*rrrSchemaValidateCtxt%s z"SchemaValidCtxt.SchemaValidateCtxtcCstj|j}|S)z3Check if any error was detected during validation. )r2ZxmlSchemaIsValidr)rr*rrr schemaIsValid3s zSchemaValidCtxt.schemaIsValidcCstj|j|}|S)z3Sets the options to be used during the validation. )r2ZxmlSchemaSetValidOptionsr)rrr*rrrschemaSetValidOptions8sz%SchemaValidCtxt.schemaSetValidOptionscCstj|j}|S)z$Get the validation context options. )r2ZxmlSchemaValidCtxtGetOptionsr)rr*rrrschemaValidCtxtGetOptions=s z)SchemaValidCtxt.schemaValidCtxtGetOptionscCs*tj|j}|dkrtdt|d}|S)zOallow access to the parser context of the schema validation context Nz(xmlSchemaValidCtxtGetParserCtxt() failed)r )r2ZxmlSchemaValidCtxtGetParserCtxtrrr)rr*Z_SchemaValidCtxt__tmprrrschemaValidCtxtGetParserCtxtBs   z,SchemaValidCtxt.schemaValidCtxtGetParserCtxtcCs&|dkrd}n|j}tj|j|}|S)z$Validate a document tree in memory. N)rr2r)rrsrr*rrrrJs z!SchemaValidCtxt.schemaValidateDoccCstj|j||}|S)zpDo a schemas validation of the given resource, it will use the SAX streamable validation internally. )r2ZxmlSchemaValidateFiler)rrrr*rrrschemaValidateFileQsz"SchemaValidCtxt.schemaValidateFilecCs&|dkrd}n|j}tj|j|}|S)zd?Z!d@dAZ"dBdCZ#dDdEZ$dFdGZ%dHdIZ&dJdKZ'dLdMZ(dNdOZ)dPdQZ*dRdSZ+dTdUZ,dVdWZ-dXdYZ.dZd[Z/d\d]Z0d^d_Z1d`daZ2dbdcZ3dddeZ4dfdgZ5dhdiZ6djdkZ7dldmZ8dndoZ9dpdqZ:drdsZ;dtduZdzd{Z?d|d}Z@d~dZAddZBddZCdS)rNcCsd|_||_tj||ddS)N)r )rrrr)rr rrrrwszxmlTextReader.__init__cCs |jdkrtj|jd|_dS)N)rr2r)rrrrr5|s  zxmlTextReader.__del__cCstj|j}|S)z6Provides the number of attributes of the current node )r2ZxmlTextReaderAttributeCountr)rr*rrrAttributeCounts zxmlTextReader.AttributeCountcCstj|j}|S)zThe base URI of the node. )r2ZxmlTextReaderConstBaseUrir)rr*rrrBaseUris zxmlTextReader.BaseUricCstj|j}|S)a@This function provides the current index of the parser used by the reader, relative to the start of the current entity. This function actually just wraps a call to xmlBytesConsumed() for the parser context associated with the reader. See xmlBytesConsumed() for more information. )r2ZxmlTextReaderByteConsumedr)rr*rrr ByteConsumeds zxmlTextReader.ByteConsumedcCstj|j}|S)zThis method releases any resources allocated by the current instance changes the state to Closed and close any underlying input. )r2ZxmlTextReaderCloser)rr*rrrCloses zxmlTextReader.ClosecCs*tj|j}|dkrtdt|d}|S)a\Hacking interface allowing to get the xmlDocPtr correponding to the current document being accessed by the xmlTextReader. NOTE: as a result of this call, the reader will not destroy the associated XML document and calling xmlFreeDoc() on the result is needed once the reader parsing has finished. Nz xmlTextReaderCurrentDoc() failed)r )r2ZxmlTextReaderCurrentDocrrrt)rr*_xmlTextReader__tmprrr CurrentDocs   zxmlTextReader.CurrentDoccCs*tj|j}|dkrtdt|d}|S)zHacking interface allowing to get the xmlNodePtr correponding to the current node being accessed by the xmlTextReader. This is dangerous because the underlying node may be destroyed on the next Reads. Nz!xmlTextReaderCurrentNode() failed)r )r2ZxmlTextReaderCurrentNoderrr)rr*r<rrr CurrentNodes   zxmlTextReader.CurrentNodecCstj|j}|S)z#The depth of the node in the tree. )r2ZxmlTextReaderDepthr)rr*rrrDepths zxmlTextReader.DepthcCstj|j}|S)z3Determine the encoding of the document being read. )r2ZxmlTextReaderConstEncodingr)rr*rrrEncodings zxmlTextReader.EncodingcCs*tj|j}|dkrtdt|d}|S)zReads the contents of the current node and the full subtree. It then makes the subtree available until the next xmlTextReaderRead() call NzxmlTextReaderExpand() failed)r )r2ZxmlTextReaderExpandrrr)rr*r<rrrExpands   zxmlTextReader.ExpandcCstj|j|}|S)zRProvides the value of the attribute with the specified qualified name. )r2ZxmlTextReaderGetAttributer)rrCr*rrr GetAttributeszxmlTextReader.GetAttributecCstj|j|}|S)zlProvides the value of the attribute with the specified index relative to the containing element. )r2ZxmlTextReaderGetAttributeNor)rnor*rrrGetAttributeNoszxmlTextReader.GetAttributeNocCstj|j||}|S)z.Provides the value of the specified attribute )r2ZxmlTextReaderGetAttributeNsr)r localName namespaceURIr*rrrGetAttributeNsszxmlTextReader.GetAttributeNscCstj|j}|S)z8Provide the column number of the current parsing point. )r2Z"xmlTextReaderGetParserColumnNumberr)rr*rrrGetParserColumnNumbers z#xmlTextReader.GetParserColumnNumbercCstj|j}|S)z6Provide the line number of the current parsing point. )r2Z xmlTextReaderGetParserLineNumberr)rr*rrrGetParserLineNumbers z!xmlTextReader.GetParserLineNumbercCstj|j|}|S)z#Read the parser internal property. )r2ZxmlTextReaderGetParserPropr)rrr*rrr GetParserPropszxmlTextReader.GetParserPropcCs*tj|j}|dkrtdt|d}|S)aMethod to get the remainder of the buffered XML. this method stops the parser, set its state to End Of File and return the input stream with what is left that the parser did not use. The implementation is not good, the parser certainly procgressed past what's left in reader->input, and there is an allocation problem. Best would be to rewrite it differently. Nz"xmlTextReaderGetRemainder() failed)r )r2ZxmlTextReaderGetRemainderrrrk)rr*r<rrr GetRemainders   zxmlTextReader.GetRemaindercCstj|j}|S)z!Whether the node has attributes. )r2ZxmlTextReaderHasAttributesr)rr*rrr HasAttributess zxmlTextReader.HasAttributescCstj|j}|S)z(Whether the node can have a text value. )r2ZxmlTextReaderHasValuer)rr*rrrHasValues zxmlTextReader.HasValuecCstj|j}|S)ziWhether an Attribute node was generated from the default value defined in the DTD or schema. )r2ZxmlTextReaderIsDefaultr)rr*rrr IsDefaults zxmlTextReader.IsDefaultcCstj|j}|S)z#Check if the current node is empty )r2ZxmlTextReaderIsEmptyElementr)rr*rrrIsEmptyElements zxmlTextReader.IsEmptyElementcCstj|j}|S)zjDetermine whether the current node is a namespace declaration rather than a regular attribute. )r2ZxmlTextReaderIsNamespaceDeclr)rr*rrrIsNamespaceDecl s zxmlTextReader.IsNamespaceDeclcCstj|j}|S)z5Retrieve the validity status from the parser context )r2ZxmlTextReaderIsValidr)rr*rrrIsValids zxmlTextReader.IsValidcCstj|j}|S)zThe local name of the node. )r2ZxmlTextReaderConstLocalNamer)rr*rrr LocalNames zxmlTextReader.LocalNamecCstj|j|}|S)zLResolves a namespace prefix in the scope of the current element. )r2ZxmlTextReaderLookupNamespacer)rr~r*rrrLookupNamespaceszxmlTextReader.LookupNamespacecCstj|j|}|S)zjMoves the position of the current instance to the attribute with the specified qualified name. )r2ZxmlTextReaderMoveToAttributer)rrCr*rrrMoveToAttribute szxmlTextReader.MoveToAttributecCstj|j|}|S)zMoves the position of the current instance to the attribute with the specified index relative to the containing element. )r2ZxmlTextReaderMoveToAttributeNor)rrCr*rrrMoveToAttributeNo&szxmlTextReader.MoveToAttributeNocCstj|j||}|S)zxMoves the position of the current instance to the attribute with the specified local name and namespace URI. )r2ZxmlTextReaderMoveToAttributeNsr)rrErFr*rrrMoveToAttributeNs,szxmlTextReader.MoveToAttributeNscCstj|j}|S)zmMoves the position of the current instance to the node that contains the current Attribute node. )r2ZxmlTextReaderMoveToElementr)rr*rrr MoveToElement2s zxmlTextReader.MoveToElementcCstj|j}|S)zoMoves the position of the current instance to the first attribute associated with the current node. )r2Z!xmlTextReaderMoveToFirstAttributer)rr*rrrMoveToFirstAttribute8s z"xmlTextReader.MoveToFirstAttributecCstj|j}|S)znMoves the position of the current instance to the next attribute associated with the current node. )r2Z xmlTextReaderMoveToNextAttributer)rr*rrrMoveToNextAttribute>s z!xmlTextReader.MoveToNextAttributecCstj|j}|S)zr?r@rArBrDrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_rr`rarbrcrdrerfrgrhrirjrkrlr#ror&rpr/rqr*rrrrsrtrurvrrrrrvs              rc@seZdZd4ddZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3ZdS)5rNcCs|dkr||_dSd|_dS)N)r)rr rrrr/sz URI.__init__cCs |jdkrtj|jd|_dS)N)rr2Z xmlFreeURI)rrrrr53s  z URI.__del__cCstj|j}|S)z#Get the authority part from an URI )r2ZxmlURIGetAuthorityr)rr*rrr authority9s z URI.authoritycCstj|j}|S)z"Get the fragment part from an URI )r2ZxmlURIGetFragmentr)rr*rrrfragment>s z URI.fragmentcCstj|j}|S)z Get the opaque part from an URI )r2ZxmlURIGetOpaquer)rr*rrropaqueCs z URI.opaquecCstj|j}|S)zGet the path part from an URI )r2Z xmlURIGetPathr)rr*rrrrHs zURI.pathcCstj|j}|S)zGet the port part from an URI )r2Z xmlURIGetPortr)rr*rrrr;Ms zURI.portcCstj|j}|S)zGet the query part from an URI )r2ZxmlURIGetQueryr)rr*rrrqueryRs z URI.querycCstj|j}|S)zIGet the raw query part from an URI (i.e. the unescaped form). )r2ZxmlURIGetQueryRawr)rr*rrrqueryRawWs z URI.queryRawcCstj|j}|S)z Get the scheme part from an URI )r2ZxmlURIGetSchemer)rr*rrrscheme]s z URI.schemecCstj|j}|S)z Get the server part from an URI )r2ZxmlURIGetServerr)rr*rrrserverbs z URI.servercCstj|j|dS)z"Set the authority part of an URI. N)r2ZxmlURISetAuthorityr)rrwrrr setAuthoritygszURI.setAuthoritycCstj|j|dS)z!Set the fragment part of an URI. N)r2ZxmlURISetFragmentr)rrxrrr setFragmentkszURI.setFragmentcCstj|j|dS)zSet the opaque part of an URI. N)r2ZxmlURISetOpaquer)rryrrr setOpaqueosz URI.setOpaquecCstj|j|dS)zSet the path part of an URI. N)r2Z xmlURISetPathr)rrrrrsetPathssz URI.setPathcCstj|j|dS)zSet the port part of an URI. N)r2Z xmlURISetPortr)rr;rrrsetPortwsz URI.setPortcCstj|j|dS)zSet the query part of an URI. N)r2ZxmlURISetQueryr)rrzrrrsetQuery{sz URI.setQuerycCstj|j|dS)zvalid accordingly N)rr2ro)rrsrPrCrrrr*rrrrps z*ValidCtxt.validCtxtNormalizeAttributeValuecCs&|dkrd}n|j}tj|j|}|S)zTry to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree. N)rr2rq)rrsrr*rrrrrs zValidCtxt.validateDocumentcCs&|dkrd}n|j}tj|j|}|S)aDoes the final step for the document validation once all the incremental validation steps have been completed basically it does the following checks described by the XML Rec Check all the IDREF/IDREFS attributes definition for validity N)rr2rs)rrsrr*rrrrts zValidCtxt.validateDocumentFinalcCs<|dkrd}n|j}|dkr"d}n|j}tj|j||}|S)aTry to validate the document against the dtd instance Basically it does check all the definitions in the DtD. Note the the internal subset (if present) is de-coupled (i.e. not used), which could give problems if ID or IDREF is present. N)rr2ru)rrsrrrvr*rrrrwszValidCtxt.validateDtdcCs&|dkrd}n|j}tj|j|}|S)aDoes the final step for the dtds validation once all the subsets have been parsed basically it does the following checks described by the XML Rec - check that ENTITY and ENTITIES type attributes default or possible values matches one of the defined entities. - check that NOTATION type attributes default or possible values matches one of the defined notations. N)rr2rx)rrsrr*rrrrys zValidCtxt.validateDtdFinalcCs<|dkrd}n|j}|dkr"d}n|j}tj|j||}|S)z-Try to validate the subtree under an element N)rr2rz)rrsrPrrr*rrrr{szValidCtxt.validateElementcCs(|dkrd}n|j}tj|j||}|S)zbValidate that the given name match a notation declaration. - [ VC: Notation Declared ] N)rr2r|)rrsrSrr*rrrr}s zValidCtxt.validateNotationUsec CsT|dkrd}n|j}|dkr"d}n|j}|dkr6d}n|j}tj|j||||}|S)aTry to validate a single attribute for an element basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Value Type ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity Name ] - [ VC: Notation Attributes ] The ID/IDREF uniqueness and matching are done separately N)rr2r~) rrsrPrxrrrrr*rrrrszValidCtxt.validateOneAttributecCs<|dkrd}n|j}|dkr"d}n|j}tj|j||}|S)a]Try to validate a single element and it's attributes, basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC: Required Attribute ] Then call xmlValidateOneAttribute() for each attribute present. The ID/IDREF checkings are done separately N)rr2r)rrsrPrrr*rrrrszValidCtxt.validateOneElementc CsV|dkrd}n|j}|dkr"d}n|j}|dkr6d}n|j}tj|j|||||} | S)aTry to validate a single namespace declaration for an element basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Value Type ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity Name ] - [ VC: Notation Attributes ] The ID/IDREF uniqueness and matching are done separately N)rr2r) rrsrPr~ryrrrrr*rrrr%szValidCtxt.validateOneNamespacecCs>|dkrd}n|j}|dkr"d}n|j}tj|j|||}|S)z/Pop the element end from the validation stack. N)rr2r)rrsrPrrrr*rrrr6szValidCtxt.validatePopElementcCstj|j||}|S)z;check the CData parsed for validation in the current stack )r2ZxmlValidatePushCDatar)rr@r)r*rrrvalidatePushCData?szValidCtxt.validatePushCDatacCs>|dkrd}n|j}|dkr"d}n|j}tj|j|||}|S)z2Push a new element start on the validation stack. N)rr2r)rrsrPrrrr*rrrrDszValidCtxt.validatePushElementcCs&|dkrd}n|j}tj|j|}|S)zTry to validate a the root element basically it does the following check as described by the XML-1.0 recommendation: - [ VC: Root Element Type ] it doesn't try to recurse or apply other check to the element N)rr2r)rrsrr*rrrrMs zValidCtxt.validateRoot)N)rrrrr5rprrrtrwryr{r}rrrrrrrrrrrrs          rc@seZdZd4ddZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3ZdS)5r NcCs|dkr||_dSd|_dS)N)r)rr rrrrXszxpathContext.__init__cCs*tj|j}|dkrtdt|d}|S)z!Get the doc from an xpathContext NzxmlXPathGetContextDoc() failed)r )r2ZxmlXPathGetContextDocrrrt)rr*_xpathContext__tmprrr contextDoc]s   zxpathContext.contextDoccCs*tj|j}|dkrtdt|d}|S)z*Get the current node from an xpathContext NzxmlXPathGetContextNode() failed)r )r2ZxmlXPathGetContextNoderrr)rr*rrrr contextNodeds   zxpathContext.contextNodecCstj|j}|S)z*Get the current node from an xpathContext )r2ZxmlXPathGetContextPositionr)rr*rrrcontextPositionks zxpathContext.contextPositioncCstj|j}|S)z*Get the current node from an xpathContext )r2ZxmlXPathGetContextSizer)rr*rrr contextSizeps zxpathContext.contextSizecCstj|j}|S)z+Get the current function name xpathContext )r2ZxmlXPathGetFunctionr)rr*rrrfunctionus zxpathContext.functioncCstj|j}|S)z/Get the current function name URI xpathContext )r2ZxmlXPathGetFunctionURIr)rr*rrr functionURIzs zxpathContext.functionURIcCs&|dkrd}n|j}tj|j|dS)zSet the doc of an xpathContext N)rr2ZxmlXPathSetContextDoc)rrsrrrr setContextDocszxpathContext.setContextDoccCs&|dkrd}n|j}tj|j|dS)z(Set the current node of an xpathContext N)rr2ZxmlXPathSetContextNode)rrr;rrrrszxpathContext.setContextNodecCstj|j|||}|S)zd?Z!d@dAZ"dBdCZ#dDdEZ$dFdGZ%dHdIZ&dJdKZ'dLdMZ(dNdOZ)dPdQZ*dRdSZ+dTdUZ,dVdWZ-dXdYZ.dZd[Z/d\d]Z0d^d_Z1d`daZ2dbdcZ3dddeZ4dfdgZ5dhdiZ6djdkZ7dldmZ8dndoZ9dpdqZ:drdsZ;dtduZdzd{Z?d|d}Z@dS)rNcCs|dkr||_dSd|_dS)N)r)rr rrrrszxpathParserContext.__init__cCs*tj|j}|dkrtdt|d}|S)z0Get the xpathContext from an xpathParserContext Nz!xmlXPathParserGetContext() failed)r )r2ZxmlXPathParserGetContextrrr )rr*_xpathParserContext__tmprrrcontexts   zxpathParserContext.contextcCstj|jdS)zImplement the add operation on XPath objects: The numeric operators convert their operands to numbers as if by calling the number function. N)r2ZxmlXPathAddValuesr)rrrrxpathAddValues sz!xpathParserContext.xpathAddValuescCstj|j|dS)auImplement the boolean() XPath function boolean boolean(object) The boolean function converts its argument to a boolean as follows: - a number is true if and only if it is neither positive or negative zero nor NaN - a node-set is true if and only if it is non-empty - a string is true if and only if its length is non-zero N)r2ZxmlXPathBooleanFunctionr)rnargsrrrxpathBooleanFunctionsz'xpathParserContext.xpathBooleanFunctioncCstj|j|dS)zImplement the ceiling() XPath function number ceiling(number) The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer. N)r2ZxmlXPathCeilingFunctionr)rrrrrxpathCeilingFunctionsz'xpathParserContext.xpathCeilingFunctioncCstj|j||}|S)aImplement the compare operation on XPath objects: @arg1 < @arg2 (1, 1, ... @arg1 <= @arg2 (1, 0, ... @arg1 > @arg2 (0, 1, ... @arg1 >= @arg2 (0, 0, ... When neither object to be compared is a node-set and the operator is <=, <, >=, >, then the objects are compared by converted both objects to numbers and comparing the numbers according to IEEE 754. The < comparison will be true if and only if the first number is less than the second number. The <= comparison will be true if and only if the first number is less than or equal to the second number. The > comparison will be true if and only if the first number is greater than the second number. The >= comparison will be true if and only if the first number is greater than or equal to the second number. )r2ZxmlXPathCompareValuesr)rinfstrictr*rrrxpathCompareValues"sz%xpathParserContext.xpathCompareValuescCstj|j|dS)zImplement the concat() XPath function string concat(string, string, string*) The concat function returns the concatenation of its arguments. N)r2ZxmlXPathConcatFunctionr)rrrrrxpathConcatFunction4sz&xpathParserContext.xpathConcatFunctioncCstj|j|dS)zImplement the contains() XPath function boolean contains(string, string) The contains function returns true if the first argument string contains the second argument string, and otherwise returns false. N)r2ZxmlXPathContainsFunctionr)rrrrrxpathContainsFunction:sz(xpathParserContext.xpathContainsFunctioncCstj|j|dS)z?ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnoiiiiiiiiiiiiiiiiiiiiii i i i i iiiiiiiiiiiiiiiii i!iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i i i i iiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[i\i]i^i_i`iaibiiiiiiiiiiiiiiiiiiiiiiiiiiixiyizi{iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i i i i iiiiiiii@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRirisitiuiviiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i i i i iiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiliminioiiiiiiiiiiiiii i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i iii$i%iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiipiqirisitiXiii ii ii@iiiiii@r r (r2typesrr&rrrrrrrrr0r7r:rXrrr`rrZPARSER_LOADDTDZPARSER_DEFAULTATTRSZPARSER_VALIDATEZPARSER_SUBST_ENTITIESZ PARSER_SEVERITY_VALIDITY_WARNINGZPARSER_SEVERITY_VALIDITY_ERRORZPARSER_SEVERITY_WARNINGZPARSER_SEVERITY_ERRORrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r rrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r,r-r.r/r0r1r2r3r4r5r6r7r8r9r=r>r?r@rArBrCrDrErFrHrIrJrKrLrMrNrOrPrQrRrSrTrUrWrXrYr\r]r^r_r`rarcrdrfrgrhrjrlrnrprqrrrsrtrurvrwrxryrzr|r}rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrrtrrirr rrrrrrmrkrr{rrrr'r,rrrrr rZXLINK_SHOW_NONEZXLINK_SHOW_NEWZXLINK_SHOW_EMBEDZXLINK_SHOW_REPLACEZXML_RELAXNGP_NONEZXML_RELAXNGP_FREE_DOCZXML_RELAXNGP_CRNGZXML_BUFFER_ALLOC_DOUBLEITZXML_BUFFER_ALLOC_EXACTZXML_BUFFER_ALLOC_IMMUTABLEZXML_BUFFER_ALLOC_IOZXML_BUFFER_ALLOC_HYBRIDZXML_BUFFER_ALLOC_BOUNDEDZ$XML_PARSER_SEVERITY_VALIDITY_WARNINGZ"XML_PARSER_SEVERITY_VALIDITY_ERRORZXML_PARSER_SEVERITY_WARNINGZXML_PARSER_SEVERITY_ERRORZXML_ATTRIBUTE_NONEZXML_ATTRIBUTE_REQUIREDZXML_ATTRIBUTE_IMPLIEDZXML_ATTRIBUTE_FIXEDZXML_SCHEMAS_UNKNOWNZXML_SCHEMAS_STRINGZXML_SCHEMAS_NORMSTRINGZXML_SCHEMAS_DECIMALZXML_SCHEMAS_TIMEZXML_SCHEMAS_GDAYZXML_SCHEMAS_GMONTHZXML_SCHEMAS_GMONTHDAYZXML_SCHEMAS_GYEARZXML_SCHEMAS_GYEARMONTHZXML_SCHEMAS_DATEZXML_SCHEMAS_DATETIMEZXML_SCHEMAS_DURATIONZXML_SCHEMAS_FLOATZXML_SCHEMAS_DOUBLEZXML_SCHEMAS_BOOLEANZXML_SCHEMAS_TOKENZXML_SCHEMAS_LANGUAGEZXML_SCHEMAS_NMTOKENZXML_SCHEMAS_NMTOKENSZXML_SCHEMAS_NAMEZXML_SCHEMAS_QNAMEZXML_SCHEMAS_NCNAMEZXML_SCHEMAS_IDZXML_SCHEMAS_IDREFZXML_SCHEMAS_IDREFSZXML_SCHEMAS_ENTITYZXML_SCHEMAS_ENTITIESZXML_SCHEMAS_NOTATIONZXML_SCHEMAS_ANYURIZXML_SCHEMAS_INTEGERZXML_SCHEMAS_NPINTEGERZXML_SCHEMAS_NINTEGERZXML_SCHEMAS_NNINTEGERZXML_SCHEMAS_PINTEGERZXML_SCHEMAS_INTZXML_SCHEMAS_UINTZXML_SCHEMAS_LONGZXML_SCHEMAS_ULONGZXML_SCHEMAS_SHORTZXML_SCHEMAS_USHORTZXML_SCHEMAS_BYTEZXML_SCHEMAS_UBYTEZXML_SCHEMAS_HEXBINARYZXML_SCHEMAS_BASE64BINARYZXML_SCHEMAS_ANYTYPEZXML_SCHEMAS_ANYSIMPLETYPEZXML_PARSER_EOFZXML_PARSER_STARTZXML_PARSER_MISCZ XML_PARSER_PIZXML_PARSER_DTDZXML_PARSER_PROLOGZXML_PARSER_COMMENTZXML_PARSER_START_TAGZXML_PARSER_CONTENTZXML_PARSER_CDATA_SECTIONZXML_PARSER_END_TAGZXML_PARSER_ENTITY_DECLZXML_PARSER_ENTITY_VALUEZXML_PARSER_ATTRIBUTE_VALUEZXML_PARSER_SYSTEM_LITERALZXML_PARSER_EPILOGZXML_PARSER_IGNOREZXML_PARSER_PUBLIC_LITERALZXML_INTERNAL_GENERAL_ENTITYZ"XML_EXTERNAL_GENERAL_PARSED_ENTITYZ$XML_EXTERNAL_GENERAL_UNPARSED_ENTITYZXML_INTERNAL_PARAMETER_ENTITYZXML_EXTERNAL_PARAMETER_ENTITYZXML_INTERNAL_PREDEFINED_ENTITYZXML_SAVE_FORMATZXML_SAVE_NO_DECLZXML_SAVE_NO_EMPTYZXML_SAVE_NO_XHTMLZXML_SAVE_XHTMLZXML_SAVE_AS_XMLZXML_SAVE_AS_HTMLZXML_SAVE_WSNONSIGZXML_PATTERN_DEFAULTZXML_PATTERN_XPATHZXML_PATTERN_XSSELZXML_PATTERN_XSFIELDZ XML_ERR_OKZXML_ERR_INTERNAL_ERRORZXML_ERR_NO_MEMORYZXML_ERR_DOCUMENT_STARTZXML_ERR_DOCUMENT_EMPTYZXML_ERR_DOCUMENT_ENDZXML_ERR_INVALID_HEX_CHARREFZXML_ERR_INVALID_DEC_CHARREFZXML_ERR_INVALID_CHARREFZXML_ERR_INVALID_CHARZXML_ERR_CHARREF_AT_EOFZXML_ERR_CHARREF_IN_PROLOGZXML_ERR_CHARREF_IN_EPILOGZXML_ERR_CHARREF_IN_DTDZXML_ERR_ENTITYREF_AT_EOFZXML_ERR_ENTITYREF_IN_PROLOGZXML_ERR_ENTITYREF_IN_EPILOGZXML_ERR_ENTITYREF_IN_DTDZXML_ERR_PEREF_AT_EOFZXML_ERR_PEREF_IN_PROLOGZXML_ERR_PEREF_IN_EPILOGZXML_ERR_PEREF_IN_INT_SUBSETZXML_ERR_ENTITYREF_NO_NAMEZ!XML_ERR_ENTITYREF_SEMICOL_MISSINGZXML_ERR_PEREF_NO_NAMEZXML_ERR_PEREF_SEMICOL_MISSINGZXML_ERR_UNDECLARED_ENTITYZXML_WAR_UNDECLARED_ENTITYZXML_ERR_UNPARSED_ENTITYZXML_ERR_ENTITY_IS_EXTERNALZXML_ERR_ENTITY_IS_PARAMETERZXML_ERR_UNKNOWN_ENCODINGZXML_ERR_UNSUPPORTED_ENCODINGZXML_ERR_STRING_NOT_STARTEDZXML_ERR_STRING_NOT_CLOSEDZXML_ERR_NS_DECL_ERRORZXML_ERR_ENTITY_NOT_STARTEDZXML_ERR_ENTITY_NOT_FINISHEDZXML_ERR_LT_IN_ATTRIBUTEZXML_ERR_ATTRIBUTE_NOT_STARTEDZXML_ERR_ATTRIBUTE_NOT_FINISHEDZXML_ERR_ATTRIBUTE_WITHOUT_VALUEZXML_ERR_ATTRIBUTE_REDEFINEDZXML_ERR_LITERAL_NOT_STARTEDZXML_ERR_LITERAL_NOT_FINISHEDZXML_ERR_COMMENT_NOT_FINISHEDZXML_ERR_PI_NOT_STARTEDZXML_ERR_PI_NOT_FINISHEDZXML_ERR_NOTATION_NOT_STARTEDZXML_ERR_NOTATION_NOT_FINISHEDZXML_ERR_ATTLIST_NOT_STARTEDZXML_ERR_ATTLIST_NOT_FINISHEDZXML_ERR_MIXED_NOT_STARTEDZXML_ERR_MIXED_NOT_FINISHEDZXML_ERR_ELEMCONTENT_NOT_STARTEDZ XML_ERR_ELEMCONTENT_NOT_FINISHEDZXML_ERR_XMLDECL_NOT_STARTEDZXML_ERR_XMLDECL_NOT_FINISHEDZXML_ERR_CONDSEC_NOT_STARTEDZXML_ERR_CONDSEC_NOT_FINISHEDZXML_ERR_EXT_SUBSET_NOT_FINISHEDZXML_ERR_DOCTYPE_NOT_FINISHEDZXML_ERR_MISPLACED_CDATA_ENDZXML_ERR_CDATA_NOT_FINISHEDZXML_ERR_RESERVED_XML_NAMEZXML_ERR_SPACE_REQUIREDZXML_ERR_SEPARATOR_REQUIREDZXML_ERR_NMTOKEN_REQUIREDZXML_ERR_NAME_REQUIREDZXML_ERR_PCDATA_REQUIREDZXML_ERR_URI_REQUIREDZXML_ERR_PUBID_REQUIREDZXML_ERR_LT_REQUIREDZXML_ERR_GT_REQUIREDZXML_ERR_LTSLASH_REQUIREDZXML_ERR_EQUAL_REQUIREDZXML_ERR_TAG_NAME_MISMATCHZXML_ERR_TAG_NOT_FINISHEDZXML_ERR_STANDALONE_VALUEZXML_ERR_ENCODING_NAMEZXML_ERR_HYPHEN_IN_COMMENTZXML_ERR_INVALID_ENCODINGZXML_ERR_EXT_ENTITY_STANDALONEZXML_ERR_CONDSEC_INVALIDZXML_ERR_VALUE_REQUIREDZXML_ERR_NOT_WELL_BALANCEDZXML_ERR_EXTRA_CONTENTZXML_ERR_ENTITY_CHAR_ERRORZXML_ERR_ENTITY_PE_INTERNALZXML_ERR_ENTITY_LOOPZXML_ERR_ENTITY_BOUNDARYZXML_ERR_INVALID_URIZXML_ERR_URI_FRAGMENTZXML_WAR_CATALOG_PIZXML_ERR_NO_DTDZXML_ERR_CONDSEC_INVALID_KEYWORDZXML_ERR_VERSION_MISSINGZXML_WAR_UNKNOWN_VERSIONZXML_WAR_LANG_VALUEZXML_WAR_NS_URIZXML_WAR_NS_URI_RELATIVEZXML_ERR_MISSING_ENCODINGZXML_WAR_SPACE_VALUEZXML_ERR_NOT_STANDALONEZXML_ERR_ENTITY_PROCESSINGZXML_ERR_NOTATION_PROCESSINGZXML_WAR_NS_COLUMNZXML_WAR_ENTITY_REDEFINEDZXML_ERR_UNKNOWN_VERSIONZXML_ERR_VERSION_MISMATCHZXML_ERR_NAME_TOO_LONGZXML_ERR_USER_STOPZXML_NS_ERR_XML_NAMESPACEZXML_NS_ERR_UNDEFINED_NAMESPACEZXML_NS_ERR_QNAMEZXML_NS_ERR_ATTRIBUTE_REDEFINEDZXML_NS_ERR_EMPTYZXML_NS_ERR_COLONZXML_DTD_ATTRIBUTE_DEFAULTZXML_DTD_ATTRIBUTE_REDEFINEDZXML_DTD_ATTRIBUTE_VALUEZXML_DTD_CONTENT_ERRORZXML_DTD_CONTENT_MODELZXML_DTD_CONTENT_NOT_DETERMINISTZXML_DTD_DIFFERENT_PREFIXZXML_DTD_ELEM_DEFAULT_NAMESPACEZXML_DTD_ELEM_NAMESPACEZXML_DTD_ELEM_REDEFINEDZXML_DTD_EMPTY_NOTATIONZXML_DTD_ENTITY_TYPEZXML_DTD_ID_FIXEDZXML_DTD_ID_REDEFINEDZXML_DTD_ID_SUBSETZXML_DTD_INVALID_CHILDZXML_DTD_INVALID_DEFAULTZXML_DTD_LOAD_ERRORZXML_DTD_MISSING_ATTRIBUTEZXML_DTD_MIXED_CORRUPTZXML_DTD_MULTIPLE_IDZXML_DTD_NO_DOCZXML_DTD_NO_DTDZXML_DTD_NO_ELEM_NAMEZXML_DTD_NO_PREFIXZXML_DTD_NO_ROOTZXML_DTD_NOTATION_REDEFINEDZXML_DTD_NOTATION_VALUEZXML_DTD_NOT_EMPTYZXML_DTD_NOT_PCDATAZXML_DTD_NOT_STANDALONEZXML_DTD_ROOT_NAMEZXML_DTD_STANDALONE_WHITE_SPACEZXML_DTD_UNKNOWN_ATTRIBUTEZXML_DTD_UNKNOWN_ELEMZXML_DTD_UNKNOWN_ENTITYZXML_DTD_UNKNOWN_IDZXML_DTD_UNKNOWN_NOTATIONZXML_DTD_STANDALONE_DEFAULTEDZXML_DTD_XMLID_VALUEZXML_DTD_XMLID_TYPEZXML_DTD_DUP_TOKENZXML_HTML_STRUCURE_ERRORZXML_HTML_UNKNOWN_TAGZXML_RNGP_ANYNAME_ATTR_ANCESTORZXML_RNGP_ATTR_CONFLICTZXML_RNGP_ATTRIBUTE_CHILDRENZXML_RNGP_ATTRIBUTE_CONTENTZXML_RNGP_ATTRIBUTE_EMPTYZXML_RNGP_ATTRIBUTE_NOOPZXML_RNGP_CHOICE_CONTENTZXML_RNGP_CHOICE_EMPTYZXML_RNGP_CREATE_FAILUREZXML_RNGP_DATA_CONTENTZ"XML_RNGP_DEF_CHOICE_AND_INTERLEAVEZXML_RNGP_DEFINE_CREATE_FAILEDZXML_RNGP_DEFINE_EMPTYZXML_RNGP_DEFINE_MISSINGZXML_RNGP_DEFINE_NAME_MISSINGZXML_RNGP_ELEM_CONTENT_EMPTYZXML_RNGP_ELEM_CONTENT_ERRORZXML_RNGP_ELEMENT_EMPTYZXML_RNGP_ELEMENT_CONTENTZXML_RNGP_ELEMENT_NAMEZXML_RNGP_ELEMENT_NO_CONTENTZXML_RNGP_ELEM_TEXT_CONFLICTZXML_RNGP_EMPTYZXML_RNGP_EMPTY_CONSTRUCTZXML_RNGP_EMPTY_CONTENTZXML_RNGP_EMPTY_NOT_EMPTYZXML_RNGP_ERROR_TYPE_LIBZXML_RNGP_EXCEPT_EMPTYZXML_RNGP_EXCEPT_MISSINGZXML_RNGP_EXCEPT_MULTIPLEZXML_RNGP_EXCEPT_NO_CONTENTZXML_RNGP_EXTERNALREF_EMTPYZXML_RNGP_EXTERNAL_REF_FAILUREZXML_RNGP_EXTERNALREF_RECURSEZXML_RNGP_FORBIDDEN_ATTRIBUTEZXML_RNGP_FOREIGN_ELEMENTZXML_RNGP_GRAMMAR_CONTENTZXML_RNGP_GRAMMAR_EMPTYZXML_RNGP_GRAMMAR_MISSINGZXML_RNGP_GRAMMAR_NO_STARTZXML_RNGP_GROUP_ATTR_CONFLICTZXML_RNGP_HREF_ERRORZXML_RNGP_INCLUDE_EMPTYZXML_RNGP_INCLUDE_FAILUREZXML_RNGP_INCLUDE_RECURSEZXML_RNGP_INTERLEAVE_ADDZ!XML_RNGP_INTERLEAVE_CREATE_FAILEDZXML_RNGP_INTERLEAVE_EMPTYZXML_RNGP_INTERLEAVE_NO_CONTENTZXML_RNGP_INVALID_DEFINE_NAMEZXML_RNGP_INVALID_URIZXML_RNGP_INVALID_VALUEZXML_RNGP_MISSING_HREFZXML_RNGP_NAME_MISSINGZXML_RNGP_NEED_COMBINEZXML_RNGP_NOTALLOWED_NOT_EMPTYZXML_RNGP_NSNAME_ATTR_ANCESTORZXML_RNGP_NSNAME_NO_NSZXML_RNGP_PARAM_FORBIDDENZXML_RNGP_PARAM_NAME_MISSINGZ XML_RNGP_PARENTREF_CREATE_FAILEDZXML_RNGP_PARENTREF_NAME_INVALIDZXML_RNGP_PARENTREF_NO_NAMEZXML_RNGP_PARENTREF_NO_PARENTZXML_RNGP_PARENTREF_NOT_EMPTYZXML_RNGP_PARSE_ERRORZ#XML_RNGP_PAT_ANYNAME_EXCEPT_ANYNAMEZXML_RNGP_PAT_ATTR_ATTRZXML_RNGP_PAT_ATTR_ELEMZXML_RNGP_PAT_DATA_EXCEPT_ATTRZXML_RNGP_PAT_DATA_EXCEPT_ELEMZXML_RNGP_PAT_DATA_EXCEPT_EMPTYZXML_RNGP_PAT_DATA_EXCEPT_GROUPZ#XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVEZXML_RNGP_PAT_DATA_EXCEPT_LISTZ XML_RNGP_PAT_DATA_EXCEPT_ONEMOREZXML_RNGP_PAT_DATA_EXCEPT_REFZXML_RNGP_PAT_DATA_EXCEPT_TEXTZXML_RNGP_PAT_LIST_ATTRZXML_RNGP_PAT_LIST_ELEMZXML_RNGP_PAT_LIST_INTERLEAVEZXML_RNGP_PAT_LIST_LISTZXML_RNGP_PAT_LIST_REFZXML_RNGP_PAT_LIST_TEXTZ"XML_RNGP_PAT_NSNAME_EXCEPT_ANYNAMEZ!XML_RNGP_PAT_NSNAME_EXCEPT_NSNAMEZXML_RNGP_PAT_ONEMORE_GROUP_ATTRZ$XML_RNGP_PAT_ONEMORE_INTERLEAVE_ATTRZXML_RNGP_PAT_START_ATTRZXML_RNGP_PAT_START_DATAZXML_RNGP_PAT_START_EMPTYZXML_RNGP_PAT_START_GROUPZXML_RNGP_PAT_START_INTERLEAVEZXML_RNGP_PAT_START_LISTZXML_RNGP_PAT_START_ONEMOREZXML_RNGP_PAT_START_TEXTZXML_RNGP_PAT_START_VALUEZXML_RNGP_PREFIX_UNDEFINEDZXML_RNGP_REF_CREATE_FAILEDZXML_RNGP_REF_CYCLEZXML_RNGP_REF_NAME_INVALIDZXML_RNGP_REF_NO_DEFZXML_RNGP_REF_NO_NAMEZXML_RNGP_REF_NOT_EMPTYZ$XML_RNGP_START_CHOICE_AND_INTERLEAVEZXML_RNGP_START_CONTENTZXML_RNGP_START_EMPTYZXML_RNGP_START_MISSINGZXML_RNGP_TEXT_EXPECTEDZXML_RNGP_TEXT_HAS_CHILDZXML_RNGP_TYPE_MISSINGZXML_RNGP_TYPE_NOT_FOUNDZXML_RNGP_TYPE_VALUEZXML_RNGP_UNKNOWN_ATTRIBUTEZXML_RNGP_UNKNOWN_COMBINEZXML_RNGP_UNKNOWN_CONSTRUCTZXML_RNGP_UNKNOWN_TYPE_LIBZXML_RNGP_URI_FRAGMENTZXML_RNGP_URI_NOT_ABSOLUTEZXML_RNGP_VALUE_EMPTYZXML_RNGP_VALUE_NO_CONTENTZXML_RNGP_XMLNS_NAMEZXML_RNGP_XML_NSZXML_XPATH_EXPRESSION_OKZXML_XPATH_NUMBER_ERRORZ"XML_XPATH_UNFINISHED_LITERAL_ERRORZXML_XPATH_START_LITERAL_ERRORZXML_XPATH_VARIABLE_REF_ERRORZXML_XPATH_UNDEF_VARIABLE_ERRORZ!XML_XPATH_INVALID_PREDICATE_ERRORZXML_XPATH_EXPR_ERRORZXML_XPATH_UNCLOSED_ERRORZXML_XPATH_UNKNOWN_FUNC_ERRORZXML_XPATH_INVALID_OPERANDZXML_XPATH_INVALID_TYPEZXML_XPATH_INVALID_ARITYZXML_XPATH_INVALID_CTXT_SIZEZXML_XPATH_INVALID_CTXT_POSITIONZXML_XPATH_MEMORY_ERRORZXML_XPTR_SYNTAX_ERRORZXML_XPTR_RESOURCE_ERRORZXML_XPTR_SUB_RESOURCE_ERRORZXML_XPATH_UNDEF_PREFIX_ERRORZXML_XPATH_ENCODING_ERRORZXML_XPATH_INVALID_CHAR_ERRORZXML_TREE_INVALID_HEXZXML_TREE_INVALID_DECZXML_TREE_UNTERMINATED_ENTITYZXML_TREE_NOT_UTF8ZXML_SAVE_NOT_UTF8ZXML_SAVE_CHAR_INVALIDZXML_SAVE_NO_DOCTYPEZXML_SAVE_UNKNOWN_ENCODINGZXML_REGEXP_COMPILE_ERRORZXML_IO_UNKNOWNZ XML_IO_EACCESZ XML_IO_EAGAINZ XML_IO_EBADFZXML_IO_EBADMSGZ XML_IO_EBUSYZXML_IO_ECANCELEDZ XML_IO_ECHILDZXML_IO_EDEADLKZ XML_IO_EDOMZ XML_IO_EEXISTZ XML_IO_EFAULTZ XML_IO_EFBIGZXML_IO_EINPROGRESSZ XML_IO_EINTRZ XML_IO_EINVALZ XML_IO_EIOZ XML_IO_EISDIRZ XML_IO_EMFILEZ XML_IO_EMLINKZXML_IO_EMSGSIZEZXML_IO_ENAMETOOLONGZ XML_IO_ENFILEZ XML_IO_ENODEVZ XML_IO_ENOENTZXML_IO_ENOEXECZ XML_IO_ENOLCKZ XML_IO_ENOMEMZ XML_IO_ENOSPCZ XML_IO_ENOSYSZXML_IO_ENOTDIRZXML_IO_ENOTEMPTYZXML_IO_ENOTSUPZ XML_IO_ENOTTYZ XML_IO_ENXIOZ XML_IO_EPERMZ XML_IO_EPIPEZ XML_IO_ERANGEZ XML_IO_EROFSZ XML_IO_ESPIPEZ XML_IO_ESRCHZXML_IO_ETIMEDOUTZ XML_IO_EXDEVZXML_IO_NETWORK_ATTEMPTZXML_IO_ENCODERZ XML_IO_FLUSHZ XML_IO_WRITEZXML_IO_NO_INPUTZXML_IO_BUFFER_FULLZXML_IO_LOAD_ERRORZXML_IO_ENOTSOCKZXML_IO_EISCONNZXML_IO_ECONNREFUSEDZXML_IO_ENETUNREACHZXML_IO_EADDRINUSEZXML_IO_EALREADYZXML_IO_EAFNOSUPPORTZXML_XINCLUDE_RECURSIONZXML_XINCLUDE_PARSE_VALUEZ XML_XINCLUDE_ENTITY_DEF_MISMATCHZXML_XINCLUDE_NO_HREFZXML_XINCLUDE_NO_FALLBACKZXML_XINCLUDE_HREF_URIZXML_XINCLUDE_TEXT_FRAGMENTZXML_XINCLUDE_TEXT_DOCUMENTZXML_XINCLUDE_INVALID_CHARZXML_XINCLUDE_BUILD_FAILEDZXML_XINCLUDE_UNKNOWN_ENCODINGZXML_XINCLUDE_MULTIPLE_ROOTZXML_XINCLUDE_XPTR_FAILEDZXML_XINCLUDE_XPTR_RESULTZXML_XINCLUDE_INCLUDE_IN_INCLUDEZ!XML_XINCLUDE_FALLBACKS_IN_INCLUDEZ$XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDEZXML_XINCLUDE_DEPRECATED_NSZXML_XINCLUDE_FRAGMENT_IDZXML_CATALOG_MISSING_ATTRZXML_CATALOG_ENTRY_BROKENZXML_CATALOG_PREFER_VALUEZXML_CATALOG_NOT_CATALOGZXML_CATALOG_RECURSIONZXML_SCHEMAP_PREFIX_UNDEFINEDZ!XML_SCHEMAP_ATTRFORMDEFAULT_VALUEZ XML_SCHEMAP_ATTRGRP_NONAME_NOREFZXML_SCHEMAP_ATTR_NONAME_NOREFZ$XML_SCHEMAP_COMPLEXTYPE_NONAME_NOREFZ!XML_SCHEMAP_ELEMFORMDEFAULT_VALUEZXML_SCHEMAP_ELEM_NONAME_NOREFZXML_SCHEMAP_EXTENSION_NO_BASEZXML_SCHEMAP_FACET_NO_VALUEZXML_SCHEMAP_FAILED_BUILD_IMPORTZXML_SCHEMAP_GROUP_NONAME_NOREFZ$XML_SCHEMAP_IMPORT_NAMESPACE_NOT_URIZ"XML_SCHEMAP_IMPORT_REDEFINE_NSNAMEZ!XML_SCHEMAP_IMPORT_SCHEMA_NOT_URIZXML_SCHEMAP_INVALID_BOOLEANZXML_SCHEMAP_INVALID_ENUMZXML_SCHEMAP_INVALID_FACETZXML_SCHEMAP_INVALID_FACET_VALUEZXML_SCHEMAP_INVALID_MAXOCCURSZXML_SCHEMAP_INVALID_MINOCCURSZ#XML_SCHEMAP_INVALID_REF_AND_SUBTYPEZXML_SCHEMAP_INVALID_WHITE_SPACEZXML_SCHEMAP_NOATTR_NOREFZXML_SCHEMAP_NOTATION_NO_NAMEZXML_SCHEMAP_NOTYPE_NOREFZXML_SCHEMAP_REF_AND_SUBTYPEZ$XML_SCHEMAP_RESTRICTION_NONAME_NOREFZXML_SCHEMAP_SIMPLETYPE_NONAMEZXML_SCHEMAP_TYPE_AND_SUBTYPEZXML_SCHEMAP_UNKNOWN_ALL_CHILDZ&XML_SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILDZXML_SCHEMAP_UNKNOWN_ATTR_CHILDZ!XML_SCHEMAP_UNKNOWN_ATTRGRP_CHILDZ#XML_SCHEMAP_UNKNOWN_ATTRIBUTE_GROUPZXML_SCHEMAP_UNKNOWN_BASE_TYPEZ XML_SCHEMAP_UNKNOWN_CHOICE_CHILDZ(XML_SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILDZ%XML_SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILDZXML_SCHEMAP_UNKNOWN_ELEM_CHILDZ#XML_SCHEMAP_UNKNOWN_EXTENSION_CHILDZXML_SCHEMAP_UNKNOWN_FACET_CHILDZXML_SCHEMAP_UNKNOWN_FACET_TYPEZXML_SCHEMAP_UNKNOWN_GROUP_CHILDZ XML_SCHEMAP_UNKNOWN_IMPORT_CHILDZXML_SCHEMAP_UNKNOWN_LIST_CHILDZ"XML_SCHEMAP_UNKNOWN_NOTATION_CHILDZ(XML_SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILDZXML_SCHEMAP_UNKNOWN_REFZ%XML_SCHEMAP_UNKNOWN_RESTRICTION_CHILDZ!XML_SCHEMAP_UNKNOWN_SCHEMAS_CHILDZ"XML_SCHEMAP_UNKNOWN_SEQUENCE_CHILDZ'XML_SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILDZ$XML_SCHEMAP_UNKNOWN_SIMPLETYPE_CHILDZXML_SCHEMAP_UNKNOWN_TYPEZXML_SCHEMAP_UNKNOWN_UNION_CHILDZXML_SCHEMAP_ELEM_DEFAULT_FIXEDZXML_SCHEMAP_REGEXP_INVALIDZXML_SCHEMAP_FAILED_LOADZXML_SCHEMAP_NOTHING_TO_PARSEZXML_SCHEMAP_NOROOTZXML_SCHEMAP_REDEFINED_GROUPZXML_SCHEMAP_REDEFINED_TYPEZXML_SCHEMAP_REDEFINED_ELEMENTZXML_SCHEMAP_REDEFINED_ATTRGROUPZXML_SCHEMAP_REDEFINED_ATTRZXML_SCHEMAP_REDEFINED_NOTATIONZXML_SCHEMAP_FAILED_PARSEZXML_SCHEMAP_UNKNOWN_PREFIXZXML_SCHEMAP_DEF_AND_PREFIXZ!XML_SCHEMAP_UNKNOWN_INCLUDE_CHILDZ"XML_SCHEMAP_INCLUDE_SCHEMA_NOT_URIZ!XML_SCHEMAP_INCLUDE_SCHEMA_NO_URIZXML_SCHEMAP_NOT_SCHEMAZXML_SCHEMAP_UNKNOWN_MEMBER_TYPEZXML_SCHEMAP_INVALID_ATTR_USEZXML_SCHEMAP_RECURSIVEZ(XML_SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPEZ$XML_SCHEMAP_INVALID_ATTR_COMBINATIONZ+XML_SCHEMAP_INVALID_ATTR_INLINE_COMBINATIONZ$XML_SCHEMAP_MISSING_SIMPLETYPE_CHILDZXML_SCHEMAP_INVALID_ATTR_NAMEZXML_SCHEMAP_REF_AND_CONTENTZXML_SCHEMAP_CT_PROPS_CORRECT_1ZXML_SCHEMAP_CT_PROPS_CORRECT_2ZXML_SCHEMAP_CT_PROPS_CORRECT_3ZXML_SCHEMAP_CT_PROPS_CORRECT_4ZXML_SCHEMAP_CT_PROPS_CORRECT_5Z'XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1Z+XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1Z+XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2Z)XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2Z'XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3Z&XML_SCHEMAP_WILDCARD_INVALID_NS_MEMBERZ(XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLEZ!XML_SCHEMAP_UNION_NOT_EXPRESSIBLEZXML_SCHEMAP_SRC_IMPORT_3_1ZXML_SCHEMAP_SRC_IMPORT_3_2Z)XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1Z)XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2Z)XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_3ZXML_SCHEMAP_COS_CT_EXTENDS_1_3ZXML_SCHEMAV_NOROOTZXML_SCHEMAV_UNDECLAREDELEMZXML_SCHEMAV_NOTTOPLEVELZXML_SCHEMAV_MISSINGZXML_SCHEMAV_WRONGELEMZXML_SCHEMAV_NOTYPEZXML_SCHEMAV_NOROLLBACKZXML_SCHEMAV_ISABSTRACTZXML_SCHEMAV_NOTEMPTYZXML_SCHEMAV_ELEMCONTZXML_SCHEMAV_HAVEDEFAULTZXML_SCHEMAV_NOTNILLABLEZXML_SCHEMAV_EXTRACONTENTZXML_SCHEMAV_INVALIDATTRZXML_SCHEMAV_INVALIDELEMZXML_SCHEMAV_NOTDETERMINISTZXML_SCHEMAV_CONSTRUCTZXML_SCHEMAV_INTERNALZXML_SCHEMAV_NOTSIMPLEZXML_SCHEMAV_ATTRUNKNOWNZXML_SCHEMAV_ATTRINVALIDZXML_SCHEMAV_VALUEZXML_SCHEMAV_FACETZ$XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1Z$XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2Z$XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3ZXML_SCHEMAV_CVC_TYPE_3_1_1ZXML_SCHEMAV_CVC_TYPE_3_1_2ZXML_SCHEMAV_CVC_FACET_VALIDZXML_SCHEMAV_CVC_LENGTH_VALIDZXML_SCHEMAV_CVC_MINLENGTH_VALIDZXML_SCHEMAV_CVC_MAXLENGTH_VALIDZ"XML_SCHEMAV_CVC_MININCLUSIVE_VALIDZ"XML_SCHEMAV_CVC_MAXINCLUSIVE_VALIDZ"XML_SCHEMAV_CVC_MINEXCLUSIVE_VALIDZ"XML_SCHEMAV_CVC_MAXEXCLUSIVE_VALIDZ!XML_SCHEMAV_CVC_TOTALDIGITS_VALIDZ$XML_SCHEMAV_CVC_FRACTIONDIGITS_VALIDZXML_SCHEMAV_CVC_PATTERN_VALIDZ!XML_SCHEMAV_CVC_ENUMERATION_VALIDZ XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1Z XML_SCHEMAV_CVC_COMPLEX_TYPE_2_2Z XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3Z XML_SCHEMAV_CVC_COMPLEX_TYPE_2_4ZXML_SCHEMAV_CVC_ELT_1ZXML_SCHEMAV_CVC_ELT_2ZXML_SCHEMAV_CVC_ELT_3_1ZXML_SCHEMAV_CVC_ELT_3_2_1ZXML_SCHEMAV_CVC_ELT_3_2_2ZXML_SCHEMAV_CVC_ELT_4_1ZXML_SCHEMAV_CVC_ELT_4_2ZXML_SCHEMAV_CVC_ELT_4_3ZXML_SCHEMAV_CVC_ELT_5_1_1ZXML_SCHEMAV_CVC_ELT_5_1_2ZXML_SCHEMAV_CVC_ELT_5_2_1ZXML_SCHEMAV_CVC_ELT_5_2_2_1ZXML_SCHEMAV_CVC_ELT_5_2_2_2_1ZXML_SCHEMAV_CVC_ELT_5_2_2_2_2ZXML_SCHEMAV_CVC_ELT_6ZXML_SCHEMAV_CVC_ELT_7ZXML_SCHEMAV_CVC_ATTRIBUTE_1ZXML_SCHEMAV_CVC_ATTRIBUTE_2ZXML_SCHEMAV_CVC_ATTRIBUTE_3ZXML_SCHEMAV_CVC_ATTRIBUTE_4Z XML_SCHEMAV_CVC_COMPLEX_TYPE_3_1Z"XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1Z"XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2ZXML_SCHEMAV_CVC_COMPLEX_TYPE_4Z XML_SCHEMAV_CVC_COMPLEX_TYPE_5_1Z XML_SCHEMAV_CVC_COMPLEX_TYPE_5_2ZXML_SCHEMAV_ELEMENT_CONTENTZ$XML_SCHEMAV_DOCUMENT_ELEMENT_MISSINGZXML_SCHEMAV_CVC_COMPLEX_TYPE_1ZXML_SCHEMAV_CVC_AUZXML_SCHEMAV_CVC_TYPE_1ZXML_SCHEMAV_CVC_TYPE_2ZXML_SCHEMAV_CVC_IDCZXML_SCHEMAV_CVC_WILDCARDZXML_SCHEMAV_MISCZXML_XPTR_UNKNOWN_SCHEMEZXML_XPTR_CHILDSEQ_STARTZXML_XPTR_EVAL_FAILEDZXML_XPTR_EXTRA_OBJECTSZXML_C14N_CREATE_CTXTZXML_C14N_REQUIRES_UTF8ZXML_C14N_CREATE_STACKZXML_C14N_INVALID_NODEZXML_C14N_UNKNOW_NODEZXML_C14N_RELATIVE_NAMESPACEZXML_FTP_PASV_ANSWERZXML_FTP_EPSV_ANSWERZ XML_FTP_ACCNTZXML_FTP_URL_SYNTAXZXML_HTTP_URL_SYNTAXZXML_HTTP_USE_IPZXML_HTTP_UNKNOWN_HOSTZXML_SCHEMAP_SRC_SIMPLE_TYPE_1ZXML_SCHEMAP_SRC_SIMPLE_TYPE_2ZXML_SCHEMAP_SRC_SIMPLE_TYPE_3ZXML_SCHEMAP_SRC_SIMPLE_TYPE_4ZXML_SCHEMAP_SRC_RESOLVEZ.XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPEZ+XML_SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPEZ0XML_SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPESZXML_SCHEMAP_ST_PROPS_CORRECT_1ZXML_SCHEMAP_ST_PROPS_CORRECT_2ZXML_SCHEMAP_ST_PROPS_CORRECT_3Z XML_SCHEMAP_COS_ST_RESTRICTS_1_1Z XML_SCHEMAP_COS_ST_RESTRICTS_1_2Z"XML_SCHEMAP_COS_ST_RESTRICTS_1_3_1Z"XML_SCHEMAP_COS_ST_RESTRICTS_1_3_2Z XML_SCHEMAP_COS_ST_RESTRICTS_2_1Z$XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_1Z$XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_2Z$XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_1Z$XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_2Z$XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_3Z$XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_4Z$XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_5Z XML_SCHEMAP_COS_ST_RESTRICTS_3_1Z"XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1Z$XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1_2Z$XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_2Z$XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_1Z$XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3Z$XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_4Z$XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_5Z!XML_SCHEMAP_COS_ST_DERIVED_OK_2_1Z!XML_SCHEMAP_COS_ST_DERIVED_OK_2_2Z XML_SCHEMAP_S4S_ELEM_NOT_ALLOWEDZXML_SCHEMAP_S4S_ELEM_MISSINGZ XML_SCHEMAP_S4S_ATTR_NOT_ALLOWEDZXML_SCHEMAP_S4S_ATTR_MISSINGZ"XML_SCHEMAP_S4S_ATTR_INVALID_VALUEZXML_SCHEMAP_SRC_ELEMENT_1ZXML_SCHEMAP_SRC_ELEMENT_2_1ZXML_SCHEMAP_SRC_ELEMENT_2_2ZXML_SCHEMAP_SRC_ELEMENT_3ZXML_SCHEMAP_P_PROPS_CORRECT_1ZXML_SCHEMAP_P_PROPS_CORRECT_2_1ZXML_SCHEMAP_P_PROPS_CORRECT_2_2ZXML_SCHEMAP_E_PROPS_CORRECT_2ZXML_SCHEMAP_E_PROPS_CORRECT_3ZXML_SCHEMAP_E_PROPS_CORRECT_4ZXML_SCHEMAP_E_PROPS_CORRECT_5ZXML_SCHEMAP_E_PROPS_CORRECT_6ZXML_SCHEMAP_SRC_INCLUDEZXML_SCHEMAP_SRC_ATTRIBUTE_1ZXML_SCHEMAP_SRC_ATTRIBUTE_2ZXML_SCHEMAP_SRC_ATTRIBUTE_3_1ZXML_SCHEMAP_SRC_ATTRIBUTE_3_2ZXML_SCHEMAP_SRC_ATTRIBUTE_4ZXML_SCHEMAP_NO_XMLNSZXML_SCHEMAP_NO_XSIZXML_SCHEMAP_COS_VALID_DEFAULT_1Z!XML_SCHEMAP_COS_VALID_DEFAULT_2_1Z#XML_SCHEMAP_COS_VALID_DEFAULT_2_2_1Z#XML_SCHEMAP_COS_VALID_DEFAULT_2_2_2ZXML_SCHEMAP_CVC_SIMPLE_TYPEZXML_SCHEMAP_COS_CT_EXTENDS_1_1ZXML_SCHEMAP_SRC_IMPORT_1_1ZXML_SCHEMAP_SRC_IMPORT_1_2ZXML_SCHEMAP_SRC_IMPORT_2ZXML_SCHEMAP_SRC_IMPORT_2_1ZXML_SCHEMAP_SRC_IMPORT_2_2ZXML_SCHEMAP_INTERNALZXML_SCHEMAP_NOT_DETERMINISTICZ!XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_1Z!XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_2Z!XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_3ZXML_SCHEMAP_MG_PROPS_CORRECT_1ZXML_SCHEMAP_MG_PROPS_CORRECT_2ZXML_SCHEMAP_SRC_CT_1Z+XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3ZXML_SCHEMAP_AU_PROPS_CORRECT_2ZXML_SCHEMAP_A_PROPS_CORRECT_2ZXML_SCHEMAP_C_PROPS_CORRECTZXML_SCHEMAP_SRC_REDEFINEZXML_SCHEMAP_SRC_IMPORTZXML_SCHEMAP_WARN_SKIP_SCHEMAZ!XML_SCHEMAP_WARN_UNLOCATED_SCHEMAZ!XML_SCHEMAP_WARN_ATTR_REDECL_PROHZ$XML_SCHEMAP_WARN_ATTR_POINTLESS_PROHZXML_SCHEMAP_AG_PROPS_CORRECTZXML_SCHEMAP_COS_CT_EXTENDS_1_2ZXML_SCHEMAP_AU_PROPS_CORRECTZXML_SCHEMAP_A_PROPS_CORRECT_3ZXML_SCHEMAP_COS_ALL_LIMITEDZXML_SCHEMATRONV_ASSERTZXML_SCHEMATRONV_REPORTZXML_MODULE_OPENZXML_MODULE_CLOSEZXML_CHECK_FOUND_ELEMENTZXML_CHECK_FOUND_ATTRIBUTEZXML_CHECK_FOUND_TEXTZXML_CHECK_FOUND_CDATAZXML_CHECK_FOUND_ENTITYREFZXML_CHECK_FOUND_ENTITYZXML_CHECK_FOUND_PIZXML_CHECK_FOUND_COMMENTZXML_CHECK_FOUND_DOCTYPEZXML_CHECK_FOUND_FRAGMENTZXML_CHECK_FOUND_NOTATIONZXML_CHECK_UNKNOWN_NODEZXML_CHECK_ENTITY_TYPEZXML_CHECK_NO_PARENTZXML_CHECK_NO_DOCZXML_CHECK_NO_NAMEZXML_CHECK_NO_ELEMZXML_CHECK_WRONG_DOCZXML_CHECK_NO_PREVZXML_CHECK_WRONG_PREVZXML_CHECK_NO_NEXTZXML_CHECK_WRONG_NEXTZXML_CHECK_NOT_DTDZXML_CHECK_NOT_ATTRZXML_CHECK_NOT_ATTR_DECLZXML_CHECK_NOT_ELEM_DECLZXML_CHECK_NOT_ENTITY_DECLZXML_CHECK_NOT_NS_DECLZXML_CHECK_NO_HREFZXML_CHECK_WRONG_PARENTZXML_CHECK_NS_SCOPEZXML_CHECK_NS_ANCESTORZXML_CHECK_NOT_UTF8ZXML_CHECK_NO_DICTZXML_CHECK_NOT_NCNAMEZXML_CHECK_OUTSIDE_DICTZXML_CHECK_WRONG_NAMEZXML_CHECK_NAME_NOT_NULLZXML_I18N_NO_NAMEZXML_I18N_NO_HANDLERZXML_I18N_EXCESS_HANDLERZXML_I18N_CONV_FAILEDZXML_I18N_NO_OUTPUTZXML_BUF_OVERFLOWZ XML_EXP_EMPTYZXML_EXP_FORBIDZ XML_EXP_ATOMZ XML_EXP_SEQZ XML_EXP_ORZ XML_EXP_COUNTZXML_ELEMENT_CONTENT_PCDATAZXML_ELEMENT_CONTENT_ELEMENTZXML_ELEMENT_CONTENT_SEQZXML_ELEMENT_CONTENT_ORZXML_PARSER_LOADDTDZXML_PARSER_DEFAULTATTRSZXML_PARSER_VALIDATEZXML_PARSER_SUBST_ENTITIESZXML_READER_TYPE_NONEZXML_READER_TYPE_ELEMENTZXML_READER_TYPE_ATTRIBUTEZXML_READER_TYPE_TEXTZXML_READER_TYPE_CDATAZ XML_READER_TYPE_ENTITY_REFERENCEZXML_READER_TYPE_ENTITYZ&XML_READER_TYPE_PROCESSING_INSTRUCTIONZXML_READER_TYPE_COMMENTZXML_READER_TYPE_DOCUMENTZXML_READER_TYPE_DOCUMENT_TYPEZ!XML_READER_TYPE_DOCUMENT_FRAGMENTZXML_READER_TYPE_NOTATIONZXML_READER_TYPE_WHITESPACEZ&XML_READER_TYPE_SIGNIFICANT_WHITESPACEZXML_READER_TYPE_END_ELEMENTZXML_READER_TYPE_END_ENTITYZXML_READER_TYPE_XML_DECLARATIONZXML_CATA_PREFER_NONEZXML_CATA_PREFER_PUBLICZXML_CATA_PREFER_SYSTEMZXML_ELEMENT_NODEZXML_ATTRIBUTE_NODEZ XML_TEXT_NODEZXML_CDATA_SECTION_NODEZXML_ENTITY_REF_NODEZXML_ENTITY_NODEZ XML_PI_NODEZXML_COMMENT_NODEZXML_DOCUMENT_NODEZXML_DOCUMENT_TYPE_NODEZXML_DOCUMENT_FRAG_NODEZXML_NOTATION_NODEZXML_HTML_DOCUMENT_NODEZ XML_DTD_NODEZXML_ELEMENT_DECLZXML_ATTRIBUTE_DECLZXML_ENTITY_DECLZXML_NAMESPACE_DECLZXML_XINCLUDE_STARTZXML_XINCLUDE_ENDZXML_DOCB_DOCUMENT_NODEZXLINK_ACTUATE_NONEZXLINK_ACTUATE_AUTOZXLINK_ACTUATE_ONREQUESTZXML_WITH_THREADZ XML_WITH_TREEZXML_WITH_OUTPUTZ XML_WITH_PUSHZXML_WITH_READERZXML_WITH_PATTERNZXML_WITH_WRITERZ XML_WITH_SAX1Z XML_WITH_FTPZ XML_WITH_HTTPZXML_WITH_VALIDZ XML_WITH_HTMLZXML_WITH_LEGACYZ XML_WITH_C14NZXML_WITH_CATALOGZXML_WITH_XPATHZ XML_WITH_XPTRZXML_WITH_XINCLUDEZXML_WITH_ICONVZXML_WITH_ISO8859XZXML_WITH_UNICODEZXML_WITH_REGEXPZXML_WITH_AUTOMATAZ XML_WITH_EXPRZXML_WITH_SCHEMASZXML_WITH_SCHEMATRONZXML_WITH_MODULESZXML_WITH_DEBUGZXML_WITH_DEBUG_MEMZXML_WITH_DEBUG_RUNZ XML_WITH_ZLIBZ XML_WITH_ICUZ XML_WITH_LZMAZ XML_WITH_NONEZXML_ELEMENT_CONTENT_ONCEZXML_ELEMENT_CONTENT_OPTZXML_ELEMENT_CONTENT_MULTZXML_ELEMENT_CONTENT_PLUSZXPATH_EXPRESSION_OKZXPATH_NUMBER_ERRORZXPATH_UNFINISHED_LITERAL_ERRORZXPATH_START_LITERAL_ERRORZXPATH_VARIABLE_REF_ERRORZXPATH_UNDEF_VARIABLE_ERRORZXPATH_INVALID_PREDICATE_ERRORZXPATH_EXPR_ERRORZXPATH_UNCLOSED_ERRORZXPATH_UNKNOWN_FUNC_ERRORZXPATH_INVALID_OPERANDZXPATH_INVALID_TYPEZXPATH_INVALID_ARITYZXPATH_INVALID_CTXT_SIZEZXPATH_INVALID_CTXT_POSITIONZXPATH_MEMORY_ERRORZXPTR_SYNTAX_ERRORZXPTR_RESOURCE_ERRORZXPTR_SUB_RESOURCE_ERRORZXPATH_UNDEF_PREFIX_ERRORZXPATH_ENCODING_ERRORZXPATH_INVALID_CHAR_ERRORZXPATH_INVALID_CTXTZXPATH_STACK_ERRORZXPATH_FORBID_VARIABLE_ERRORZXML_TEXTREADER_MODE_INITIALZXML_TEXTREADER_MODE_INTERACTIVEZXML_TEXTREADER_MODE_ERRORZXML_TEXTREADER_MODE_EOFZXML_TEXTREADER_MODE_CLOSEDZXML_TEXTREADER_MODE_READINGZ XML_ERR_NONEZXML_ERR_WARNINGZ XML_ERR_ERRORZ XML_ERR_FATALZXML_CHAR_ENCODING_ERRORZXML_CHAR_ENCODING_NONEZXML_CHAR_ENCODING_UTF8ZXML_CHAR_ENCODING_UTF16LEZXML_CHAR_ENCODING_UTF16BEZXML_CHAR_ENCODING_UCS4LEZXML_CHAR_ENCODING_UCS4BEZXML_CHAR_ENCODING_EBCDICZXML_CHAR_ENCODING_UCS4_2143ZXML_CHAR_ENCODING_UCS4_3412ZXML_CHAR_ENCODING_UCS2ZXML_CHAR_ENCODING_8859_1ZXML_CHAR_ENCODING_8859_2ZXML_CHAR_ENCODING_8859_3ZXML_CHAR_ENCODING_8859_4ZXML_CHAR_ENCODING_8859_5ZXML_CHAR_ENCODING_8859_6ZXML_CHAR_ENCODING_8859_7ZXML_CHAR_ENCODING_8859_8ZXML_CHAR_ENCODING_8859_9ZXML_CHAR_ENCODING_2022_JPZXML_CHAR_ENCODING_SHIFT_JISZXML_CHAR_ENCODING_EUC_JPZXML_CHAR_ENCODING_ASCIIZ XML_FROM_NONEZXML_FROM_PARSERZ XML_FROM_TREEZXML_FROM_NAMESPACEZ XML_FROM_DTDZ XML_FROM_HTMLZXML_FROM_MEMORYZXML_FROM_OUTPUTZ XML_FROM_IOZ XML_FROM_FTPZ XML_FROM_HTTPZXML_FROM_XINCLUDEZXML_FROM_XPATHZXML_FROM_XPOINTERZXML_FROM_REGEXPZXML_FROM_DATATYPEZXML_FROM_SCHEMASPZXML_FROM_SCHEMASVZXML_FROM_RELAXNGPZXML_FROM_RELAXNGVZXML_FROM_CATALOGZ XML_FROM_C14NZ XML_FROM_XSLTZXML_FROM_VALIDZXML_FROM_CHECKZXML_FROM_WRITERZXML_FROM_MODULEZ XML_FROM_I18NZXML_FROM_SCHEMATRONVZXML_FROM_BUFFERZ XML_FROM_URIZHTML_NAZ HTML_INVALIDZHTML_DEPRECATEDZ HTML_VALIDZ HTML_REQUIREDZXML_SCHEMA_VAL_VC_I_CREATEZXML_SCHEMA_WHITESPACE_UNKNOWNZXML_SCHEMA_WHITESPACE_PRESERVEZXML_SCHEMA_WHITESPACE_REPLACEZXML_SCHEMA_WHITESPACE_COLLAPSEZHTML_PARSE_RECOVERZHTML_PARSE_NODEFDTDZHTML_PARSE_NOERRORZHTML_PARSE_NOWARNINGZHTML_PARSE_PEDANTICZHTML_PARSE_NOBLANKSZHTML_PARSE_NONETZHTML_PARSE_NOIMPLIEDZHTML_PARSE_COMPACTZHTML_PARSE_IGNORE_ENCZXML_RELAXNG_OKZXML_RELAXNG_ERR_MEMORYZXML_RELAXNG_ERR_TYPEZXML_RELAXNG_ERR_TYPEVALZXML_RELAXNG_ERR_DUPIDZXML_RELAXNG_ERR_TYPECMPZXML_RELAXNG_ERR_NOSTATEZXML_RELAXNG_ERR_NODEFINEZXML_RELAXNG_ERR_LISTEXTRAZXML_RELAXNG_ERR_LISTEMPTYZXML_RELAXNG_ERR_INTERNODATAZXML_RELAXNG_ERR_INTERSEQZXML_RELAXNG_ERR_INTEREXTRAZXML_RELAXNG_ERR_ELEMNAMEZXML_RELAXNG_ERR_ATTRNAMEZXML_RELAXNG_ERR_ELEMNONSZXML_RELAXNG_ERR_ATTRNONSZXML_RELAXNG_ERR_ELEMWRONGNSZXML_RELAXNG_ERR_ATTRWRONGNSZXML_RELAXNG_ERR_ELEMEXTRANSZXML_RELAXNG_ERR_ATTREXTRANSZXML_RELAXNG_ERR_ELEMNOTEMPTYZXML_RELAXNG_ERR_NOELEMZXML_RELAXNG_ERR_NOTELEMZXML_RELAXNG_ERR_ATTRVALIDZXML_RELAXNG_ERR_CONTENTVALIDZXML_RELAXNG_ERR_EXTRACONTENTZXML_RELAXNG_ERR_INVALIDATTRZXML_RELAXNG_ERR_DATAELEMZXML_RELAXNG_ERR_VALELEMZXML_RELAXNG_ERR_LISTELEMZXML_RELAXNG_ERR_DATATYPEZXML_RELAXNG_ERR_VALUEZXML_RELAXNG_ERR_LISTZXML_RELAXNG_ERR_NOGRAMMARZXML_RELAXNG_ERR_EXTRADATAZXML_RELAXNG_ERR_LACKDATAZXML_RELAXNG_ERR_INTERNALZXML_RELAXNG_ERR_ELEMWRONGZXML_RELAXNG_ERR_TEXTWRONGZXML_CATA_ALLOW_NONEZXML_CATA_ALLOW_GLOBALZXML_CATA_ALLOW_DOCUMENTZXML_CATA_ALLOW_ALLZXML_ATTRIBUTE_CDATAZXML_ATTRIBUTE_IDZXML_ATTRIBUTE_IDREFZXML_ATTRIBUTE_IDREFSZXML_ATTRIBUTE_ENTITYZXML_ATTRIBUTE_ENTITIESZXML_ATTRIBUTE_NMTOKENZXML_ATTRIBUTE_NMTOKENSZXML_ATTRIBUTE_ENUMERATIONZXML_ATTRIBUTE_NOTATIONZXML_SCHEMATRON_OUT_QUIETZXML_SCHEMATRON_OUT_TEXTZXML_SCHEMATRON_OUT_XMLZXML_SCHEMATRON_OUT_ERRORZXML_SCHEMATRON_OUT_FILEZXML_SCHEMATRON_OUT_BUFFERZXML_SCHEMATRON_OUT_IOZXML_SCHEMA_CONTENT_UNKNOWNZXML_SCHEMA_CONTENT_EMPTYZXML_SCHEMA_CONTENT_ELEMENTSZXML_SCHEMA_CONTENT_MIXEDZXML_SCHEMA_CONTENT_SIMPLEZ$XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTSZXML_SCHEMA_CONTENT_BASICZXML_SCHEMA_CONTENT_ANYZXML_SCHEMA_TYPE_BASICZXML_SCHEMA_TYPE_ANYZXML_SCHEMA_TYPE_FACETZXML_SCHEMA_TYPE_SIMPLEZXML_SCHEMA_TYPE_COMPLEXZXML_SCHEMA_TYPE_SEQUENCEZXML_SCHEMA_TYPE_CHOICEZXML_SCHEMA_TYPE_ALLZXML_SCHEMA_TYPE_SIMPLE_CONTENTZXML_SCHEMA_TYPE_COMPLEX_CONTENTZXML_SCHEMA_TYPE_URZXML_SCHEMA_TYPE_RESTRICTIONZXML_SCHEMA_TYPE_EXTENSIONZXML_SCHEMA_TYPE_ELEMENTZXML_SCHEMA_TYPE_ATTRIBUTEZXML_SCHEMA_TYPE_ATTRIBUTEGROUPZXML_SCHEMA_TYPE_GROUPZXML_SCHEMA_TYPE_NOTATIONZXML_SCHEMA_TYPE_LISTZXML_SCHEMA_TYPE_UNIONZXML_SCHEMA_TYPE_ANY_ATTRIBUTEZXML_SCHEMA_TYPE_IDC_UNIQUEZXML_SCHEMA_TYPE_IDC_KEYZXML_SCHEMA_TYPE_IDC_KEYREFZXML_SCHEMA_TYPE_PARTICLEZXML_SCHEMA_TYPE_ATTRIBUTE_USEZXML_SCHEMA_FACET_MININCLUSIVEZXML_SCHEMA_FACET_MINEXCLUSIVEZXML_SCHEMA_FACET_MAXINCLUSIVEZXML_SCHEMA_FACET_MAXEXCLUSIVEZXML_SCHEMA_FACET_TOTALDIGITSZXML_SCHEMA_FACET_FRACTIONDIGITSZXML_SCHEMA_FACET_PATTERNZXML_SCHEMA_FACET_ENUMERATIONZXML_SCHEMA_FACET_WHITESPACEZXML_SCHEMA_FACET_LENGTHZXML_SCHEMA_FACET_MAXLENGTHZXML_SCHEMA_FACET_MINLENGTHZXML_SCHEMA_EXTRA_QNAMEREFZ XML_SCHEMA_EXTRA_ATTR_USE_PROHIBZXML_MODULE_LAZYZXML_MODULE_LOCALZXML_PARSE_UNKNOWNZ XML_PARSE_DOMZ XML_PARSE_SAXZXML_PARSE_PUSH_DOMZXML_PARSE_PUSH_SAXZXML_PARSE_READERZ XML_C14N_1_0ZXML_C14N_EXCLUSIVE_1_0Z XML_C14N_1_1ZXML_PARSE_RECOVERZXML_PARSE_NOENTZXML_PARSE_DTDLOADZXML_PARSE_DTDATTRZXML_PARSE_DTDVALIDZXML_PARSE_NOERRORZXML_PARSE_NOWARNINGZXML_PARSE_PEDANTICZXML_PARSE_NOBLANKSZXML_PARSE_SAX1ZXML_PARSE_XINCLUDEZXML_PARSE_NONETZXML_PARSE_NODICTZXML_PARSE_NSCLEANZXML_PARSE_NOCDATAZXML_PARSE_NOXINCNODEZXML_PARSE_COMPACTZXML_PARSE_OLD10ZXML_PARSE_NOBASEFIXZXML_PARSE_HUGEZXML_PARSE_OLDSAXZXML_PARSE_IGNORE_ENCZXML_PARSE_BIG_LINESZXML_ELEMENT_TYPE_UNDEFINEDZXML_ELEMENT_TYPE_EMPTYZXML_ELEMENT_TYPE_ANYZXML_ELEMENT_TYPE_MIXEDZXML_ELEMENT_TYPE_ELEMENTZXML_DOC_WELLFORMEDZXML_DOC_NSVALIDZ XML_DOC_OLD10ZXML_DOC_DTDVALIDZXML_DOC_XINCLUDEZXML_DOC_USERBUILTZXML_DOC_INTERNALZ XML_DOC_HTMLZXLINK_TYPE_NONEZXLINK_TYPE_SIMPLEZXLINK_TYPE_EXTENDEDZXLINK_TYPE_EXTENDED_SETZXPATH_UNDEFINEDZ XPATH_NODESETZ XPATH_BOOLEANZ XPATH_NUMBERZ XPATH_STRINGZ XPATH_POINTZ XPATH_RANGEZXPATH_LOCATIONSETZ XPATH_USERSZXPATH_XSLT_TREEZXML_SCHEMAS_ERR_OKZXML_SCHEMAS_ERR_NOROOTZXML_SCHEMAS_ERR_UNDECLAREDELEMZXML_SCHEMAS_ERR_NOTTOPLEVELZXML_SCHEMAS_ERR_MISSINGZXML_SCHEMAS_ERR_WRONGELEMZXML_SCHEMAS_ERR_NOTYPEZXML_SCHEMAS_ERR_NOROLLBACKZXML_SCHEMAS_ERR_ISABSTRACTZXML_SCHEMAS_ERR_NOTEMPTYZXML_SCHEMAS_ERR_ELEMCONTZXML_SCHEMAS_ERR_HAVEDEFAULTZXML_SCHEMAS_ERR_NOTNILLABLEZXML_SCHEMAS_ERR_EXTRACONTENTZXML_SCHEMAS_ERR_INVALIDATTRZXML_SCHEMAS_ERR_INVALIDELEMZXML_SCHEMAS_ERR_NOTDETERMINISTZXML_SCHEMAS_ERR_CONSTRUCTZXML_SCHEMAS_ERR_INTERNALZXML_SCHEMAS_ERR_NOTSIMPLEZXML_SCHEMAS_ERR_ATTRUNKNOWNZXML_SCHEMAS_ERR_ATTRINVALIDZXML_SCHEMAS_ERR_VALUEZXML_SCHEMAS_ERR_FACETZXML_SCHEMAS_ERR_ZXML_SCHEMAS_ERR_XXXrrrrs>   +/i   #                "                                                                                                       95N <B 3-b:.F*M;z0%E