diff --git a/ChangeLog b/ChangeLog index 853447b0..5b9df468 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Aug 31 11:34:04 CEST 2004 Daniel Veillard + + * Makefile.am: also produce a tar ball with just the sources + * xmllint.c: added --path option and --load-trace options to + xmllint, RFE #147740 based on xsltproc versions + * doc/xmllint.* doc/*: updated the man page and rebuilt + Tue Aug 31 10:37:23 CEST 2004 Daniel Veillard * xmlschemastypes.c: "" is a valid hexbinary string dixit xmlschema-dev diff --git a/Makefile.am b/Makefile.am index 29723661..4b3affd8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -978,11 +978,14 @@ dist-hook: cleanup libxml2.spec -cp libxml2.spec $(distdir) (cd $(srcdir) ; tar -cf - --exclude CVS win32 macos vms test result SAXresult ) | (cd $(distdir); tar xf -) +dist-source: distdir + $(AMTAR) -chof - --exclude test --exclude result $(distdir) | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-sources+"`.tar.gz + cleantar: @(rm -f libxml*.tar.gz COPYING.LIB) rpm: cleanup cleantar - @(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz) + @(unset CDPATH ; $(MAKE) dist-source dist && rpmbuild -ta $(distdir).tar.gz) ## We create xml2Conf.sh here and not from configure because we want ## to get the paths expanded correctly. Macros like srcdir are given diff --git a/doc/APIfiles.html b/doc/APIfiles.html index 2b842c57..97efe033 100644 --- a/doc/APIfiles.html +++ b/doc/APIfiles.html @@ -2068,6 +2068,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAP_IMPORT_SCHEMA_NOT_URI
XML_SCHEMAP_INCLUDE_SCHEMA_NOT_URI
XML_SCHEMAP_INCLUDE_SCHEMA_NO_URI
+XML_SCHEMAP_INTERNAL
XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE
XML_SCHEMAP_INVALID_ATTR_COMBINATION
XML_SCHEMAP_INVALID_ATTR_INLINE_COMBINATION
@@ -2087,6 +2088,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAP_NOTATION_NO_NAME
XML_SCHEMAP_NOTHING_TO_PARSE
XML_SCHEMAP_NOTYPE_NOREF
+XML_SCHEMAP_NOT_DETERMINISTIC
XML_SCHEMAP_NOT_SCHEMA
XML_SCHEMAP_NO_XMLNS
XML_SCHEMAP_NO_XSI
@@ -2175,13 +2177,39 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAV_ATTRINVALID
XML_SCHEMAV_ATTRUNKNOWN
XML_SCHEMAV_CONSTRUCT
+XML_SCHEMAV_CVC_ATTRIBUTE_1
+XML_SCHEMAV_CVC_ATTRIBUTE_2
+XML_SCHEMAV_CVC_ATTRIBUTE_3
+XML_SCHEMAV_CVC_ATTRIBUTE_4
XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1
XML_SCHEMAV_CVC_COMPLEX_TYPE_2_2
XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3
XML_SCHEMAV_CVC_COMPLEX_TYPE_2_4
+XML_SCHEMAV_CVC_COMPLEX_TYPE_3_1
+XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1
+XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2
+XML_SCHEMAV_CVC_COMPLEX_TYPE_4
+XML_SCHEMAV_CVC_COMPLEX_TYPE_5_1
+XML_SCHEMAV_CVC_COMPLEX_TYPE_5_2
XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1
XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2
XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3
+XML_SCHEMAV_CVC_ELT_1
+XML_SCHEMAV_CVC_ELT_2
+XML_SCHEMAV_CVC_ELT_3_1
+XML_SCHEMAV_CVC_ELT_3_2_1
+XML_SCHEMAV_CVC_ELT_3_2_2
+XML_SCHEMAV_CVC_ELT_4_1
+XML_SCHEMAV_CVC_ELT_4_2
+XML_SCHEMAV_CVC_ELT_4_3
+XML_SCHEMAV_CVC_ELT_5_1_1
+XML_SCHEMAV_CVC_ELT_5_1_2
+XML_SCHEMAV_CVC_ELT_5_2_1
+XML_SCHEMAV_CVC_ELT_5_2_2_1
+XML_SCHEMAV_CVC_ELT_5_2_2_2_1
+XML_SCHEMAV_CVC_ELT_5_2_2_2_2
+XML_SCHEMAV_CVC_ELT_6
+XML_SCHEMAV_CVC_ELT_7
XML_SCHEMAV_CVC_ENUMERATION_VALID
XML_SCHEMAV_CVC_FACET_VALID
XML_SCHEMAV_CVC_FRACTIONDIGITS_VALID
@@ -2196,7 +2224,9 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAV_CVC_TOTALDIGITS_VALID
XML_SCHEMAV_CVC_TYPE_3_1_1
XML_SCHEMAV_CVC_TYPE_3_1_2
+XML_SCHEMAV_DOCUMENT_ELEMENT_MISSING
XML_SCHEMAV_ELEMCONT
+XML_SCHEMAV_ELEMENT_CONTENT
XML_SCHEMAV_EXTRACONTENT
XML_SCHEMAV_FACET
XML_SCHEMAV_HAVEDEFAULT
diff --git a/doc/APIsymbols.html b/doc/APIsymbols.html index ed1a57a2..813c48a9 100644 --- a/doc/APIsymbols.html +++ b/doc/APIsymbols.html @@ -757,6 +757,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAP_IMPORT_SCHEMA_NOT_URI
XML_SCHEMAP_INCLUDE_SCHEMA_NOT_URI
XML_SCHEMAP_INCLUDE_SCHEMA_NO_URI
+XML_SCHEMAP_INTERNAL
XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE
XML_SCHEMAP_INVALID_ATTR_COMBINATION
XML_SCHEMAP_INVALID_ATTR_INLINE_COMBINATION
@@ -776,6 +777,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAP_NOTATION_NO_NAME
XML_SCHEMAP_NOTHING_TO_PARSE
XML_SCHEMAP_NOTYPE_NOREF
+XML_SCHEMAP_NOT_DETERMINISTIC
XML_SCHEMAP_NOT_SCHEMA
XML_SCHEMAP_NO_XMLNS
XML_SCHEMAP_NO_XSI
@@ -999,13 +1001,39 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAV_ATTRINVALID
XML_SCHEMAV_ATTRUNKNOWN
XML_SCHEMAV_CONSTRUCT
+XML_SCHEMAV_CVC_ATTRIBUTE_1
+XML_SCHEMAV_CVC_ATTRIBUTE_2
+XML_SCHEMAV_CVC_ATTRIBUTE_3
+XML_SCHEMAV_CVC_ATTRIBUTE_4
XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1
XML_SCHEMAV_CVC_COMPLEX_TYPE_2_2
XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3
XML_SCHEMAV_CVC_COMPLEX_TYPE_2_4
+XML_SCHEMAV_CVC_COMPLEX_TYPE_3_1
+XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1
+XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2
+XML_SCHEMAV_CVC_COMPLEX_TYPE_4
+XML_SCHEMAV_CVC_COMPLEX_TYPE_5_1
+XML_SCHEMAV_CVC_COMPLEX_TYPE_5_2
XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1
XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2
XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3
+XML_SCHEMAV_CVC_ELT_1
+XML_SCHEMAV_CVC_ELT_2
+XML_SCHEMAV_CVC_ELT_3_1
+XML_SCHEMAV_CVC_ELT_3_2_1
+XML_SCHEMAV_CVC_ELT_3_2_2
+XML_SCHEMAV_CVC_ELT_4_1
+XML_SCHEMAV_CVC_ELT_4_2
+XML_SCHEMAV_CVC_ELT_4_3
+XML_SCHEMAV_CVC_ELT_5_1_1
+XML_SCHEMAV_CVC_ELT_5_1_2
+XML_SCHEMAV_CVC_ELT_5_2_1
+XML_SCHEMAV_CVC_ELT_5_2_2_1
+XML_SCHEMAV_CVC_ELT_5_2_2_2_1
+XML_SCHEMAV_CVC_ELT_5_2_2_2_2
+XML_SCHEMAV_CVC_ELT_6
+XML_SCHEMAV_CVC_ELT_7
XML_SCHEMAV_CVC_ENUMERATION_VALID
XML_SCHEMAV_CVC_FACET_VALID
XML_SCHEMAV_CVC_FRACTIONDIGITS_VALID
@@ -1020,7 +1048,9 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAV_CVC_TOTALDIGITS_VALID
XML_SCHEMAV_CVC_TYPE_3_1_1
XML_SCHEMAV_CVC_TYPE_3_1_2
+XML_SCHEMAV_DOCUMENT_ELEMENT_MISSING
XML_SCHEMAV_ELEMCONT
+XML_SCHEMAV_ELEMENT_CONTENT
XML_SCHEMAV_EXTRACONTENT
XML_SCHEMAV_FACET
XML_SCHEMAV_HAVEDEFAULT
diff --git a/doc/html/libxml-xmlerror.html b/doc/html/libxml-xmlerror.html index dca45e87..6cfe7deb 100644 --- a/doc/html/libxml-xmlerror.html +++ b/doc/html/libxml-xmlerror.html @@ -612,6 +612,34 @@ void xmlStructuredErrorFunc (void * userD XML_SCHEMAV_CVC_COMPLEX_TYPE_2_2 = 1841 : 1841 XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3 = 1842 : 1842 XML_SCHEMAV_CVC_COMPLEX_TYPE_2_4 = 1843 : 1843 + XML_SCHEMAV_CVC_ELT_1 = 1844 : 1844 + XML_SCHEMAV_CVC_ELT_2 = 1845 : 1845 + XML_SCHEMAV_CVC_ELT_3_1 = 1846 + XML_SCHEMAV_CVC_ELT_3_2_1 = 1847 + XML_SCHEMAV_CVC_ELT_3_2_2 = 1848 + XML_SCHEMAV_CVC_ELT_4_1 = 1849 + XML_SCHEMAV_CVC_ELT_4_2 = 1850 + XML_SCHEMAV_CVC_ELT_4_3 = 1851 + XML_SCHEMAV_CVC_ELT_5_1_1 = 1852 + XML_SCHEMAV_CVC_ELT_5_1_2 = 1853 + XML_SCHEMAV_CVC_ELT_5_2_1 = 1854 + XML_SCHEMAV_CVC_ELT_5_2_2_1 = 1855 + XML_SCHEMAV_CVC_ELT_5_2_2_2_1 = 1856 + XML_SCHEMAV_CVC_ELT_5_2_2_2_2 = 1857 + XML_SCHEMAV_CVC_ELT_6 = 1858 + XML_SCHEMAV_CVC_ELT_7 = 1859 + XML_SCHEMAV_CVC_ATTRIBUTE_1 = 1860 + XML_SCHEMAV_CVC_ATTRIBUTE_2 = 1861 + XML_SCHEMAV_CVC_ATTRIBUTE_3 = 1862 + XML_SCHEMAV_CVC_ATTRIBUTE_4 = 1863 + XML_SCHEMAV_CVC_COMPLEX_TYPE_3_1 = 1864 + XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1 = 1865 + XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2 = 1866 + XML_SCHEMAV_CVC_COMPLEX_TYPE_4 = 1867 + XML_SCHEMAV_CVC_COMPLEX_TYPE_5_1 = 1868 + XML_SCHEMAV_CVC_COMPLEX_TYPE_5_2 = 1869 + XML_SCHEMAV_ELEMENT_CONTENT = 1870 : 1846 non-W3C + XML_SCHEMAV_DOCUMENT_ELEMENT_MISSING = 1871 : non-W3C XML_XPTR_UNKNOWN_SCHEME = 1900 XML_XPTR_CHILDSEQ_START = 1901 : 1901 XML_XPTR_EVAL_FAILED = 1902 : 1902 @@ -695,6 +723,8 @@ void xmlStructuredErrorFunc (void * userD XML_SCHEMAP_SRC_IMPORT_2 = 3066 XML_SCHEMAP_SRC_IMPORT_2_1 = 3067 XML_SCHEMAP_SRC_IMPORT_2_2 = 3068 + XML_SCHEMAP_INTERNAL = 3069 : non-W3C + XML_SCHEMAP_NOT_DETERMINISTIC = 3070 : non-W3C }

Function: initGenericErrorDefaultFunc

void	initGenericErrorDefaultFunc	(xmlGenericErrorFunc * handler)

Set or reset (if NULL) the default handler for generic errors to the builtin error function.

diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml index 9cfab209..adbb9a80 100644 --- a/doc/libxml2-api.xml +++ b/doc/libxml2-api.xml @@ -1800,6 +1800,7 @@ + @@ -1818,7 +1819,7 @@ - + @@ -1828,6 +1829,8 @@ + + @@ -1865,6 +1868,7 @@ + @@ -1879,6 +1883,7 @@ + @@ -1890,7 +1895,7 @@ - + @@ -1902,6 +1907,7 @@ + @@ -1909,11 +1915,11 @@ - + - + @@ -1948,6 +1954,8 @@ + + @@ -2056,6 +2064,7 @@ + @@ -2074,6 +2083,7 @@ + @@ -2113,9 +2123,13 @@ + + + + @@ -2132,16 +2146,18 @@ - + + + @@ -2159,7 +2175,7 @@ - + @@ -2168,13 +2184,17 @@ + + + + @@ -2183,7 +2203,7 @@ - + @@ -2244,11 +2264,14 @@ + + + @@ -2288,6 +2311,7 @@ + @@ -2300,6 +2324,7 @@ + @@ -2319,9 +2344,10 @@ + - + @@ -2344,10 +2370,12 @@ + + @@ -2360,7 +2388,7 @@ - + @@ -2373,13 +2401,14 @@ - + + @@ -2405,6 +2434,7 @@ + @@ -4694,6 +4724,7 @@ + @@ -4713,6 +4744,7 @@ + @@ -4874,13 +4906,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4895,7 +4953,9 @@ + + diff --git a/doc/libxml2-refs.xml b/doc/libxml2-refs.xml index 7c29986b..0e7ed3f9 100644 --- a/doc/libxml2-refs.xml +++ b/doc/libxml2-refs.xml @@ -751,6 +751,7 @@ + @@ -770,6 +771,7 @@ + @@ -993,13 +995,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1014,7 +1042,9 @@ + + @@ -3893,6 +3923,7 @@ + @@ -3912,6 +3943,7 @@ + @@ -4135,13 +4167,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4156,7 +4214,9 @@ + + @@ -11585,6 +11645,7 @@ + @@ -11604,6 +11665,7 @@ + @@ -11692,13 +11754,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -11713,7 +11801,9 @@ + + diff --git a/doc/xmllint.1 b/doc/xmllint.1 index 4a377d1b..7d2a5136 100644 --- a/doc/xmllint.1 +++ b/doc/xmllint.1 @@ -24,7 +24,7 @@ xmllint \- command line XML tool .ad l .hy 0 .HP 8 -\fBxmllint\fR [\fB\-\-version\fR | \fB\-\-debug\fR | \fB\-\-shell\fR | \fB\-\-debugent\fR | \fB\-\-copy\fR | \fB\-\-recover\fR | \fB\-\-noent\fR | \fB\-\-noout\fR | \fB\-\-nonet\fR | \fB\-\-htmlout\fR | \fB\-\-nowrap\fR | \fB\-\-valid\fR | \fB\-\-postvalid\fR | \fB\-\-dtdvalid\ \fIURL\fR\fR | \fB\-\-dtdvalidfpi\ \fIFPI\fR\fR | \fB\-\-timing\fR | \fB\-\-output\ \fIfile\fR\fR | \fB\-\-repeat\fR | \fB\-\-insert\fR | \fB\-\-compress\fR | \fB\-\-html\fR | \fB\-\-xmlout\fR | \fB\-\-push\fR | \fB\-\-memory\fR | \fB\-\-maxmem\ \fInbbytes\fR\fR | \fB\-\-nowarning\fR | \fB\-\-noblanks\fR | \fB\-\-nocdata\fR | \fB\-\-format\fR | \fB\-\-encode\ \fIencoding\fR\fR | \fB\-\-dropdtd\fR | \fB\-\-nsclean\fR | \fB\-\-testIO\fR | \fB\-\-catalogs\fR | \fB\-\-nocatalogs\fR | \fB\-\-auto\fR | \fB\-\-xinclude\fR | \fB\-\-noxincludenode\fR | \fB\-\-loaddtd\fR | \fB\-\-dtdattr\fR | \fB\-\-stream\fR | \fB\-\-walker\fR | \fB\-\-pattern\ \fIpatternvalue\fR\fR | \fB\-\-chkregister\fR | \fB\-\-relaxng\fR | \fB\-\-schema\fR | \fB\-\-c14n\fR] [\fB\fIxmlfile\fR\fR] +\fBxmllint\fR [\fB\-\-version\fR | \fB\-\-debug\fR | \fB\-\-shell\fR | \fB\-\-debugent\fR | \fB\-\-copy\fR | \fB\-\-recover\fR | \fB\-\-noent\fR | \fB\-\-noout\fR | \fB\-\-nonet\fR | \fB\-\-path\ \fIpaths\fR\fR | \fB\-\-load\-trace\fR | \fB\-\-htmlout\fR | \fB\-\-nowrap\fR | \fB\-\-valid\fR | \fB\-\-postvalid\fR | \fB\-\-dtdvalid\ \fIURL\fR\fR | \fB\-\-dtdvalidfpi\ \fIFPI\fR\fR | \fB\-\-timing\fR | \fB\-\-output\ \fIfile\fR\fR | \fB\-\-repeat\fR | \fB\-\-insert\fR | \fB\-\-compress\fR | \fB\-\-html\fR | \fB\-\-xmlout\fR | \fB\-\-push\fR | \fB\-\-memory\fR | \fB\-\-maxmem\ \fInbbytes\fR\fR | \fB\-\-nowarning\fR | \fB\-\-noblanks\fR | \fB\-\-nocdata\fR | \fB\-\-format\fR | \fB\-\-encode\ \fIencoding\fR\fR | \fB\-\-dropdtd\fR | \fB\-\-nsclean\fR | \fB\-\-testIO\fR | \fB\-\-catalogs\fR | \fB\-\-nocatalogs\fR | \fB\-\-auto\fR | \fB\-\-xinclude\fR | \fB\-\-noxincludenode\fR | \fB\-\-loaddtd\fR | \fB\-\-dtdattr\fR | \fB\-\-stream\fR | \fB\-\-walker\fR | \fB\-\-pattern\ \fIpatternvalue\fR\fR | \fB\-\-chkregister\fR | \fB\-\-relaxng\fR | \fB\-\-schema\fR | \fB\-\-c14n\fR] [\fB\fIxmlfile\fR\fR] .ad .hy @@ -78,6 +78,22 @@ Remove redundant namespace declarations\&. \fB\-\-noout\fR Suppress output\&. By default, xmllint outputs the result tree\&. +.TP +\fB\-\-nonet\fR +Do not use the Internet to fetch DTD's or entities\&. + +.TP +\fB\-\-nonet\fR +Do not use the Internet to fetch DTD's or entities\&. + +.TP +\fB\-\-path\fR \fIpaths\fR +Use the list (separated by space or column) of filesystem path specified by \fIpaths\fR to load DTDs or entities \&. + +.TP +\fB\-\-load\-trace\fR +Display to stderr all the documents loaded during the processing\&. + .TP \fB\-\-htmlout\fR Output results as an HTML file\&. This causes xmllint to output the necessary HTML tags surrounding the result tree output so the results can be displayed in a browser\&. diff --git a/doc/xmllint.xml b/doc/xmllint.xml index 798cccf8..e0ba0ee9 100644 --- a/doc/xmllint.xml +++ b/doc/xmllint.xml @@ -55,6 +55,8 @@ --noent --noout --nonet + --path paths + --load-trace --htmlout --nowrap --valid @@ -213,6 +215,44 @@ + + + + + Do not use the Internet to fetch DTD's or entities. + + + + + + + + + Do not use the Internet to fetch DTD's or entities. + + + + + + paths + + + Use the list (separated by space or column) of filesystem path + specified by paths to load + DTDs or entities . + + + + + + + + + Display to stderr all the documents loaded during the processing. + + + + diff --git a/python/libxml2class.txt b/python/libxml2class.txt index 661ed015..9e2496ed 100644 --- a/python/libxml2class.txt +++ b/python/libxml2class.txt @@ -644,6 +644,56 @@ Class xmlDoc(xmlNode) # functions from module xpointer xpointerNewContext() +Class xpathContext() + # accessors + contextDoc() + contextNode() + contextPosition() + contextSize() + function() + functionURI() + setContextDoc() + setContextNode() + + # functions from module python + registerXPathFunction() + + # functions from module xpath + xpathEval() + xpathEvalExpression() + xpathFreeContext() + + # functions from module xpathInternals + xpathNewParserContext() + xpathNsLookup() + xpathRegisterAllFunctions() + xpathRegisterNs() + xpathRegisteredFuncsCleanup() + xpathRegisteredNsCleanup() + xpathRegisteredVariablesCleanup() + xpathVariableLookup() + xpathVariableLookupNS() + + # functions from module xpointer + xpointerEval() + + +Class xmlAttribute(xmlNode) +Class catalog() + + # functions from module catalog + add() + catalogIsEmpty() + convertSGMLCatalog() + dump() + remove() + resolve() + resolvePublic() + resolveSystem() + resolveURI() + + +Class xmlElement(xmlNode) Class xmlAttr(xmlNode) @@ -662,12 +712,100 @@ Class xmlAttr(xmlNode) # functions from module valid removeID() removeRef() + + +Class xmlTextReader(xmlTextReaderCore) + + # functions from module xmlreader + AttributeCount() + BaseUri() + Close() + CurrentDoc() + CurrentNode() + Depth() + Expand() + GetAttribute() + GetAttributeNo() + GetAttributeNs() + GetParserProp() + GetRemainder() + HasAttributes() + HasValue() + IsDefault() + IsEmptyElement() + IsValid() + LocalName() + LookupNamespace() + MoveToAttribute() + MoveToAttributeNo() + MoveToAttributeNs() + MoveToElement() + MoveToFirstAttribute() + MoveToNextAttribute() + Name() + NamespaceUri() + NewDoc() + NewFd() + NewFile() + NewMemory() + NewWalker() + Next() + NextSibling() + NodeType() + Normalization() + Prefix() + Preserve() + QuoteChar() + Read() + ReadAttributeValue() + ReadInnerXml() + ReadOuterXml() + ReadState() + ReadString() + RelaxNGSetSchema() + RelaxNGValidate() + SetParserProp() + String() + Value() + XmlLang() Class xmlReg() # functions from module xmlregexp regexpExec() regexpIsDeterminist() regexpPrint() + + +Class xmlEntity(xmlNode) + + # functions from module parserInternals + handleEntity() +Class relaxNgSchema() + + # functions from module relaxng + relaxNGDump() + relaxNGDumpTree() + relaxNGNewValidCtxt() + + # functions from module xmlreader + RelaxNGSetSchema() +Class Schema() + + # functions from module xmlschemas + schemaDump() + schemaNewValidCtxt() +Class Error() + # accessors + code() + domain() + file() + level() + line() + message() + + # functions from module xmlerror + copyError() + resetError() Class relaxNgValidCtxt() # functions from module relaxng @@ -676,6 +814,73 @@ Class relaxNgValidCtxt() relaxNGValidatePopElement() relaxNGValidatePushCData() relaxNGValidatePushElement() +Class xpathParserContext() + # accessors + context() + + # functions from module xpathInternals + xpathAddValues() + xpathBooleanFunction() + xpathCeilingFunction() + xpathCompareValues() + xpathConcatFunction() + xpathContainsFunction() + xpathCountFunction() + xpathDivValues() + xpathEqualValues() + xpathErr() + xpathEvalExpr() + xpathFalseFunction() + xpathFloorFunction() + xpathFreeParserContext() + xpathIdFunction() + xpathLangFunction() + xpathLastFunction() + xpathLocalNameFunction() + xpathModValues() + xpathMultValues() + xpathNamespaceURIFunction() + xpathNextAncestor() + xpathNextAncestorOrSelf() + xpathNextAttribute() + xpathNextChild() + xpathNextDescendant() + xpathNextDescendantOrSelf() + xpathNextFollowing() + xpathNextFollowingSibling() + xpathNextNamespace() + xpathNextParent() + xpathNextPreceding() + xpathNextPrecedingSibling() + xpathNextSelf() + xpathNormalizeFunction() + xpathNotEqualValues() + xpathNotFunction() + xpathNumberFunction() + xpathParseNCName() + xpathParseName() + xpathPopBoolean() + xpathPopNumber() + xpathPopString() + xpathPositionFunction() + xpathRoot() + xpathRoundFunction() + xpathStartsWithFunction() + xpathStringFunction() + xpathStringLengthFunction() + xpathSubValues() + xpathSubstringAfterFunction() + xpathSubstringBeforeFunction() + xpathSubstringFunction() + xpathSumFunction() + xpathTranslateFunction() + xpathTrueFunction() + xpathValueFlipSign() + xpatherror() + + # functions from module xpointer + xpointerEvalRangePredicate() + xpointerRangeToFunction() Class parserCtxt(parserCtxtCore) @@ -783,94 +988,6 @@ Class xmlDtd(xmlNode) dtdElementDesc() dtdQAttrDesc() dtdQElementDesc() -Class relaxNgParserCtxt() - - # functions from module relaxng - relaxNGParse() - relaxParserSetFlag() -Class xpathParserContext() - # accessors - context() - - # functions from module xpathInternals - xpathAddValues() - xpathBooleanFunction() - xpathCeilingFunction() - xpathCompareValues() - xpathConcatFunction() - xpathContainsFunction() - xpathCountFunction() - xpathDivValues() - xpathEqualValues() - xpathErr() - xpathEvalExpr() - xpathFalseFunction() - xpathFloorFunction() - xpathFreeParserContext() - xpathIdFunction() - xpathLangFunction() - xpathLastFunction() - xpathLocalNameFunction() - xpathModValues() - xpathMultValues() - xpathNamespaceURIFunction() - xpathNextAncestor() - xpathNextAncestorOrSelf() - xpathNextAttribute() - xpathNextChild() - xpathNextDescendant() - xpathNextDescendantOrSelf() - xpathNextFollowing() - xpathNextFollowingSibling() - xpathNextNamespace() - xpathNextParent() - xpathNextPreceding() - xpathNextPrecedingSibling() - xpathNextSelf() - xpathNormalizeFunction() - xpathNotEqualValues() - xpathNotFunction() - xpathNumberFunction() - xpathParseNCName() - xpathParseName() - xpathPopBoolean() - xpathPopNumber() - xpathPopString() - xpathPositionFunction() - xpathRoot() - xpathRoundFunction() - xpathStartsWithFunction() - xpathStringFunction() - xpathStringLengthFunction() - xpathSubValues() - xpathSubstringAfterFunction() - xpathSubstringBeforeFunction() - xpathSubstringFunction() - xpathSumFunction() - xpathTranslateFunction() - xpathTrueFunction() - xpathValueFlipSign() - xpatherror() - - # functions from module xpointer - xpointerEvalRangePredicate() - xpointerRangeToFunction() -Class SchemaParserCtxt() - - # functions from module xmlschemas - schemaParse() -Class catalog() - - # functions from module catalog - add() - catalogIsEmpty() - convertSGMLCatalog() - dump() - remove() - resolve() - resolvePublic() - resolveSystem() - resolveURI() Class xmlNs(xmlNode) @@ -894,6 +1011,48 @@ Class xmlNs(xmlNode) # functions from module xpathInternals xpathNodeSetFreeNs() + + +Class inputBuffer(ioReadWrapper) + + # functions from module xmlIO + grow() + push() + read() + + # functions from module xmlreader + newTextReader() +Class relaxNgParserCtxt() + + # functions from module relaxng + relaxNGParse() + relaxParserSetFlag() + + +Class outputBuffer(ioWriteWrapper) + + # functions from module HTMLtree + htmlDocContentDumpFormatOutput() + htmlDocContentDumpOutput() + htmlNodeDumpFormatOutput() + htmlNodeDumpOutput() + + # functions from module tree + nodeDumpOutput() + saveFileTo() + saveFormatFileTo() + + # functions from module xmlIO + write() + writeString() +Class SchemaParserCtxt() + + # functions from module xmlschemas + schemaParse() +Class SchemaValidCtxt() + + # functions from module xmlschemas + schemaValidateDoc() Class xmlTextReaderLocator() # functions from module xmlreader @@ -924,162 +1083,3 @@ Class URI() parseURIReference() printURI() saveUri() - - -Class xmlAttribute(xmlNode) -Class xpathContext() - # accessors - contextDoc() - contextNode() - contextPosition() - contextSize() - function() - functionURI() - setContextDoc() - setContextNode() - - # functions from module python - registerXPathFunction() - - # functions from module xpath - xpathEval() - xpathEvalExpression() - xpathFreeContext() - - # functions from module xpathInternals - xpathNewParserContext() - xpathNsLookup() - xpathRegisterAllFunctions() - xpathRegisterNs() - xpathRegisteredFuncsCleanup() - xpathRegisteredNsCleanup() - xpathRegisteredVariablesCleanup() - xpathVariableLookup() - xpathVariableLookupNS() - - # functions from module xpointer - xpointerEval() - - -Class xmlElement(xmlNode) - - -Class xmlTextReader(xmlTextReaderCore) - - # functions from module xmlreader - AttributeCount() - BaseUri() - Close() - CurrentDoc() - CurrentNode() - Depth() - Expand() - GetAttribute() - GetAttributeNo() - GetAttributeNs() - GetParserProp() - GetRemainder() - HasAttributes() - HasValue() - IsDefault() - IsEmptyElement() - IsValid() - LocalName() - LookupNamespace() - MoveToAttribute() - MoveToAttributeNo() - MoveToAttributeNs() - MoveToElement() - MoveToFirstAttribute() - MoveToNextAttribute() - Name() - NamespaceUri() - NewDoc() - NewFd() - NewFile() - NewMemory() - NewWalker() - Next() - NextSibling() - NodeType() - Normalization() - Prefix() - Preserve() - QuoteChar() - Read() - ReadAttributeValue() - ReadInnerXml() - ReadOuterXml() - ReadState() - ReadString() - RelaxNGSetSchema() - RelaxNGValidate() - SetParserProp() - String() - Value() - XmlLang() - - -Class xmlEntity(xmlNode) - - # functions from module parserInternals - handleEntity() -Class Schema() - - # functions from module xmlschemas - schemaDump() - schemaNewValidCtxt() -Class Error() - # accessors - code() - domain() - file() - level() - line() - message() - - # functions from module xmlerror - copyError() - resetError() -Class relaxNgSchema() - - # functions from module relaxng - relaxNGDump() - relaxNGDumpTree() - relaxNGNewValidCtxt() - - # functions from module xmlreader - RelaxNGSetSchema() - - -Class inputBuffer(ioReadWrapper) - - # functions from module xmlIO - grow() - push() - read() - - # functions from module xmlreader - newTextReader() -Class SchemaValidCtxt() - - # functions from module xmlschemas - schemaValidateDoc() - - -Class outputBuffer(ioWriteWrapper) - - # functions from module HTMLtree - htmlDocContentDumpFormatOutput() - htmlDocContentDumpOutput() - htmlNodeDumpFormatOutput() - htmlNodeDumpOutput() - - # functions from module tree - nodeDumpOutput() - saveFileTo() - saveFormatFileTo() - - # functions from module xmlIO - write() - writeString() diff --git a/xmllint.c b/xmllint.c index b0dada35..a72fcca2 100644 --- a/xmllint.c +++ b/xmllint.c @@ -189,6 +189,115 @@ static xmlPatternPtr patternc = NULL; #endif static int options = 0; +/************************************************************************ + * * + * Entity loading control and customization. * + * * + ************************************************************************/ +#define MAX_PATHS 64 +static xmlChar *paths[MAX_PATHS + 1]; +static int nbpaths = 0; +static int load_trace = 0; + +static +void parsePath(const xmlChar *path) { + const xmlChar *cur; + + if (path == NULL) + return; + while (*path != 0) { + if (nbpaths >= MAX_PATHS) { + fprintf(stderr, "MAX_PATHS reached: too many paths\n"); + return; + } + cur = path; + while ((*cur == ' ') || (*cur == ':')) + cur++; + path = cur; + while ((*cur != 0) && (*cur != ' ') && (*cur != ':')) + cur++; + if (cur != path) { + paths[nbpaths] = xmlStrndup(path, cur - path); + if (paths[nbpaths] != NULL) + nbpaths++; + path = cur; + } + } +} + +xmlExternalEntityLoader defaultEntityLoader = NULL; + +static xmlParserInputPtr +xmllintExternalEntityLoader(const char *URL, const char *ID, + xmlParserCtxtPtr ctxt) { + xmlParserInputPtr ret; + warningSAXFunc warning = NULL; + + int i; + const char *lastsegment = URL; + const char *iter = URL; + + if (nbpaths > 0) { + while (*iter != 0) { + if (*iter == '/') + lastsegment = iter + 1; + iter++; + } + } + + if ((ctxt != NULL) && (ctxt->sax != NULL)) { + warning = ctxt->sax->warning; + ctxt->sax->warning = NULL; + } + + if (defaultEntityLoader != NULL) { + ret = defaultEntityLoader(URL, ID, ctxt); + if (ret != NULL) { + if (warning != NULL) + ctxt->sax->warning = warning; + if (load_trace) { + fprintf \ + (stderr, + "Loaded URL=\"%s\" ID=\"%s\"\n", + URL ? URL : "(null)", + ID ? ID : "(null)"); + } + return(ret); + } + } + for (i = 0;i < nbpaths;i++) { + xmlChar *newURL; + + newURL = xmlStrdup((const xmlChar *) paths[i]); + newURL = xmlStrcat(newURL, (const xmlChar *) "/"); + newURL = xmlStrcat(newURL, (const xmlChar *) lastsegment); + if (newURL != NULL) { + ret = defaultEntityLoader((const char *)newURL, ID, ctxt); + if (ret != NULL) { + if (warning != NULL) + ctxt->sax->warning = warning; + if (load_trace) { + fprintf \ + (stderr, + "Loaded URL=\"%s\" ID=\"%s\"\n", + newURL, + ID ? ID : "(null)"); + } + xmlFree(newURL); + return(ret); + } + xmlFree(newURL); + } + } + if (warning != NULL) { + ctxt->sax->warning = warning; + if (URL != NULL) + warning(ctxt, "failed to load external entity \"%s\"\n", URL); + else if (ID != NULL) + warning(ctxt, "failed to load external entity \"%s\"\n", ID); + } + return(NULL); +} /************************************************************************ * * * Memory allocation consumption debugging * @@ -1564,6 +1673,8 @@ static void usage(const char *name) { printf("\t--recover : output what was parsable on broken XML documents\n"); printf("\t--noent : substitute entity references by their value\n"); printf("\t--noout : don't output the result tree\n"); + printf("\t--path 'paths': provide a set of paths for resources\n"); + printf("\t--load-trace : print trace of all external entites loaded\n"); printf("\t--nonet : refuse to fetch DTDs or entities over network\n"); printf("\t--htmlout : output results as HTML\n"); printf("\t--nowrap : do not put HTML doc wrapper\n"); @@ -1922,6 +2033,13 @@ main(int argc, char **argv) { } else if ((!strcmp(argv[i], "-nonet")) || (!strcmp(argv[i], "--nonet"))) { options |= XML_PARSE_NONET; + } else if ((!strcmp(argv[i], "-load-trace")) || + (!strcmp(argv[i], "--load-trace"))) { + load_trace++; + } else if ((!strcmp(argv[i], "-path")) || + (!strcmp(argv[i], "--path"))) { + i++; + parsePath(BAD_CAST argv[i]); #ifdef LIBXML_PATTERN_ENABLED } else if ((!strcmp(argv[i], "-pattern")) || (!strcmp(argv[i], "--pattern"))) { @@ -1968,6 +2086,9 @@ main(int argc, char **argv) { } + defaultEntityLoader = xmlGetExternalEntityLoader(); + xmlSetExternalEntityLoader(xmllintExternalEntityLoader); + xmlLineNumbersDefault(1); if (loaddtd != 0) xmlLoadExtDtdDefaultValue |= XML_DETECT_IDS; @@ -2075,6 +2196,11 @@ main(int argc, char **argv) { (!strcmp(argv[i], "--dtdvalid"))) { i++; continue; + } + if ((!strcmp(argv[i], "-path")) || + (!strcmp(argv[i], "--path"))) { + i++; + continue; } if ((!strcmp(argv[i], "-dtdvalidfpi")) || (!strcmp(argv[i], "--dtdvalidfpi"))) {