diff --git a/ChangeLog b/ChangeLog index 6af9054c..ec1a69ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Tue Nov 19 23:25:47 CET 2002 Daniel Veillard + + * doc/Makefile.am: repair some problem if gtk-doc fail or such + * configure.in: patch for Solaris on new autoconf closes #98880 + * doc/parsedecl.py: repair the frigging API building script, + did I say that python xmllib sucks ? + * doc/libxml2-api.xml doc/libxml2-refs.xml: regenerated, reordering + and some comment are no more truncated. + Tue Nov 19 09:09:04 CET 2002 Daniel Veillard * parser.c: Martin Stoilov pointed out a potential leak in diff --git a/configure.in b/configure.in index ca647018..1a92004e 100644 --- a/configure.in +++ b/configure.in @@ -82,12 +82,63 @@ LDFLAGS=${_ldflags} dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h unistd.h ctype.h dirent.h errno.h malloc.h) -AC_CHECK_HEADERS(stdarg.h sys/stat.h sys/types.h time.h ansidecl.h) -AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h) -AC_CHECK_HEADERS(stdlib.h sys/socket.h netinet/in.h arpa/inet.h) -AC_CHECK_HEADERS(netdb.h sys/time.h sys/select.h sys/mman.h) -AC_CHECK_HEADERS(sys/timeb.h signal.h arpa/nameser.h resolv.h) +AC_CHECK_HEADERS([fcntl.h]) +AC_CHECK_HEADERS([unistd.h]) +AC_CHECK_HEADERS([ctype.h]) +AC_CHECK_HEADERS([dirent.h]) +AC_CHECK_HEADERS([errno.h]) +AC_CHECK_HEADERS([malloc.h]) +AC_CHECK_HEADERS([stdarg.h]) +AC_CHECK_HEADERS([sys/stat.h]) +AC_CHECK_HEADERS([sys/types.h]) +AC_CHECK_HEADERS([time.h]) +AC_CHECK_HEADERS([ansidecl.h]) +AC_CHECK_HEADERS([ieeefp.h]) +AC_CHECK_HEADERS([nan.h]) +AC_CHECK_HEADERS([math.h]) +AC_CHECK_HEADERS([fp_class.h]) +AC_CHECK_HEADERS([float.h]) +AC_CHECK_HEADERS([stdlib.h]) +AC_CHECK_HEADERS([sys/socket.h], [], [], +[#if HAVE_SYS_TYPES_H +# include +# endif +]) +AC_CHECK_HEADERS([netinet/in.h], [], [], +[#if HAVE_SYS_TYPES_H +# include +# endif +]) +AC_CHECK_HEADERS([arpa/inet.h], [], [], +[#if HAVE_SYS_TYPES_H +# include +# endif +#if HAVE_ARPA_INET_H +# include +# endif +]) +AC_CHECK_HEADERS([netdb.h]) +AC_CHECK_HEADERS([sys/time.h]) +AC_CHECK_HEADERS([sys/select.h]) +AC_CHECK_HEADERS([sys/mman.h]) +AC_CHECK_HEADERS([sys/timeb.h]) +AC_CHECK_HEADERS([signal.h]) +AC_CHECK_HEADERS([arpa/nameser.h], [], [], +[#if HAVE_SYS_TYPES_H +# include +# endif +]) +AC_CHECK_HEADERS([resolv.h], [], [], +[#if HAVE_SYS_TYPES_H +# include +# endif +#if HAVE_NETINET_IN_H +# include +# endif +#if HAVE_ARPA_NAMESER_H +# include +# endif +]) dnl Specific dir for HTML output ? if test "x$with_html_dir" = "x" ; then diff --git a/doc/Makefile.am b/doc/Makefile.am index fa53daf4..be18b464 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -37,21 +37,19 @@ $(APIPAGES): libxml2-refs.xml site.xsl api.xsl $(bindir)/xsltproc --html $(top_srcdir)/doc/api.xsl $(top_srcdir)/doc/xml.html ; fi ); scan: - gtkdoc-scan --module=libxml --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="acconfig.h config.h win32config.h trio.h triostr.h triop.h config-mac.h XMLTestPrefix2.h XMLTestPrefix.h triodef.h trionan.h xlink.h libxml.h libxml2-py.h libxml_wrap.h xmlschemas.h xmlschemastypes.h" + -gtkdoc-scan --module=libxml --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="acconfig.h config.h win32config.h trio.h triostr.h triop.h config-mac.h XMLTestPrefix2.h XMLTestPrefix.h triodef.h trionan.h xlink.h libxml.h libxml2-py.h libxml_wrap.h xmlschemas.h xmlschemastypes.h" templates: scan - gtkdoc-mktmpl --module=libxml + -gtkdoc-mktmpl --module=libxml -sgml: - gtkdoc-mkdb --module=libxml --source-dir=$(DOC_SOURCE_DIR) +sgml: templates + -gtkdoc-mkdb --module=libxml --source-dir=$(DOC_SOURCE_DIR) -xml: sgml +xml: sgml if test -d xml ; then rm xml/* ; else mkdir xml ; fi -@(for s in sgml/*.sgml ; do name=`basename $$s .sgml` ; \ - echo ' ]>' > \ - xml/"$$name".xml ;\ - grep -v "^++' >> xml/"$$name".xml ; done) - + xmllint --sgml $$s > xml/"$$name".xml ; done) + libxml2-api.xml libxml2-refs.xml: xml parsedecl.py libxml-decl.txt libxml-decl-list.txt -(./parsedecl.py) @@ -67,7 +65,7 @@ clean-local: maintainer-clean-local: clean rm -rf sgml html libxml-decl-list.txt libxml-decl.txt -libxml-decl-list.txt : templates +libxml-decl-list.txt libxml-decl.txt : templates libxml-sections.txt : scan cp libxml-decl-list.txt libxml-sections.txt diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml index 3c532652..5df28f48 100644 --- a/doc/libxml2-api.xml +++ b/doc/libxml2-api.xml @@ -1,6 +1,492 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -66,7 +552,6 @@ - @@ -118,43 +603,201 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -177,237 +820,221 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -601,7 +1228,6 @@ - @@ -626,534 +1252,44 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + @@ -1199,181 +1335,167 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1415,125 +1537,47 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + Macro used to signal to GCC unused function parameters @@ -1572,7 +1616,7 @@ DEBUG_MEMORY replaces the allocator with a collect and debug shell to the libc allocator. DEBUG_MEMORY should only be activated when debugging libxml i.e. if libxml has been configured with --with-debug-mem too. - + Whether the memory debugging is configured in @@ -1664,72 +1708,72 @@ The parser tries to always have that amount of input ready. One of the point is providing context when reporting errors. - Macro to check the following production in the XML spec: + Macro to check the following production in the XML spec: [85] BaseChar ::= ... long list see REC ... - Macro to check the following production in the XML spec: + Macro to check the following production in the XML spec: [3] S ::= (x20 | x9 | xD | xA)+ - Macro to check the following production in the XML spec: + Macro to check the following production in the XML spec: [2] Char ::= x9 | xA | xD | [x20-xD7FF] | [xE000-xFFFD] | [x10000-x10FFFF] any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. - Macro to check the following production in the XML spec: + Macro to check the following production in the XML spec: [87] CombiningChar ::= ... long list see REC ... - Macro to check the following production in the XML spec: + Macro to check the following production in the XML spec: [88] Digit ::= ... long list see REC ... - Macro to check the following production in the XML spec: + Macro to check the following production in the XML spec: [89] Extender ::= x00B7 | x02D0 | x02D1 | x0387 | x0640 | x0E46 | x0EC6 | x3005 | [x3031-x3035] | [x309D-x309E] | [x30FC-x30FE] - Macro to check the following production in the XML spec: + Macro to check the following production in the XML spec: [86] Ideographic ::= [x4E00-x9FA5] | x3007 | [x3021-x3029] - Macro to check the following production in the XML spec: + Macro to check the following production in the XML spec: [84] Letter ::= BaseChar | Ideographic - Macro to check the following production in the XML spec: + Macro to check the following production in the XML spec: [13] PubidChar ::= x20 | xD | xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] Whether the automata interfaces are compiled in - + Whether the Canonicalization support is configured in - + Whether the Catalog support is configured in - + Whether Debugging module is configured in - + Used on Windows (MS C compiler only) to declare a variable as imported from the library. This macro should be empty when compiling libxml itself. It should expand to __declspec(dllimport) when the client code includes this header, and that only if the client links dynamically against libxml. For this to work, we need three macros. One tells us which compiler is being used and luckily the compiler defines such a thing: _MSC_VER. The second macro tells us if we are compiling libxml or the client code and we define the macro IN_LIBXML on the compiler's command line for this purpose. The third macro, LIBXML_STATIC, must be defined by any client code which links against libxml statically. - + Whether the SGML Docbook support is configured in - + the version string like "1.2.3" - + Whether the FTP support is configured in - + Whether the HTML support is configured in - + Whether the HTTP support is configured in - + Whether iconv support is available @@ -1738,30 +1782,32 @@ Whether the Schemas validation interfaces are compiled in - + Macro to check that the libxml version in use is compatible with the version the software has been compiled against - + Whether the thread support is configured in Whether the Unicode related interfaces are compiled in - + the version number: 1.2.3 value is 1002003 - + the version number string, 1.2.3 value is "1002003" - + Whether XInclude is configured in - + Whether XPath is configured in - + Whether XPointer is configured in + + Skips to the next '>' char. @@ -1770,6 +1816,20 @@ Skips to the next '<' char. + + + + + + + + + + + + + + Skips the end of line chars. @@ -1778,24 +1838,24 @@ Take a block of UTF-8 chars in and try to convert it to an ASCII plus HTML entities block of chars out. - + - + - + Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1 block of chars out. - + - + - + - + defined if the trio support should not be configured in - + defined if the trio support need to be configured in @@ -1985,9 +2045,11 @@ Macro to extract the content pointer of a node. + Macro to extract the line number of an element node. This will work only if line numbering is activated by calling xmlLineNumbersDefault(1) before parsing. + @@ -2224,6 +2286,10 @@ + + + + A comment has been parsed. @@ -2262,11 +2328,11 @@ Take a block of UTF-8 chars in and try to convert it to an ASCII plus SGML entities block of chars out. - + - + - + @@ -2405,7 +2471,7 @@ - Display and format fatal error messages, callback. + Display and format fatal error messages, callback. Note: so far fatalError() SAX callbacks are not used, error() get all the callbacks for errors. @@ -2483,6 +2549,10 @@ + + + + An old global namespace has been parsed. @@ -2573,22 +2643,22 @@ Take a block of UTF-8 chars in and try to convert it to an ASCII plus HTML entities block of chars out. - + - + - + - Lookup the given entity in EntitiesTable + Lookup the given entity in EntitiesTable TODO: the linear scan is really ugly, an hash table is really needed. - Lookup the given entity in EntitiesTable + Lookup the given entity in EntitiesTable TODO: the linear scan is really ugly, an hash table is really needed. @@ -2654,7 +2724,7 @@ - Dump an HTML node, recursive behaviour,children are printed too. + Dump an HTML node, recursive behaviour,children are printed too. TODO: if encoding == NULL try to save in the doc encoding @@ -2673,7 +2743,7 @@ - parse Reference declarations + parse Reference declarations [66] CharRef ::= '&#' [0-9]+ ';' | '&x' [0-9a-fA-F]+ ';' @@ -2697,12 +2767,12 @@ - parse an HTML element, this is highly recursive + parse an HTML element, this is highly recursive [39] element ::= EmptyElemTag | STag content ETag [41] Attribute ::= Name Eq AttValue - parse an HTML ENTITY references + parse an HTML ENTITY references [68] EntityRef ::= '&' Name ';' @@ -2842,11 +2912,11 @@ Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8 block of chars out. - + - + - + Pops the top element name from the name stack @@ -2896,6 +2966,15 @@ Global setting, DEPRECATED. + + + + + + + + + A processing instruction has been parsed. @@ -2910,6 +2989,12 @@ + + + + + + called when an entity reference is detected. @@ -2978,6 +3063,10 @@ + + + + What to do when an unparsed entity declaration is parsed @@ -3014,6 +3103,12 @@ + + + + + + Add an entry in the catalog, it may overwrite existing but different entries. @@ -3172,9 +3267,9 @@ - + - + @@ -3276,7 +3371,7 @@ - + Add a string range to an XML buffer. if len == -1, the length of str is recomputed. @@ -3385,14 +3480,8 @@ - - For VMS only. routine which manages and grows an output buffer. This one adds xmlChars at the end of the buffer. - - - - - Computes he final URI of the reference done by checking that the given URI is valid, and building the final URI using the base URI. This is processed according to section 5.2 of the RFC 2396 + Computes he final URI of the reference done by checking that the given URI is valid, and building the final URI using the base URI. This is processed according to section 5.2 of the RFC 2396 5.2. Resolving Relative References to Absolute Form @@ -3433,7 +3522,7 @@ - + @@ -3585,19 +3674,19 @@ Take a block of chars in the original encoding and try to convert it to an UTF-8 block of chars out. - + - + - + Take a block of UTF-8 chars in and try to convert it to an other encoding. Note: a first call designed to produce heading info is called with in = NULL. If stateful this should also initialize the encoder state. - + - + - + a strdup for char's to xmlChar's @@ -3608,27 +3697,27 @@ a strndup for char's to xmlChar's - + - function checks to see if path is a valid source (file, socket...) for XML. + function checks to see if path is a valid source (file, socket...) for XML. if stat is not available on the target machine, returns 1. if stat fails, returns 0 (if calling stat on the filename fails, it can't be right). if stat succeeds and the file is a directory, - Checks that the value conforms to the LanguageID production: + Checks 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])+ Checks utf for being valid utf-8. utf is assumed to be null-terminated. This function is not super-strict, as it will allow longer utf-8 sequences than necessary. Note that Java is capable of producing these sequences if provoked. Also note, this routine checks for the 4-byte maximum size, but does not check for 0x10ffff maximum value. - + - + check the compiled lib version against the include one. This can warn or immediately kill the application - + Macro for compatibility naming layer with libxml1. @@ -3898,7 +3987,7 @@ - This function is deprecated, we now always process entities content through xmlStringDecodeEntities + This 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 ';' @@ -3934,7 +4023,7 @@ Global setting, indicate that the parser should work in validating mode. Disabled by default. - + Do a copy of the node to a given document. @@ -3999,7 +4088,7 @@ - + This will dump the content of the attribute declaration as an XML DTD definition @@ -4056,8 +4145,8 @@ - - + + @@ -4066,7 +4155,7 @@ - Do a global encoding of a string, replacing the predefined entities and non ASCII values with their entities and CharRef counterparts. + Do a global encoding of a string, replacing the predefined entities and non ASCII values with their entities and CharRef counterparts. TODO: 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. @@ -4094,7 +4183,7 @@ - + External entity loaders types. @@ -4431,13 +4520,19 @@ xmlGetThreadId() find the current thread ID number + + Read one UTF8 Char from utf + + + + Global setting, indicate that the parser should provide warnings. Activated by default. - Default handling of defined entities, when should we define a new input stream ? When do we just handle that as a set of chars ? + Default 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. @@ -4637,7 +4732,7 @@ - + @@ -4692,7 +4787,7 @@ Load and parse a DTD - + @@ -4762,7 +4857,7 @@ - Check whether the character is allowed by the production [85] BaseChar ::= ... long list see REC ... + Check whether the character is allowed by the production [85] BaseChar ::= ... long list see REC ... VI is your friend ! :1,$ s/\[x\([0-9A-Z]*\)-x\([0-9A-Z]*\)\]/ (((c) >= 0x\1) \&\& ((c) <= 0x\2)) ||/ and :1,$ s/x\([0-9A-Z]*\)/ ((c) == 0x\1) ||/ @@ -5031,7 +5126,7 @@ Load 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 - + Global setting, indicate that the parser should load DTD while not validating. Disabled by default. @@ -5056,7 +5151,7 @@ Count the children of node. - + @@ -5086,6 +5181,11 @@ + + a free() equivalent, with error checking. + + + Return the memory access functions set currently in use @@ -5094,8 +5194,19 @@ + + a malloc() equivalent, with logging of the allocation info. + + + + + a realloc() equivalent, with logging of the allocation info. + + + + - Override the default memory access functions with a new set This has to be called before any other libxml routines ! + Override the default memory access functions with a new set This has to be called before any other libxml routines ! Should this be blocked if there was already some allocations done ? @@ -5127,6 +5238,11 @@ Dump in-extenso the memory blocks allocated to the file .memorylist + + a strdup() equivalent, with logging of the allocation info. + + + xmlMutexLock() is used to lock a libxml2 token. @@ -5140,17 +5256,17 @@ - parse an XML namespace name. + parse 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 - parse a namespace prefix declaration + 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)? - TODO: this seems not in use anymore, the namespace handling is done on top of the SAX interfaces, i.e. not on raw input. + TODO: this seems not in use anymore, the namespace handling is done on top of the SAX interfaces, i.e. not on raw input. parse an XML qualified name [NS 5] QName ::= (Prefix ':')? LocalPart [NS 6] Prefix ::= NCName [NS 7] LocalPart ::= NCName @@ -5249,7 +5365,7 @@ - + Send a QUIT command to the server @@ -5604,7 +5720,7 @@ - + Append the extra substring to the node content. @@ -5616,7 +5732,7 @@ - + Dump 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 @@ -5696,7 +5812,7 @@ - + Set the language of a node, i.e. the values of the xml:lang attribute. @@ -5718,7 +5834,7 @@ - Applies the 5 normalization steps to a path string--that is, RFC 2396 Section 5.2, steps 6.c through 6.g. + Applies the 5 normalization steps to a path string--that is, RFC 2396 Section 5.2, steps 6.c through 6.g. Normalization occurs directly on the string, no new allocation is done @@ -5727,10 +5843,10 @@ - + - + @@ -5808,29 +5924,29 @@ - parse a value for an attribute Note: the parser won't do substitution of entities here, this will be handled later in xmlStringGetNodeList + 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 "xDxA" 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. - parse an attribute + parse an attribute [41] Attribute ::= Name Eq AttValue [ WFC: No External Entity References ] Attribute values cannot contain direct or indirect entity references to external entities. [ WFC: No < in Attribute Values ] The replacement text of any entity referred to directly or indirectly in an attribute value (other than "&lt;") must not contain a <. [ VC: Attribute Value Type ] The attribute must have been declared; the value must be of the type declared for it. [25] Eq ::= S? '=' S? With namespace: [NS 11] Attribute ::= QName Eq AttValue Also the case QName == xmlns:??? is handled independently as a namespace definition. - : parse the Attribute list def for an element + : parse the Attribute list def for an element [52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>' [53] AttDef ::= S Name S AttType S DefaultDecl - parse the Attribute list def for an element + parse the Attribute list def for an element [54] AttType ::= StringType | TokenizedType | EnumeratedType [55] StringType ::= 'CDATA' [56] TokenizedType ::= 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY' | 'ENTITIES' | 'NMTOKEN' | 'NMTOKENS' Validity constraints for attribute values syntax are checked in xmlValidateAttributeValue() [ VC: ID ] Values of type ID must match the Name production. A name must not appear more than once in an XML document as a value of this type; i.e., ID values must uniquely identify the elements which bear them. [ VC: One ID per Element Type ] No element type may have more than one ID attribute specified. [ VC: ID Attribute Default ] An ID attribute must have a declared default of IMPLIED or REQUIRED. [ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names; each IDREF Name must match the value of an ID attribute on some element in the XML document; i.e. IDREF values must match the value of some ID attribute. [ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names; each Entity Name must match the name of an unparsed entity declared in the DTD. [ VC: Name Token ] Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens. - Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar: + Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)* @@ -5840,7 +5956,7 @@ - Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar: + Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)* @@ -5851,7 +5967,7 @@ - Parse escaped pure raw content. + Parse escaped pure raw content. [18] CDSect ::= CDStart CData CDEnd [19] CDStart ::= '<![CDATA[' [20] Data ::= (Char* - (Char* ']]>' Char*)) [21] CDEnd ::= ']]>' @@ -5861,7 +5977,7 @@ - parse a CharData section. if we are within a CDATA section ']]>' marks an end of section. + parse 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 "&gt;", and must, for compatibility, be escaped using "&gt;" 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 ::= [^<&]* - ([^<&]* ']]>' [^<&]*) @@ -5872,7 +5988,7 @@ - parse Reference declarations + parse 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. @@ -5885,17 +6001,17 @@ - Skip an XML (SGML) comment <!-- .... --> The spec says that "For compatibility, the string "--" (double-hyphen) must not occur within comments. " + Skip an XML (SGML) comment <!-- .... --> The spec says that "For compatibility, the string "--" (double-hyphen) must not occur within comments. " [15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->' - Parse a content: + Parse a content: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)* - Parse an external general entity within an existing parsing context An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. + Parse an external general entity within an existing parsing context An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. [78] extParsedEnt ::= TextDecl? content @@ -5909,7 +6025,7 @@ - Parse an attribute default declaration + Parse an attribute default declaration [60] DefaultDecl ::= 'REQUIRED' | 'IMPLIED' | (('FIXED' S)? AttValue) [ VC: Required Attribute ] if the default declaration is the keyword REQUIRED, then the attribute must be specified for all elements of the type in the attribute-list declaration. [ VC: Attribute Default Legal ] The declared default value must meet the lexical constraints of the declared attribute type c.f. xmlValidateAttributeDecl() [ VC: Fixed Attribute Default ] if an attribute has a default value declared with the FIXED keyword, instances of that attribute must match the default value. [ WFC: No < in Attribute Values ] handled in xmlParseAttValue() @@ -5920,103 +6036,98 @@ - parse a DOCTYPE declaration + parse a DOCTYPE declaration [28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('[' (markupdecl | PEReference | S)* ']' S?)? '>' [ VC: Root Element Type ] The Name in the document type declaration must match the element type of the root element. - parse an XML document (and build a tree if using the standard SAX interface). + parse an XML document (and build a tree if using the standard SAX interface). [1] document ::= prolog element Misc* [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)? - parse an XML element, this is highly recursive + parse 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. [ VC: Element Valid ] An element is valid if there is a declaration matching elementdecl where the Name matches the element type and one of the following holds: - The declaration matches EMPTY and the element has no content. - The declaration matches children and the sequence of child elements belongs to the language generated by the regular expression in the content model, with optional white space (characters matching the nonterminal S) between each pair of child elements. - The declaration matches Mixed and the content consists of character data and child elements whose types match names in the content model. - The declaration matches ANY, and the types of any child elements have been declared. - - VMS version of xmlParseElementChildrenContentDecl() - - - - parse the declaration for a Mixed Element content The leading '(' and spaces have been skipped in xmlParseElementContentDecl + parse the declaration for a Mixed Element content The leading '(' and spaces have been skipped in xmlParseElementContentDecl [47] children ::= (choice | seq) ('?' | '*' | '+')? [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')? [49] choice ::= '(' S? cp ( S? '|' S? cp )* S? ')' [50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')' [ VC: Proper Group/PE Nesting ] applies to [49] and [50] TODO Parameter-entity replacement text must be properly nested with parenthesized groups. That is to say, if either of the opening or closing parentheses in a choice, seq, or Mixed construct is contained in the replacement text for a parameter entity, both must be contained in the same replacement text. For interoperability, if a parameter-entity reference appears in a choice, seq, or Mixed construct, its replacement text should not be empty, and neither the first nor last non-blank character of the replacement text should be a connector (| or ,). - parse the declaration for an Element content either Mixed or Children, the cases EMPTY and ANY are handled directly in xmlParseElementDecl + parse the declaration for an Element content either Mixed or Children, the cases EMPTY and ANY are handled directly in xmlParseElementDecl [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children - parse an Element declaration. + parse an Element declaration. [45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>' [ VC: Unique Element Type Declaration ] No element type may be declared more than once - parse the declaration for a Mixed Element content The leading '(' and spaces have been skipped in xmlParseElementContentDecl + parse the declaration for a Mixed Element content The leading '(' and spaces have been skipped in xmlParseElementContentDecl [51] Mixed ::= '(' S? 'PCDATA' (S? '|' S? Name)* S? ')*' | '(' S? 'PCDATA' S? ')' [ VC: Proper Group/PE Nesting ] applies to [51] too (see [49]) [ VC: No Duplicate Types ] The same name must not appear more than once in a single mixed-content declaration. - parse the XML encoding name + parse the XML encoding name [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')* - parse the XML encoding declaration + parse the XML encoding declaration [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'") this setups the conversion filters. - parse an end of tag + parse an end of tag [42] ETag ::= '</' Name S? '>' With namespace [NS 9] ETag ::= '</' QName S? '>' - parse an XML external entity out of context and build a tree. + parse an XML external entity out of context and build a tree. [78] extParsedEnt ::= TextDecl? content This correspond to a "Well Balanced" chunk - parse <!ENTITY declarations + parse <!ENTITY declarations [70] EntityDecl ::= GEDecl | PEDecl [71] GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>' [72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>' [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. - parse ENTITY references declarations + parse 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 - parse a value for ENTITY declarations + parse a value for ENTITY declarations [9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' | "'" ([^%&'] | PEReference | Reference)* "'" - parse an Enumerated attribute type. + parse an Enumerated attribute type. [57] EnumeratedType ::= NotationType | Enumeration [58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')' - parse an Enumeration attribute type. + parse an Enumeration attribute type. [59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')' [ VC: Enumeration ] Values of this type must match one of the Nmtoken tokens in the declaration - parse a general parsed entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. + parse a general parsed entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. [78] extParsedEnt ::= TextDecl? content - Parse an external general entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. + Parse an external general entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. [78] extParsedEnt ::= TextDecl? content @@ -6027,14 +6138,14 @@ - Parse an External ID or a Public ID + Parse an External ID or a Public ID NOTE: Productions [75] and [83] interact badly since [75] can generate 'PUBLIC' S PubidLiteral S SystemLiteral [75] ExternalID ::= 'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral [83] PublicID ::= 'PUBLIC' S PubidLiteral - parse Markup declarations from an external subset + parse Markup declarations from an external subset [30] extSubset ::= textDecl? extSubsetDecl [31] extSubsetDecl ::= (markupdecl | conditionalSect | PEReference | S) * @@ -6046,7 +6157,7 @@ - parse Markup declarations + parse 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.) @@ -6057,108 +6168,108 @@ - parse an XML Misc* optional field. + parse an XML Misc* optional field. [27] Misc ::= Comment | PI | S - parse an XML name. + parse an XML name. [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender [5] Name ::= (Letter | '_' | ':') (NameChar)* [6] Names ::= Name (S Name)* - xmlParseNamespace: parse specific PI '<?namespace ...' constructs. + xmlParseNamespace: parse specific PI '<?namespace ...' constructs. This is what the older xml-name Working Draft specified, a bunch of other stuff may still rely on it, so support is still here as if it was declared on the root of the Tree:-( TODO: remove from library To be removed at next drop of binary compatibility - parse an XML Nmtoken. + parse an XML Nmtoken. [7] Nmtoken ::= (NameChar)+ [8] Nmtokens ::= Nmtoken (S Nmtoken)* - parse a notation declaration + parse a notation declaration [82] NotationDecl ::= '<!NOTATION' S Name S (ExternalID | PublicID) S? '>' Hence there is actually 3 choices: 'PUBLIC' S PubidLiteral 'PUBLIC' S PubidLiteral S SystemLiteral and 'SYSTEM' S SystemLiteral See the NOTE on xmlParseExternalID(). - parse an Notation attribute type. + parse an Notation attribute type. Note: the leading 'NOTATION' S part has already being parsed... [58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')' [ VC: Notation Attributes ] Values of this type must match one of the notation names included in the declaration; all notation names in the declaration must be declared. - parse PEReference declarations The entity content is handled directly by pushing it's content as a new input stream. + parse 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. - parse an XML Processing Instruction. + parse an XML Processing Instruction. [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>' The processing is transfered to SAX once parsed. - parse the name of a PI + parse the name of a PI [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l')) - parse an XML public literal + parse an XML public literal [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'" - Parse and return a string between quotes or doublequotes + Parse and return a string between quotes or doublequotes TODO: Deprecated, to be removed at next drop of binary compatibility - parse 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. + parse 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 - parse the XML standalone declaration + parse 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. - parse a start of tag either for rule element or EmptyElement. In both case we don't parse the tag closing chars. + parse 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? '/>' - parse an XML Literal + parse an XML Literal [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'") - parse an XML declaration header for external entities + parse an XML declaration header for external entities [77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>' Question: Seems that EncodingDecl is mandatory ? Is that a typo ? - Parse an URI + Parse an URI URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ] - Parse an URI reference string and fills in the appropriate fields of the uri structure + Parse an URI reference string and fills in the appropriate fields of the uri structure URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ] - parse the XML version. + parse the XML version. [24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ") [25] Eq ::= S? '=' S? - parse the XML version value. + parse the XML version value. [26] VersionNum ::= ([a-zA-Z0-9_.:] | '-')+ - parse an XML declaration header + parse an XML declaration header [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>' @@ -6168,7 +6279,7 @@ - + Global setting, asking the parser to print out debugging informations. while handling entities. Disabled by default @@ -6199,16 +6310,16 @@ - [69] PEReference ::= '%' Name ';' + [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-xmlentproc i.e. - Included in literal in entity values - Included as Parameter Entity reference within DTDs - TODO: Remove, now deprecated ... the test is done directly in the content parsing routines. + 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-xmlentproc - + Create a buffered parser input for the progressive parsing for the input from a file descriptor @@ -6228,12 +6339,6 @@ - - VMS version of xmlParserInputBufferCreateFilename() - - - - Create a buffered parser input for the progressive parsing for the input from an I/O handler @@ -6250,7 +6355,7 @@ - Grow 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 + Grow 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 @@ -6293,7 +6398,7 @@ - + @@ -6409,7 +6514,7 @@ - + @@ -6520,16 +6625,16 @@ Unlink the old node from it's 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. - + Macro for compatibility naming layer with libxml1. - + - + Load and parse an external subset. @@ -6546,7 +6651,7 @@ - parse an XML external entity out of context and build a tree. It use the given SAX function block to handle the parsing callback. If sax is NULL, fallback to the default DOM tree building routines. + parse an XML external entity out of context and build a tree. It use the given SAX function block to handle the parsing callback. If sax is NULL, fallback to the default DOM tree building routines. [78] extParsedEnt ::= TextDecl? content This correspond to a "Well Balanced" chunk @@ -6559,7 +6664,7 @@ - parse an XML file and build a tree. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. It use the given SAX function block to handle the parsing callback. If sax is NULL, fallback to the default DOM tree building routines. + parse an XML file and build a tree. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. It use the given SAX function block to handle the parsing callback. If sax is NULL, fallback to the default DOM tree building routines. User data (void *) is stored within the parser context in the context's _private member, so it is available nearly everywhere in libxml @@ -6574,6 +6679,15 @@ + + parse an XML in-memory block and use the given SAX function block to handle the parsing callback. If sax is NULL, fallback to the default DOM tree building routines. User data (void *) is stored within the parser context in the context's _private member, so it is available nearly everywhere in libxml + + + + + + + parse an XML file and call the given SAX handler routines. Automatic support for ZLIB/Compress compressed document is provided @@ -6640,7 +6754,7 @@ - Trickery: parse an XML name but without consuming the input flow Needed for rollback cases. Used only when parsing entities references. + Trickery: 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)* @@ -6793,7 +6907,7 @@ - + Implements the XML shell function "dir" dumps informations about the node (namespace, attributes, content). @@ -6894,14 +7008,14 @@ - parse an UTF8 encoded XML qualified name string + parse an UTF8 encoded XML qualified name string [NS 5] QName ::= (Prefix ':')? LocalPart [NS 6] Prefix ::= NCName [NS 7] LocalPart ::= NCName - parse an XML qualified name string + parse an XML qualified name string [NS 5] QName ::= (Prefix ':')? LocalPart [NS 6] Prefix ::= NCName [NS 7] LocalPart ::= NCName @@ -6972,7 +7086,7 @@ - Takes a entity string content and process to do the adequate substitutions. + Takes a entity string content and process to do the adequate substitutions. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';' @@ -7008,10 +7122,10 @@ a strncat for array of xmlChar's, it will extend cur with the len first bytes of add. - + - + a strncmp for xmlChar's @@ -7024,7 +7138,7 @@ a strndup for array of xmlChar's - + a strstr for xmlChar's @@ -7045,7 +7159,7 @@ - Global variable controlling the entity substitution default behavior. + Global setting, indicate that the parser should not generate entity references but replace them with the actual content of the entity Disabled by default, this should be activated when using XPath since the XPath data model requires entities replacement and the XPath engine does not handle entities references transparently. change the input functions when discovering the character encoding of a given entity. @@ -7747,7 +7861,7 @@ - + Escaping routine, does not do validity checks ! It will try to escape the chars needing this, but this is heuristic based it's impossible to be sure. @@ -7782,7 +7896,7 @@ a strndup for array of UTF8's - + a function to provide the equivalent of fetching a character from a string array @@ -7833,7 +7947,7 @@ - Does the validation related extra step of the normalization of attribute values: + Does 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 @@ -7851,15 +7965,15 @@ - This function returns the list of authorized children to insert within an existing tree while respecting the validity constraints forced by the Dtd. The insertion point is defined using prev and next in the following ways: to insert before 'node': xmlValidGetValidElements(node->prev, node, ... to insert next 'node': xmlValidGetValidElements(node, node->next, ... to replace 'node': xmlValidGetValidElements(node->prev, node->next, ... to prepend a child to 'node': xmlValidGetValidElements(NULL, node->childs, to append a child to 'node': xmlValidGetValidElements(node->last, NULL, ... - + This function returns the list of authorized children to insert within an existing tree while respecting the validity constraints forced by the Dtd. The insertion point is defined using prev and next in the following ways: to insert before 'node': xmlValidGetValidElements(node->prev, node, ... to insert next 'node': xmlValidGetValidElements(node, node->next, ... to replace 'node': xmlValidGetValidElements(node->prev, node->next, ... to prepend a child to 'node': xmlValidGetValidElements(NULL, node->childs, to append a child to 'node': xmlValidGetValidElements(node->last, NULL, ... pointers to the element names are inserted at the beginning of the array and do not need to be freed. + - Does the validation related extra step of the normalization of attribute values: + Does 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. @@ -7869,39 +7983,39 @@ - Try to validate a single attribute definition basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Default Legal ] - [ VC: Enumeration ] - [ VC: ID Attribute Default ] + Try to validate a single attribute definition basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Default Legal ] - [ VC: Enumeration ] - [ VC: ID Attribute Default ] The ID/IDREF uniqueness and matching are done separately - Validate that the given attribute value match the proper production + Validate that the given attribute value match the proper production [ VC: ID ] Values of type ID must match the Name production.... [ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names ... [ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names ... [ VC: Name Token ] Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens. - Try to validate the document instance + Try 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. - Does the final step for the document validation once all the incremental validation steps have been completed + Does 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 - Try to validate the document against the dtd instance + Try to validate the document against the dtd instance basically it does check all the definitions in the DtD. - Does the final step for the dtds validation once all the subsets have been parsed + Does 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. @@ -7931,12 +8045,12 @@ - Validate that the given value match Nmtoken production + Validate that the given value match Nmtoken production [ VC: Name Token ] - Validate that the given value match Nmtokens production + Validate that the given value match Nmtokens production [ VC: Name Token ] @@ -7955,7 +8069,7 @@ - Try 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 ] + Try 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 @@ -7964,14 +8078,14 @@ - 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. + 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 - Try 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 ] + Try 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 @@ -8091,7 +8205,7 @@ Converts an existing object to its string() equivalent - + @@ -8110,10 +8224,10 @@ - + - Implement the compare operation on XPath objects: arg1 < arg2 (1, 1, ... arg1 <= arg2 (1, 0, ... arg1 > arg2 (0, 1, ... arg1 >= arg2 (0, 0, ... + Implement 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. @@ -8142,11 +8256,11 @@ - + Converts an existing object to its boolean() equivalent - + @@ -8157,12 +8271,12 @@ Converts an existing object to its number() equivalent - + Converts an existing object to its string() equivalent - + @@ -8193,12 +8307,12 @@ Implements the EXSLT - Sets distinct() function: node-set set:distinct (node-set) nodes is sorted by document order, then exslSetsDistinctSorted is called with the sorted node-set - + Implements the EXSLT - Sets distinct() function: node-set set:distinct (node-set) - + @@ -8335,7 +8449,7 @@ Implements the EXSLT - Sets has-same-nodes function: boolean set:has-same-node(node-set, node-set) - + @@ -8366,7 +8480,7 @@ - Is the name given a NodeType one. + Is the name given a NodeType one. [38] NodeType ::= 'comment' | 'text' | 'processing-instruction' | 'node' @@ -8384,13 +8498,13 @@ Implements the EXSLT - Sets leading() function: node-set set:leading (node-set, node-set) nodes1 and nodes2 are sorted by document order, then exslSetsLeadingSorted is called. - + Implements the EXSLT - Sets leading() function: node-set set:leading (node-set, node-set) - + @@ -8511,7 +8625,7 @@ - Traversal function for the "namespace" direction the namespace axis contains the namespace nodes of the context node; the order of nodes on this axis is implementation-defined; the axis will be empty unless the context node is an element + Traversal function for the "namespace" direction the namespace axis contains the namespace nodes of the context node; the order of nodes on this axis is implementation-defined; the axis will be empty unless the context node is an element We keep the XML namespace node at the end of the list. @@ -8542,13 +8656,13 @@ Implements the EXSLT - Sets leading() function: node-set set:leading (node-set, node-set) nodes is sorted by document order, then exslSetsNodeLeadingSorted is called. - + Implements the EXSLT - Sets leading() function: node-set set:leading (node-set, node-set) - + @@ -8573,7 +8687,7 @@ checks whether cur contains val - + @@ -8625,13 +8739,13 @@ Implements the EXSLT - Sets trailing() function: node-set set:trailing (node-set, node-set) nodes is sorted by document order, then xmlXPathNodeTrailingSorted is called. - + Implements the EXSLT - Sets trailing() function: node-set set:trailing (node-set, node-set) - + @@ -8673,16 +8787,16 @@ - parse an XML namespace non qualified name. + parse an XML namespace non qualified name. [NS 3] NCName ::= (Letter | '_') (NCNameChar)* [NS 4] NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender - parse an XML name + parse an XML name [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender [5] Name ::= (Letter | '_' | ':') (NameChar)* - + Pops a boolean from the stack, handling conversion if needed. Check error with xmlXPathCheckError. @@ -8866,12 +8980,12 @@ - [30a] Float ::= Number ('e' Digits?)? + [30a] Float ::= Number ('e' Digits?)? [30] Number ::= Digits ('.' Digits?)? | '.' Digits [31] Digits ::= [0-9]+ Compile a Number in the string In complement of the Number expression, this function also handles negative values : '-' Number. - Implement the string() XPath function string string(object?) he string function converts an object to a string as follows: - A node-set is converted to a string by returning the value of the node in the node-set that is first in document order. If the node-set is empty, an empty string is returned. - A number is converted to a string as follows + NaN is converted to the string NaN + positive zero is converted to the string 0 + negative zero is converted to the string 0 + positive infinity is converted to the string Infinity + negative infinity is converted to the string -Infinity + if the number is an integer, the number is represented in decimal form as a Number with no decimal point and no leading zeros, preceded by a minus sign (-) if the number is negative + otherwise, the number is represented in decimal form as a Number including a decimal point with at least one digit before the decimal point and at least one digit after the decimal point, preceded by a minus sign (-) if the number is negative; there must be no leading zeros before the decimal point apart possibly from the one required digit immediately before the decimal point; beyond the one required digit after the decimal point there must be as many, but only as many, more digits as are needed to uniquely distinguish the number from all other IEEE 754 numeric values. - The boolean false value is converted to the string false. The boolean true value is converted to the string true. + Implement the string() XPath function string string(object?) he string function converts an object to a string as follows: - A node-set is converted to a string by returning the value of the node in the node-set that is first in document order. If the node-set is empty, an empty string is returned. - A number is converted to a string as follows + NaN is converted to the string NaN + positive zero is converted to the string 0 + negative zero is converted to the string 0 + positive infinity is converted to the string Infinity + negative infinity is converted to the string -Infinity + if the number is an integer, the number is represented in decimal form as a Number with no decimal point and no leading zeros, preceded by a minus sign (-) if the number is negative + otherwise, the number is represented in decimal form as a Number including a decimal point with at least one digit before the decimal point and at least one digit after the decimal point, preceded by a minus sign (-) if the number is negative; there must be no leading zeros before the decimal point apart possibly from the one required digit immediately before the decimal point; beyond the one required digit after the decimal point there must be as many, but only as many, more digits as are needed to uniquely distinguish the number from all other IEEE 754 numeric values. - The boolean false value is converted to the string false. The boolean true value is converted to the string true. If the argument is omitted, it defaults to a node-set with the context node as its only member. @@ -8913,13 +9027,13 @@ Implements the EXSLT - Sets trailing() function: node-set set:trailing (node-set, node-set) nodes1 and nodes2 are sorted by document order, then xmlXPathTrailingSorted is called. - + Implements the EXSLT - Sets trailing() function: node-set set:trailing (node-set, node-set) - + @@ -9004,7 +9118,7 @@ - [8] Predicate ::= '[' PredicateExpr ']' [9] PredicateExpr ::= Expr + [8] Predicate ::= '[' PredicateExpr ']' [9] PredicateExpr ::= Expr Evaluate a predicate as in xmlXPathEvalPredicate() but for a Location Set instead of a node set diff --git a/doc/libxml2-refs.xml b/doc/libxml2-refs.xml index 4e4ea792..a2fe97e9 100644 --- a/doc/libxml2-refs.xml +++ b/doc/libxml2-refs.xml @@ -85,8 +85,16 @@ + + + + + + + + @@ -146,6 +154,7 @@ + @@ -177,6 +186,8 @@ + + @@ -192,6 +203,7 @@ + @@ -207,10 +219,8 @@ - - @@ -291,8 +301,11 @@ + + + @@ -304,11 +317,14 @@ + + + @@ -331,14 +347,9 @@ - - - - - @@ -353,13 +364,10 @@ - - - @@ -377,17 +385,14 @@ - - - @@ -398,7 +403,6 @@ - @@ -413,8 +417,6 @@ - - @@ -480,7 +482,6 @@ - @@ -491,7 +492,6 @@ - @@ -502,24 +502,15 @@ - - - - - - - - - @@ -585,8 +576,8 @@ + - @@ -612,12 +603,10 @@ - - @@ -662,10 +651,8 @@ - - @@ -701,23 +688,25 @@ - - + + + + - + - + @@ -798,7 +787,6 @@ - @@ -811,7 +799,6 @@ - @@ -821,13 +808,10 @@ - - - @@ -862,7 +846,6 @@ - @@ -905,22 +888,17 @@ - - - - - @@ -932,10 +910,7 @@ - - - @@ -948,28 +923,24 @@ - - + - - - @@ -986,9 +957,7 @@ - - @@ -996,6 +965,7 @@ + @@ -1007,19 +977,12 @@ - - - - - - - @@ -1030,22 +993,15 @@ - - - - - - - @@ -1071,7 +1027,6 @@ - @@ -1111,7 +1066,7 @@ - + @@ -1251,7 +1206,6 @@ - @@ -1267,13 +1221,11 @@ - - @@ -1297,7 +1249,6 @@ - @@ -1318,14 +1269,12 @@ - - @@ -1340,7 +1289,6 @@ - @@ -1357,7 +1305,6 @@ - @@ -1423,13 +1370,10 @@ - - - @@ -1477,10 +1421,8 @@ - - @@ -1614,9 +1556,19 @@ + + + + + + + + + + @@ -1689,6 +1641,7 @@ + @@ -1724,6 +1677,8 @@ + + @@ -1743,6 +1698,7 @@ + @@ -1760,10 +1716,8 @@ - - @@ -1852,12 +1806,15 @@ + + + @@ -1871,6 +1828,8 @@ + + @@ -1882,6 +1841,7 @@ + @@ -1906,14 +1866,9 @@ - - - - - @@ -1928,13 +1883,10 @@ - - - @@ -1952,17 +1904,14 @@ - - - @@ -1973,7 +1922,6 @@ - @@ -1988,8 +1936,6 @@ - - @@ -2055,7 +2001,6 @@ - @@ -2066,7 +2011,6 @@ - @@ -2077,24 +2021,15 @@ - - - - - - - - - @@ -2160,8 +2095,8 @@ + - @@ -2187,12 +2122,10 @@ - - @@ -2237,10 +2170,8 @@ - - @@ -2276,7 +2207,6 @@ - @@ -2285,14 +2215,17 @@ + + + - + @@ -2373,7 +2306,6 @@ - @@ -2386,7 +2318,6 @@ - @@ -2396,13 +2327,10 @@ - - - @@ -2437,7 +2365,6 @@ - @@ -2480,22 +2407,17 @@ - - - - - @@ -2507,10 +2429,7 @@ - - - @@ -2523,7 +2442,6 @@ - @@ -2534,17 +2452,14 @@ - - - @@ -2561,9 +2476,7 @@ - - @@ -2571,6 +2484,7 @@ + @@ -2582,19 +2496,12 @@ - - - - - - - @@ -2605,22 +2512,15 @@ - - - - - - - @@ -2646,7 +2546,6 @@ - @@ -2826,7 +2725,6 @@ - @@ -2842,13 +2740,11 @@ - - @@ -2872,7 +2768,6 @@ - @@ -2893,14 +2788,12 @@ - - @@ -2915,7 +2808,6 @@ - @@ -2932,7 +2824,6 @@ - @@ -2998,13 +2889,10 @@ - - - @@ -3052,10 +2940,8 @@ - - @@ -3174,6 +3060,8 @@ + + @@ -3324,6 +3212,7 @@ + @@ -3342,7 +3231,6 @@ - @@ -3511,7 +3399,6 @@ - @@ -3612,6 +3499,7 @@ + @@ -3674,6 +3562,7 @@ + @@ -3919,7 +3808,6 @@ - @@ -4132,6 +4020,7 @@ + @@ -4145,6 +4034,8 @@ + + @@ -4162,6 +4053,8 @@ + + @@ -4257,6 +4150,7 @@ + @@ -4288,6 +4182,8 @@ + + @@ -4430,7 +4326,6 @@ - @@ -4533,7 +4428,6 @@ - @@ -5189,7 +5083,6 @@ - @@ -5293,6 +5186,7 @@ + @@ -5730,6 +5624,7 @@ + @@ -5935,7 +5830,6 @@ - @@ -5973,6 +5867,7 @@ + @@ -6070,7 +5965,6 @@ - @@ -6349,7 +6243,6 @@ - @@ -6465,6 +6358,24 @@ + + + + + + + + + + + + + + + + + + @@ -6521,7 +6432,6 @@ - @@ -6608,6 +6518,10 @@ + + + + @@ -6794,6 +6708,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -7035,6 +6973,15 @@ + + + + + + + + + @@ -7043,6 +6990,7 @@ + @@ -7081,6 +7029,9 @@ + + + @@ -7106,6 +7057,7 @@ + @@ -7122,9 +7074,14 @@ + + - + + + + @@ -7156,21 +7113,45 @@ - - + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7204,16 +7185,21 @@ + + + + + @@ -7224,6 +7210,9 @@ + + + @@ -7290,7 +7279,27 @@ + + + + + + + + + + + + + + + + + + + + @@ -7409,22 +7418,40 @@ + + + + + + + + + + + + + + + + + + @@ -7474,7 +7501,13 @@ + + + + + + @@ -7485,6 +7518,14 @@ + + + + + + + + @@ -7492,6 +7533,7 @@ + @@ -7540,6 +7582,9 @@ + + + @@ -7659,12 +7704,17 @@ + - + + + + + @@ -7683,9 +7733,18 @@ + + + + + + + + + @@ -7694,14 +7753,21 @@ + + + + + + + @@ -7716,7 +7782,16 @@ + + + + + + + + + @@ -7731,6 +7806,7 @@ + @@ -7758,6 +7834,8 @@ + + @@ -7773,12 +7851,16 @@ + + + + @@ -7840,17 +7922,27 @@ + + + + + + + + + + @@ -7862,6 +7954,11 @@ + + + + + @@ -7878,11 +7975,13 @@ - + - - + + + + @@ -7897,12 +7996,21 @@ + + + + + + + + + @@ -7917,6 +8025,13 @@ + + + + + + + @@ -7932,16 +8047,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7958,6 +8101,7 @@ + @@ -7982,18 +8126,24 @@ - + - + + + + + + + @@ -8001,12 +8151,17 @@ + + + + + @@ -8016,9 +8171,11 @@ + + @@ -8026,6 +8183,7 @@ + @@ -8068,6 +8226,7 @@ + @@ -8075,21 +8234,24 @@ - + - + + + + @@ -8104,6 +8266,7 @@ + @@ -8127,6 +8290,9 @@ + + + @@ -8192,6 +8358,10 @@ + + + + @@ -8250,6 +8420,9 @@ + + + @@ -8262,32 +8435,45 @@ + - + - - + + + + + + + + + + + + + + @@ -8302,8 +8488,11 @@ + + + - + @@ -8311,6 +8500,9 @@ + + + @@ -8320,6 +8512,8 @@ + + @@ -8356,6 +8550,9 @@ + + + @@ -8409,6 +8606,9 @@ + + + @@ -8438,6 +8638,9 @@ + + + @@ -8461,6 +8664,8 @@ + + @@ -8468,16 +8673,22 @@ + + + + + + - + - + @@ -8493,9 +8704,15 @@ + + + + + + @@ -8510,8 +8727,8 @@ + - @@ -8542,6 +8759,9 @@ + + + @@ -8567,6 +8787,7 @@ + @@ -8577,6 +8798,7 @@ + @@ -8602,32 +8824,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + - + + + + + + - + - + - - - + + + + + @@ -8640,17 +8906,28 @@ + + + + + + + + + + + + - @@ -8687,6 +8964,12 @@ + + + + + + @@ -8694,14 +8977,24 @@ - + + + + + + + + + + + @@ -8709,14 +9002,16 @@ - + + + @@ -8727,7 +9022,12 @@ + + + + + @@ -8746,6 +9046,7 @@ + @@ -8756,7 +9057,7 @@ - + @@ -8773,11 +9074,33 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -8794,14 +9117,26 @@ + + + + + + + + + + + + @@ -8818,6 +9153,10 @@ + + + + @@ -8829,6 +9168,9 @@ + + + @@ -8847,14 +9189,13 @@ - - + - + @@ -8871,6 +9212,9 @@ + + + @@ -8887,6 +9231,14 @@ + + + + + + + + @@ -8903,10 +9255,13 @@ + + + @@ -8914,6 +9269,10 @@ + + + + @@ -8934,10 +9293,13 @@ - - + + + + + @@ -8946,9 +9308,16 @@ + + + + + + + @@ -8956,14 +9325,22 @@ + + + + + + + + + - @@ -8976,10 +9353,16 @@ + + + + + + @@ -8995,6 +9378,10 @@ + + + + @@ -9003,7 +9390,20 @@ + + + + + + + + + + + + + @@ -9035,6 +9435,9 @@ + + + @@ -9062,11 +9465,15 @@ + + + + @@ -9084,16 +9491,25 @@ + + + + + + + + + @@ -9118,11 +9534,21 @@ + + + + + + + + + + @@ -9142,13 +9568,13 @@ + - @@ -9184,12 +9610,19 @@ + + + + + + + @@ -9213,6 +9646,7 @@ + @@ -9242,6 +9676,7 @@ + @@ -9258,6 +9693,9 @@ + + + @@ -9287,16 +9725,32 @@ + + + + + + + + + + + + + + + + @@ -9313,12 +9767,12 @@ + + - - @@ -9335,12 +9789,27 @@ + + + + + + + + + + + + + + - + + @@ -9367,6 +9836,16 @@ + + + + + + + + + + @@ -9375,12 +9854,14 @@ + + - + @@ -9389,9 +9870,16 @@ + + + + + + + @@ -9410,6 +9898,9 @@ + + + @@ -9438,6 +9929,11 @@ + + + + + @@ -9446,10 +9942,13 @@ + + + @@ -9469,20 +9968,28 @@ + + + + + + + + - + - + @@ -9496,6 +10003,7 @@ + @@ -9503,6 +10011,8 @@ + + @@ -9541,26 +10051,20 @@ + + + + + + + - - - - - - - - - - - - - - + @@ -9574,23 +10078,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -9601,13 +10138,16 @@ + + + @@ -9617,32 +10157,12 @@ + - - - - - - - - - - - - - - - - - - - - - @@ -9654,6 +10174,14 @@ + + + + + + + + @@ -9675,8 +10203,6 @@ - - @@ -9692,6 +10218,12 @@ + + + + + + @@ -9781,6 +10313,8 @@ + + @@ -9806,11 +10340,16 @@ + + + + + @@ -9821,14 +10360,20 @@ + + + + + + @@ -9851,10 +10396,14 @@ + + + + @@ -9862,41 +10411,43 @@ + - + + + - + + - - @@ -9953,7 +10504,6 @@ - @@ -9967,16 +10517,19 @@ + + + + - @@ -9998,6 +10551,9 @@ + + + @@ -10014,22 +10570,29 @@ + + + - + + + + + @@ -10037,14 +10600,15 @@ + + - @@ -10080,13 +10644,15 @@ + + - + @@ -10095,13 +10661,13 @@ - + + - - + @@ -10117,6 +10683,11 @@ + + + + + @@ -10140,12 +10711,17 @@ + + + + + @@ -10157,11 +10733,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -10172,6 +10773,7 @@ + @@ -10187,9 +10789,15 @@ + + + + + + @@ -10234,8 +10842,9 @@ + + - @@ -10256,13 +10865,20 @@ + + + + + + + @@ -10293,6 +10909,7 @@ + @@ -10302,6 +10919,7 @@ + @@ -10310,10 +10928,12 @@ + + - + @@ -10323,6 +10943,9 @@ + + + @@ -10339,14 +10962,14 @@ + + - - @@ -10362,6 +10985,10 @@ + + + + @@ -10372,6 +10999,9 @@ + + + @@ -10382,6 +11012,7 @@ + @@ -10393,7 +11024,7 @@ - + @@ -10401,13 +11032,13 @@ + - @@ -10427,6 +11058,7 @@ + @@ -10444,11 +11076,15 @@ + + + + @@ -10461,6 +11097,7 @@ + @@ -10468,10 +11105,13 @@ - + + + + - + @@ -10486,30 +11126,43 @@ + + + + + + + - + + + + + + + @@ -10517,7 +11170,7 @@ - + @@ -10585,6 +11238,7 @@ + @@ -10603,10 +11257,13 @@ - + + + + @@ -10614,14 +11271,17 @@ + + - + + @@ -10638,7 +11298,11 @@ + + + + @@ -10648,16 +11312,16 @@ - + + - @@ -10690,15 +11354,18 @@ + + + @@ -10711,7 +11378,6 @@ - @@ -10720,6 +11386,7 @@ + @@ -10729,41 +11396,14 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -10859,6 +11499,7 @@ + @@ -10893,9 +11534,13 @@ + + + + @@ -10911,49 +11556,26 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + @@ -10965,6 +11587,9 @@ + + + @@ -10992,6 +11617,9 @@ + + + @@ -11000,9 +11628,15 @@ + + + + + + @@ -11010,7 +11644,9 @@ + + @@ -11057,40 +11693,19 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + @@ -11124,6 +11739,7 @@ + @@ -11144,6 +11760,12 @@ + + + + + + @@ -11161,14 +11783,21 @@ + + + + + + + @@ -11215,6 +11844,9 @@ + + + @@ -11228,9 +11860,8 @@ + - - @@ -11289,6 +11920,9 @@ + + + @@ -11333,6 +11967,9 @@ + + + @@ -11343,14 +11980,21 @@ - + + + + + + + + @@ -11368,16 +12012,35 @@ + + + + + + + + + + + + + + + + + + + @@ -11393,16 +12056,18 @@ - - + + + + @@ -11417,7 +12082,6 @@ - @@ -11436,6 +12100,10 @@ + + + + @@ -11450,14 +12118,12 @@ - - - + @@ -11466,7 +12132,7 @@ - + @@ -11491,6 +12157,7 @@ + @@ -11499,6 +12166,7 @@ + @@ -11521,12 +12189,19 @@ + + + + + + + @@ -11595,6 +12270,7 @@ + @@ -11616,7 +12292,7 @@ - + @@ -11672,9 +12348,9 @@ + - @@ -11686,6 +12362,7 @@ + @@ -11693,17 +12370,31 @@ + - + + + + + + + + + + + + + + @@ -11726,19 +12417,20 @@ + + - - - + + @@ -11748,53 +12440,24 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -11816,8 +12479,10 @@ + + @@ -11831,8 +12496,11 @@ - + + + + @@ -11851,7 +12519,6 @@ - @@ -11875,7 +12542,7 @@ - + @@ -11922,7 +12589,9 @@ - + + + @@ -11947,9 +12616,9 @@ + - @@ -11963,6 +12632,7 @@ + @@ -11982,12 +12652,24 @@ + + + + + + + + + + + + @@ -12001,6 +12683,11 @@ + + + + + @@ -12033,18 +12720,26 @@ + + + + + + + + @@ -12052,9 +12747,15 @@ + + + + + + @@ -12065,19 +12766,28 @@ + + - + + + + + + + + - + @@ -12085,27 +12795,8 @@ - - - - - - - - - - - - - - - - - - - - + @@ -12131,12 +12822,14 @@ - + + + @@ -12182,33 +12875,42 @@ - + - + + + - + + + + - + + + + + @@ -12219,6 +12921,11 @@ + + + + + @@ -12229,37 +12936,31 @@ + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -12282,6 +12983,7 @@ + @@ -12298,13 +13000,19 @@ - + + + + + + + @@ -12328,6 +13036,7 @@ + @@ -12340,6 +13049,10 @@ + + + + @@ -12371,10 +13084,10 @@ + - @@ -12398,6 +13111,7 @@ + @@ -12411,7 +13125,11 @@ + + + + @@ -12423,6 +13141,7 @@ + @@ -12441,6 +13160,7 @@ + @@ -12468,13 +13188,13 @@ + - @@ -12495,12 +13215,16 @@ + + + + - + @@ -12510,13 +13234,17 @@ + + - + + + @@ -12555,6 +13283,8 @@ + + @@ -12564,12 +13294,12 @@ - + @@ -12587,8 +13317,16 @@ + + + + + + + + @@ -12605,7 +13343,7 @@ - + @@ -12618,6 +13356,8 @@ + + @@ -12626,9 +13366,14 @@ + + + + + @@ -12661,6 +13406,7 @@ + @@ -12677,6 +13423,7 @@ + @@ -12688,6 +13435,9 @@ + + + @@ -12708,7 +13458,7 @@ - + @@ -12717,11 +13467,10 @@ + - - @@ -12730,6 +13479,9 @@ + + + @@ -12785,7 +13537,7 @@ - + @@ -12793,7 +13545,11 @@ + + + + @@ -12803,6 +13559,7 @@ + @@ -12825,6 +13582,7 @@ + @@ -12837,6 +13595,7 @@ + @@ -12849,7 +13608,6 @@ - @@ -12885,6 +13643,8 @@ + + @@ -12893,6 +13653,9 @@ + + + @@ -12948,12 +13711,15 @@ + + - + + - + @@ -12962,23 +13728,27 @@ + + + - + + @@ -12996,6 +13766,7 @@ + @@ -13055,6 +13826,9 @@ + + + @@ -13062,7 +13836,6 @@ - @@ -13090,13 +13863,18 @@ + + + + + @@ -13106,15 +13884,20 @@ + + + + + @@ -13125,13 +13908,14 @@ - + + @@ -13139,9 +13923,15 @@ + + + + + + @@ -13167,8 +13957,10 @@ + + @@ -13182,7 +13974,6 @@ - @@ -13204,6 +13995,9 @@ + + + @@ -13251,19 +14045,30 @@ + + + + + + + + + + + @@ -13332,6 +14137,9 @@ + + + @@ -13349,6 +14157,7 @@ + @@ -13374,6 +14183,7 @@ + @@ -13395,7 +14205,7 @@ - + @@ -13429,6 +14239,9 @@ + + + @@ -13450,6 +14263,7 @@ + @@ -13487,23 +14301,34 @@ + + + + + + + + + + + + - @@ -13525,6 +14350,7 @@ + @@ -13533,12 +14359,9 @@ - - - @@ -13549,6 +14372,7 @@ + @@ -13593,6 +14417,15 @@ + + + + + + + + + @@ -13609,6 +14442,7 @@ + @@ -13621,13 +14455,13 @@ + - - + @@ -13643,6 +14477,7 @@ + @@ -13652,6 +14487,7 @@ + @@ -13669,6 +14505,9 @@ + + + @@ -13681,39 +14520,18 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -13772,6 +14590,9 @@ + + + @@ -13792,12 +14613,15 @@ + + + - + @@ -13823,6 +14647,7 @@ + @@ -13834,6 +14659,9 @@ + + + @@ -13850,7 +14678,6 @@ - @@ -13861,6 +14688,10 @@ + + + + @@ -13868,6 +14699,7 @@ + @@ -13889,6 +14721,8 @@ + + @@ -13920,8 +14754,12 @@ + + + + @@ -13936,9 +14774,11 @@ + + @@ -13946,6 +14786,8 @@ + + @@ -13968,6 +14810,7 @@ + @@ -13979,21 +14822,23 @@ + + - + @@ -14007,6 +14852,8 @@ + + @@ -14064,6 +14911,10 @@ + + + + @@ -14082,7 +14933,9 @@ + + @@ -14156,10 +15009,16 @@ + + + + + + @@ -14175,6 +15034,9 @@ + + + @@ -14203,8 +15065,11 @@ - + + + + @@ -14227,6 +15092,9 @@ + + + @@ -14242,6 +15110,7 @@ + @@ -14250,7 +15119,9 @@ - + + + @@ -14259,7 +15130,7 @@ - + @@ -14269,35 +15140,35 @@ + + + + + + + + + + + + - - - - - - - - - - - - - - + + @@ -14308,6 +15179,10 @@ + + + + @@ -14339,7 +15214,15 @@ + + + + + + + + @@ -14353,6 +15236,14 @@ + + + + + + + + @@ -14399,8 +15290,11 @@ + + + - + @@ -14421,9 +15315,16 @@ + + + + + + + @@ -14442,9 +15343,12 @@ + + + @@ -14467,6 +15371,10 @@ + + + + @@ -14475,9 +15383,9 @@ + - @@ -14514,6 +15422,8 @@ + + @@ -14547,12 +15457,18 @@ + + + + + + @@ -14571,6 +15487,10 @@ + + + + @@ -14582,17 +15502,23 @@ - + + - + + + + + + @@ -14603,6 +15529,7 @@ + @@ -14634,12 +15561,19 @@ + + + + + + + @@ -14651,12 +15585,15 @@ + + + + - @@ -14687,8 +15624,11 @@ + + + @@ -14715,6 +15655,9 @@ + + + @@ -14740,6 +15683,10 @@ + + + + @@ -14760,7 +15707,11 @@ + + + + @@ -14770,16 +15721,21 @@ + + + + + @@ -14798,20 +15754,25 @@ + + + + + - + @@ -14836,6 +15797,7 @@ + @@ -14855,7 +15817,7 @@ - + @@ -14865,11 +15827,12 @@ + + - @@ -14878,8 +15841,12 @@ + + + + @@ -14892,6 +15859,7 @@ + @@ -14902,11 +15870,13 @@ - + - + + + @@ -14915,21 +15885,25 @@ + + + - + + + - @@ -14942,22 +15916,35 @@ + + + + + + + + + + + + + @@ -14969,9 +15956,12 @@ + - + + + @@ -14992,6 +15982,7 @@ + @@ -15009,6 +16000,9 @@ + + + @@ -15020,6 +16014,9 @@ + + + @@ -15049,6 +16046,7 @@ + @@ -15071,6 +16069,8 @@ + + @@ -15095,6 +16095,10 @@ + + + + @@ -15133,7 +16137,7 @@ - + @@ -15165,8 +16169,11 @@ - + + + + @@ -15176,6 +16183,7 @@ + @@ -15183,8 +16191,17 @@ + + + + + + + + + @@ -15211,10 +16228,16 @@ + + + + + + @@ -15237,6 +16260,7 @@ + @@ -15277,6 +16301,7 @@ + @@ -15301,8 +16326,8 @@ + - @@ -15321,6 +16346,7 @@ + @@ -15369,6 +16395,13 @@ + + + + + + + @@ -15378,13 +16411,14 @@ - + + @@ -15402,6 +16436,15 @@ + + + + + + + + + @@ -15427,6 +16470,7 @@ + @@ -15435,12 +16479,12 @@ - + @@ -15464,6 +16508,7 @@ + @@ -15473,7 +16518,6 @@ - @@ -15491,6 +16535,7 @@ + @@ -15555,6 +16600,7 @@ + @@ -15570,8 +16616,12 @@ + + + + @@ -15579,14 +16629,17 @@ + + + @@ -15594,17 +16647,23 @@ - - + + - + + + + - + + + + @@ -15620,6 +16679,9 @@ + + + @@ -15628,13 +16690,12 @@ + - - @@ -15647,6 +16708,9 @@ + + + @@ -15654,6 +16718,8 @@ + + @@ -15682,6 +16748,7 @@ + @@ -15693,36 +16760,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -15773,8 +16810,8 @@ + - @@ -15806,14 +16843,20 @@ - + + + + + + + @@ -15870,8 +16913,11 @@ + + + @@ -15884,7 +16930,7 @@ - + @@ -15894,6 +16940,7 @@ + @@ -15908,6 +16955,8 @@ + + @@ -15962,6 +17011,7 @@ + @@ -15970,11 +17020,13 @@ + + @@ -15993,11 +17045,12 @@ - - + + + @@ -16019,18 +17072,8 @@ - - - - - - - - - - - - + + @@ -16040,18 +17083,29 @@ + + + + + + + + + + + - + @@ -16073,6 +17127,7 @@ + @@ -16088,6 +17143,7 @@ + @@ -16114,11 +17170,19 @@ + + + + + + - + + + @@ -16139,9 +17203,13 @@ + + + + @@ -16153,6 +17221,8 @@ + + @@ -16160,6 +17230,8 @@ + + @@ -16174,6 +17246,7 @@ + @@ -16186,6 +17259,11 @@ + + + + + @@ -16194,6 +17272,9 @@ + + + @@ -16208,6 +17289,7 @@ + @@ -16236,6 +17318,7 @@ + @@ -16310,7 +17393,7 @@ - + @@ -16325,37 +17408,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -16425,6 +17477,8 @@ + + @@ -16439,6 +17493,8 @@ + + @@ -16455,9 +17511,9 @@ - + @@ -16476,22 +17532,24 @@ + - + + - + @@ -16502,7 +17560,7 @@ - + @@ -16518,6 +17576,10 @@ + + + + @@ -16529,6 +17591,7 @@ + @@ -16561,11 +17624,18 @@ + + + + + + + @@ -16603,7 +17673,7 @@ - + @@ -16611,8 +17681,8 @@ + - @@ -16645,6 +17715,9 @@ + + + @@ -16653,13 +17726,17 @@ + + + + @@ -16672,15 +17749,28 @@ - + + + + + + + + + + + + + + @@ -16690,6 +17780,9 @@ + + + @@ -16701,6 +17794,9 @@ + + + @@ -16758,23 +17854,30 @@ + + + + + + + + - @@ -16789,7 +17892,7 @@ - + @@ -16839,16 +17942,25 @@ + + + + - + + + + + + @@ -16873,7 +17985,7 @@ - + @@ -16888,13 +18000,19 @@ + - + + + + + + @@ -16919,16 +18037,21 @@ + + + + + + + + - - - @@ -16979,7 +18102,10 @@ - + + + + @@ -16993,6 +18119,9 @@ + + + @@ -17000,6 +18129,8 @@ + + @@ -17013,13 +18144,18 @@ + + + + + + - @@ -17032,6 +18168,10 @@ + + + + @@ -17065,7 +18205,11 @@ + + + + @@ -17099,11 +18243,15 @@ + + + + @@ -17130,11 +18278,13 @@ - + + + @@ -17160,6 +18310,7 @@ + @@ -17173,6 +18324,8 @@ + + @@ -17222,11 +18375,11 @@ + - @@ -17238,10 +18391,14 @@ + + + + @@ -17262,14 +18419,21 @@ + - + + + + + + + @@ -17303,7 +18467,6 @@ - @@ -17330,7 +18493,7 @@ - + @@ -17348,6 +18511,9 @@ + + + @@ -17371,6 +18537,7 @@ + @@ -17408,6 +18575,7 @@ + @@ -17415,27 +18583,30 @@ + + - + + + - + - - + @@ -17466,7 +18637,7 @@ - + @@ -17477,6 +18648,7 @@ + @@ -17511,7 +18683,7 @@ - + @@ -17519,9 +18691,18 @@ + + + + + + + + + @@ -17540,6 +18721,7 @@ + @@ -17551,36 +18733,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -17588,10 +18746,12 @@ - + + + @@ -17601,9 +18761,10 @@ + - + @@ -17625,7 +18786,9 @@ + + @@ -17660,7 +18823,7 @@ - + @@ -17677,15 +18840,17 @@ + + - + @@ -17695,7 +18860,7 @@ - + @@ -17712,6 +18877,8 @@ + + @@ -17728,6 +18895,9 @@ + + + @@ -17742,15 +18912,25 @@ + + + + + + + + + + @@ -17774,8 +18954,11 @@ + + + - + @@ -17787,6 +18970,9 @@ + + + @@ -17810,6 +18996,9 @@ + + + @@ -17820,9 +19009,10 @@ + - + @@ -17833,29 +19023,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -17864,6 +19031,7 @@ + @@ -17919,13 +19087,22 @@ - + + + + + + - + + + + + @@ -17964,6 +19141,9 @@ + + + @@ -17971,8 +19151,14 @@ + + + + + + @@ -18003,6 +19189,20 @@ + + + + + + + + + + + + + + @@ -18020,7 +19220,7 @@ - + @@ -18039,9 +19239,11 @@ + + @@ -18070,7 +19272,7 @@ - + @@ -18079,6 +19281,7 @@ + @@ -18141,6 +19344,7 @@ + @@ -18150,6 +19354,7 @@ + @@ -18159,27 +19364,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -18195,9 +19379,8 @@ + - - @@ -18211,7 +19394,7 @@ - + @@ -18222,16 +19405,14 @@ - - + - @@ -18246,9 +19427,13 @@ + + + + - + @@ -18272,6 +19457,7 @@ + @@ -18296,10 +19482,12 @@ + + @@ -18319,12 +19507,12 @@ + - @@ -18332,23 +19520,30 @@ + + + + + + + - + - + @@ -18360,27 +19555,9 @@ - - - - - - - - - - - - - - - - - - - - - + + + @@ -18395,10 +19572,13 @@ + + + @@ -18412,11 +19592,13 @@ + + @@ -18424,13 +19606,17 @@ - + + + + + @@ -18440,6 +19626,10 @@ + + + + @@ -18462,17 +19652,19 @@ + - + + @@ -18494,38 +19686,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -18533,68 +19693,91 @@ + + - - + + + + + + + + + + + + + + + + + + + + + + + @@ -18612,6 +19795,9 @@ + + + @@ -18678,7 +19864,6 @@ - @@ -18700,12 +19885,12 @@ + - @@ -18716,10 +19901,15 @@ + + + + + @@ -18884,6 +20074,9 @@ + + + @@ -18896,8 +20089,8 @@ - - + + @@ -18906,6 +20099,9 @@ + + + @@ -18926,11 +20122,11 @@ - - + + - - + + @@ -18959,6 +20155,9 @@ + + + @@ -19003,6 +20202,12 @@ + + + + + + @@ -19014,14 +20219,17 @@ + - + + + @@ -19069,13 +20277,19 @@ + + + + + + - + @@ -19086,6 +20300,10 @@ + + + + @@ -19093,6 +20311,9 @@ + + + @@ -19123,26 +20344,28 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/parsedecl.py b/doc/parsedecl.py index 31457011..56305c8d 100755 --- a/doc/parsedecl.py +++ b/doc/parsedecl.py @@ -450,196 +450,102 @@ def insertComment(name, title, value, id): nbcomments = nbcomments + 1 +import libxml2 import os -import xmllib -try: - import sgmlop -except ImportError: - sgmlop = None # accelerator not available - -debug = 0 - -if sgmlop: - class FastParser: - """sgmlop based XML parser. this is typically 15x faster - than SlowParser...""" - - def __init__(self, target): - - # setup callbacks - self.finish_starttag = target.start - self.finish_endtag = target.end - self.handle_data = target.data - - # activate parser - self.parser = sgmlop.XMLParser() - self.parser.register(self) - self.feed = self.parser.feed - self.entity = { - "amp": "&", "gt": ">", "lt": "<", - "apos": "'", "quot": '"' - } - - def close(self): - try: - self.parser.close() - finally: - self.parser = self.feed = None # nuke circular reference - - def handle_entityref(self, entity): - # entity - try: - self.handle_data(self.entity[entity]) - except KeyError: - self.handle_data("&%s;" % entity) - -else: - FastParser = None -class SlowParser(xmllib.XMLParser): - """slow but safe standard parser, based on the XML parser in - Python's standard library.""" +def analyzeXMLDescriptionRow(doc, desc, id, row): + if doc == None or desc == None or id == None or row == None: + return + ctxt = doc.xpathNewContext() + ctxt.setContextNode(row) + param = ctxt.xpathEval("entry[1]/parameter") + entries = ctxt.xpathEval("entry") + if param == []: + is_param = 0 + name = None + else: + name = param[0].content + is_param = 1 + str = entries[1].content + str = string.replace(str, '\n', ' ') + str = string.replace(str, '\r', ' ') + str = string.replace(str, ' ', ' ') + str = string.replace(str, ' ', ' ') + str = string.replace(str, ' ', ' ') + while len(str) >= 1 and str[0] == ' ': + str=str[1:] - def __init__(self, target): - self.unknown_starttag = target.start - self.handle_data = target.data - self.unknown_endtag = target.end - xmllib.XMLParser.__init__(self) + insertParameterComment(id, name, str, is_param) -def getparser(target = None): - # get the fastest available parser, and attach it to an - # unmarshalling object. return both objects. - if target == None: - target = docParser() - if FastParser: - return FastParser(target), target - return SlowParser(target), target -class docParser: - def __init__(self): - self._methodname = None - self._data = [] - self.id = None - self.title = None - self.descr = None - self.string = None - def close(self): - if debug: - print "close" +def analyzeXMLDescription(doc, desc): + if doc == None or desc == None: + return + ctxt = doc.xpathNewContext() + ctxt.setContextNode(desc) - def getmethodname(self): - return self._methodname + # + # get the function name + # + try: + title = ctxt.xpathEval("title")[0].content + except: + return + old_id = ctxt.xpathEval("string(title/anchor/@id)") + id = string.replace(title, '(', ' '); + id = string.replace(id, ')', ' '); + id = string.split(id) [0] - def data(self, text): - if debug: - print "data %s" % text - self._data.append(text) + # + # get the function comments + # + comment = "" + paras = ctxt.xpathEval("para") + for para in paras: + str = para.content + str = string.replace(str, '\n', ' ') + str = string.replace(str, '\r', ' ') + str = string.replace(str, ' ', ' ') + str = string.replace(str, ' ', ' ') + str = string.replace(str, ' ', ' ') + while len(str) >= 1 and str[0] == ' ': + str=str[1:] - def start(self, tag, attrs): - if debug: - print "start %s, %s" % (tag, attrs) - if tag == 'refsect2': - self.id = None - self.title = None - self.descr = None - self.string = None - self.type = None - self.in_parameter = 0 - self.is_parameter = 0 - self.parameter = None - self.parameter_info = None - self.entry = 0 - elif tag == 'para': - self._data = [] - elif tag == 'title': - self._data = [] - elif tag == 'tgroup': - self.in_parameter = 1 - elif tag == 'row': - self._data = [] - self.entry = 0 - elif tag == 'entry': - self.entry = self.entry + 1 - elif tag == 'parameter' and self.in_parameter == 1: - self._data = [] - elif tag == 'anchor' and self.id == None: - if attrs.has_key('id'): - self.orig_id = attrs['id'] - self.id = string.replace(self.orig_id, '-CAPS', '') - self.id = string.replace(self.id, '-', '_') + comment = comment + str - def end(self, tag): - if debug: - print "end %s" % tag - if tag == 'refsect2': - self.type = insertComment(self.id, self.title, self.string, - self.orig_id) - self.string = None - elif tag == 'row': - if self.parameter_info != None and self.parameter_info != '': - insertParameterComment(self.id, self.parameter, - self.parameter_info, self.is_parameter) - self.parameter_info = None - self.parameter = 0 - self.is_parameter = 0 - elif tag == 'parameter' and self.in_parameter == 1 and self.entry == 1: - str = '' - for c in self._data: - str = str + c - str = string.replace(str, '\n', ' ') - str = string.replace(str, '\r', ' ') - str = string.replace(str, ' ', ' ') - str = string.replace(str, ' ', ' ') - str = string.replace(str, ' ', ' ') - while len(str) >= 1 and str[0] == ' ': - str=str[1:] - self.parameter = str - self.is_parameter = 1 - self._data = [] - elif tag == 'para' or tag == 'entry': - str = '' - for c in self._data: - str = str + c - str = string.replace(str, '\n', ' ') - str = string.replace(str, '\r', ' ') - str = string.replace(str, ' ', ' ') - str = string.replace(str, ' ', ' ') - str = string.replace(str, ' ', ' ') - while len(str) >= 1 and str[0] == ' ': - str=str[1:] - if self.string == None: - self.string = str - elif self.in_parameter == 1: - self.parameter_info = str - self._data = [] - elif tag == 'title': - str = '' - for c in self._data: - str = str + c - str = string.replace(str, '\n', ' ') - str = string.replace(str, '\r', ' ') - str = string.replace(str, ' ', ' ') - str = string.replace(str, ' ', ' ') - str = string.replace(str, ' ', ' ') - while len(str) >= 1 and str[0] == ' ': - str=str[1:] - self.title = str + insertComment(id, title, comment, old_id) + + rows = ctxt.xpathEval("informaltable/tgroup/tbody/row") + for row in rows: + analyzeXMLDescriptionRow(doc, desc, id, row) + +def analyzeXMLDoc(doc): + if doc == None: + return + ctxt = doc.xpathNewContext() + descriptions = ctxt.xpathEval("//refsect2") + print len(descriptions) + for description in descriptions: + analyzeXMLDescription(doc, description) + +doc = libxml2.parseFile("xml/c14n.xml"); +analyzeXMLDoc(doc) +doc.freeDoc() xmlfiles = 0 filenames = os.listdir("xml") for filename in filenames: + print filename try: - f = open("xml/" + filename, 'r') - except IOError, msg: - print file, ":", msg + doc = libxml2.parseFile("xml/" + filename) + analyzeXMLDoc(doc) + doc.freeDoc() + xmlfiles = xmlfiles + 1 + except: + print "failed to parse XML description %s" % ("xml/" + filename) continue - data = f.read() - (parser, target) = getparser() - parser.feed(data) - parser.close() - xmlfiles = xmlfiles + 1 print "Parsed: %d XML files collexting %d comments" % (xmlfiles, nbcomments)