mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-28 00:21:53 +03:00
added --nonet option fixing #112803 by adding --nonet when calling
* xmllint.c doc/xmllint.xml: added --nonet option * doc/Makefile.am: fixing #112803 by adding --nonet when calling xsltproc or xmllint * doc/xmllint.xml doc/xmllint.1: also added --schema doc and rebuilt * HTMLparser.c: cleaned up the HTML parser context build when using an URL Daniel
This commit is contained in:
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
Tue May 13 18:10:38 EDT 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* xmllint.c doc/xmllint.xml: added --nonet option
|
||||||
|
* doc/Makefile.am: fixing #112803 by adding --nonet when calling
|
||||||
|
xsltproc or xmllint
|
||||||
|
* doc/xmllint.xml doc/xmllint.1: also added --schema doc and
|
||||||
|
rebuilt
|
||||||
|
* HTMLparser.c: cleaned up the HTML parser context build when
|
||||||
|
using an URL
|
||||||
|
|
||||||
Tue May 13 16:35:04 EDT 2003 Daniel Veillard <daniel@veillard.com>
|
Tue May 13 16:35:04 EDT 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* libxml.spec.in: added a comment about bug #112902
|
* libxml.spec.in: added a comment about bug #112902
|
||||||
|
31
HTMLparser.c
31
HTMLparser.c
@ -5348,6 +5348,7 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding)
|
|||||||
htmlParserCtxtPtr ctxt;
|
htmlParserCtxtPtr ctxt;
|
||||||
htmlParserInputPtr inputStream;
|
htmlParserInputPtr inputStream;
|
||||||
xmlParserInputBufferPtr buf;
|
xmlParserInputBufferPtr buf;
|
||||||
|
char *canonicFilename;
|
||||||
/* htmlCharEncoding enc; */
|
/* htmlCharEncoding enc; */
|
||||||
xmlChar *content, *content_line = (xmlChar *) "charset=";
|
xmlChar *content, *content_line = (xmlChar *) "charset=";
|
||||||
|
|
||||||
@ -5361,27 +5362,23 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding)
|
|||||||
}
|
}
|
||||||
memset(ctxt, 0, sizeof(htmlParserCtxt));
|
memset(ctxt, 0, sizeof(htmlParserCtxt));
|
||||||
htmlInitParserCtxt(ctxt);
|
htmlInitParserCtxt(ctxt);
|
||||||
inputStream = (htmlParserInputPtr) xmlMalloc(sizeof(htmlParserInput));
|
canonicFilename = (char *) xmlCanonicPath((const xmlChar *) filename);
|
||||||
if (inputStream == NULL) {
|
if (canonicFilename == NULL) {
|
||||||
xmlGenericError(xmlGenericErrorContext, "malloc failed\n");
|
if (xmlDefaultSAXHandler.error != NULL) {
|
||||||
xmlFree(ctxt);
|
xmlDefaultSAXHandler.error(NULL, "out of memory\n");
|
||||||
|
}
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
inputStream = xmlLoadExternalEntity(canonicFilename, NULL, ctxt);
|
||||||
|
xmlFree(canonicFilename);
|
||||||
|
if (inputStream == NULL) {
|
||||||
|
xmlFreeParserCtxt(ctxt);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
memset(inputStream, 0, sizeof(htmlParserInput));
|
|
||||||
|
|
||||||
inputStream->filename = (char *)
|
|
||||||
xmlCanonicPath((xmlChar *)filename);
|
|
||||||
inputStream->line = 1;
|
|
||||||
inputStream->col = 1;
|
|
||||||
inputStream->buf = buf;
|
|
||||||
inputStream->directory = NULL;
|
|
||||||
|
|
||||||
inputStream->base = inputStream->buf->buffer->content;
|
|
||||||
inputStream->cur = inputStream->buf->buffer->content;
|
|
||||||
inputStream->free = NULL;
|
|
||||||
|
|
||||||
inputPush(ctxt, inputStream);
|
inputPush(ctxt, inputStream);
|
||||||
|
|
||||||
/* set encoding */
|
/* set encoding */
|
||||||
if (encoding) {
|
if (encoding) {
|
||||||
content = xmlMallocAtomic (xmlStrlen(content_line) + strlen(encoding) + 1);
|
content = xmlMallocAtomic (xmlStrlen(content_line) + strlen(encoding) + 1);
|
||||||
|
@ -33,27 +33,27 @@ web: $(PAGES) $(APIPAGES)
|
|||||||
|
|
||||||
$(PAGES): xml.html site.xsl
|
$(PAGES): xml.html site.xsl
|
||||||
-@(if [ -x $(bindir)/xsltproc ] ; then \
|
-@(if [ -x $(bindir)/xsltproc ] ; then \
|
||||||
$(bindir)/xsltproc --html $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/xml.html > index.html ; fi );
|
$(bindir)/xsltproc --nonet --html $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/xml.html > index.html ; fi );
|
||||||
-@(if [ -x $(bindir)/xmllint ] ; then \
|
-@(if [ -x $(bindir)/xmllint ] ; then \
|
||||||
$(bindir)/xmllint --valid --noout $(PAGES) ; fi );
|
$(bindir)/xmllint --nonet --valid --noout $(PAGES) ; fi );
|
||||||
|
|
||||||
$(top_srcdir)/NEWS: $(top_srcdir)/doc/news.xsl $(top_srcdir)/doc/news.html
|
$(top_srcdir)/NEWS: $(top_srcdir)/doc/news.xsl $(top_srcdir)/doc/news.html
|
||||||
-@(if [ -x $(bindir)/xsltproc ] ; then \
|
-@(if [ -x $(bindir)/xsltproc ] ; then \
|
||||||
$(bindir)/xsltproc $(top_srcdir)/doc/news.xsl $(top_srcdir)/doc/news.html > $(top_srcdir)/NEWS ; fi );
|
$(bindir)/xsltproc --nonet $(top_srcdir)/doc/news.xsl $(top_srcdir)/doc/news.html > $(top_srcdir)/NEWS ; fi );
|
||||||
|
|
||||||
libxml2.xsa: $(top_srcdir)/doc/xsa.xsl $(top_srcdir)/doc/news.html
|
libxml2.xsa: $(top_srcdir)/doc/xsa.xsl $(top_srcdir)/doc/news.html
|
||||||
-@(if [ -x $(bindir)/xsltproc ] ; then \
|
-@(if [ -x $(bindir)/xsltproc ] ; then \
|
||||||
$(bindir)/xsltproc $(top_srcdir)/doc/xsa.xsl $(top_srcdir)/doc/news.html > libxml2.xsa ; fi );
|
$(bindir)/xsltproc --nonet $(top_srcdir)/doc/xsa.xsl $(top_srcdir)/doc/news.html > libxml2.xsa ; fi );
|
||||||
|
|
||||||
$(APIPAGES): libxml2-refs.xml site.xsl api.xsl
|
$(APIPAGES): libxml2-refs.xml site.xsl api.xsl
|
||||||
-@(if [ -x $(bindir)/xsltproc ] ; then \
|
-@(if [ -x $(bindir)/xsltproc ] ; then \
|
||||||
$(bindir)/xsltproc --html $(top_srcdir)/doc/api.xsl $(top_srcdir)/doc/xml.html ; fi );
|
$(bindir)/xsltproc --nonet --html $(top_srcdir)/doc/api.xsl $(top_srcdir)/doc/xml.html ; fi );
|
||||||
|
|
||||||
xmllint.1: xmllint.xml
|
xmllint.1: xmllint.xml
|
||||||
-@(xsltproc xmllint.xml)
|
-@(xsltproc --nonet xmllint.xml)
|
||||||
|
|
||||||
xmlcatalog.1: xmlcatalog_man.xml
|
xmlcatalog.1: xmlcatalog_man.xml
|
||||||
-@(xsltproc xmlcatalog_man.xml)
|
-@(xsltproc --nonet xmlcatalog_man.xml)
|
||||||
|
|
||||||
scan:
|
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"
|
-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"
|
||||||
|
@ -31,7 +31,8 @@ xmllint \- command line XML tool
|
|||||||
| \fB--noblanks\fR | \fB--format\fR | \fB--testIO\fR | \fB--encode \fIencoding\fR\fR
|
| \fB--noblanks\fR | \fB--format\fR | \fB--testIO\fR | \fB--encode \fIencoding\fR\fR
|
||||||
| \fB--catalogs\fR | \fB--nocatalogs\fR | \fB--auto\fR | \fB--xinclude\fR
|
| \fB--catalogs\fR | \fB--nocatalogs\fR | \fB--auto\fR | \fB--xinclude\fR
|
||||||
| \fB--loaddtd\fR | \fB--dtdattr\fR | \fB--dropdtd\fR | \fB--stream\fR
|
| \fB--loaddtd\fR | \fB--dtdattr\fR | \fB--dropdtd\fR | \fB--stream\fR
|
||||||
| \fB--chkregister\fR | \fB--relaxng\fR] [\fBxmlfile\fR]
|
| \fB--chkregister\fR | \fB--relaxng\fR | \fB--schema\fR | \fB--nonet\fR]
|
||||||
|
[\fBxmlfile\fR]
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
.SH "INTRODUCTION"
|
.SH "INTRODUCTION"
|
||||||
@ -188,6 +189,14 @@ Turn on node registration. Useful for developeres testing libxml2 node tracking
|
|||||||
\fB--relaxng\fR \fIschema\fR
|
\fB--relaxng\fR \fIschema\fR
|
||||||
Use RelaxNG file named \fIschema\fR for validation.
|
Use RelaxNG file named \fIschema\fR for validation.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
\fB--schema\fR \fIschema\fR
|
||||||
|
Use a W3C XML Schema file named \fIschema\fR for validation.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
\fB--nonet\fR
|
||||||
|
Do not use the Internet to fetch DTD's or entities.
|
||||||
|
|
||||||
.SH "SHELL"
|
.SH "SHELL"
|
||||||
|
|
||||||
.PP
|
.PP
|
||||||
|
@ -79,6 +79,8 @@
|
|||||||
<arg>--stream</arg>
|
<arg>--stream</arg>
|
||||||
<arg>--chkregister</arg>
|
<arg>--chkregister</arg>
|
||||||
<arg>--relaxng</arg>
|
<arg>--relaxng</arg>
|
||||||
|
<arg>--schema</arg>
|
||||||
|
<arg>--nonet</arg>
|
||||||
</group>
|
</group>
|
||||||
<arg><option><replaceable>xmlfile</replaceable></option></arg>
|
<arg><option><replaceable>xmlfile</replaceable></option></arg>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
@ -441,6 +443,19 @@
|
|||||||
validation.</simpara>
|
validation.</simpara>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--schema</option> <replaceable>schema</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<simpara>Use a W3C XML Schema file named <replaceable>schema</replaceable> for validation.</simpara>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<option>--nonet</option></term>
|
||||||
|
<listitem>
|
||||||
|
<simpara>Do not use the Internet to fetch DTD's or entities.</simpara>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
@ -1260,6 +1260,7 @@ static void usage(const char *name) {
|
|||||||
printf("\t--recover : output what was parsable on broken XML documents\n");
|
printf("\t--recover : output what was parsable on broken XML documents\n");
|
||||||
printf("\t--noent : substitute entity references by their value\n");
|
printf("\t--noent : substitute entity references by their value\n");
|
||||||
printf("\t--noout : don't output the result tree\n");
|
printf("\t--noout : don't output the result tree\n");
|
||||||
|
printf("\t--nonet : refuse to fetch DTDs or entities over network\n");
|
||||||
printf("\t--htmlout : output results as HTML\n");
|
printf("\t--htmlout : output results as HTML\n");
|
||||||
printf("\t--nowrap : do not put HTML doc wrapper\n");
|
printf("\t--nowrap : do not put HTML doc wrapper\n");
|
||||||
printf("\t--valid : validate the document in addition to std well-formed check\n");
|
printf("\t--valid : validate the document in addition to std well-formed check\n");
|
||||||
@ -1513,6 +1514,9 @@ main(int argc, char **argv) {
|
|||||||
schema = argv[i];
|
schema = argv[i];
|
||||||
noent++;
|
noent++;
|
||||||
#endif
|
#endif
|
||||||
|
} else if ((!strcmp(argv[i], "-nonet")) ||
|
||||||
|
(!strcmp(argv[i], "--nonet"))) {
|
||||||
|
xmlSetExternalEntityLoader(xmlNoNetExternalEntityLoader);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Unknown option %s\n", argv[i]);
|
fprintf(stderr, "Unknown option %s\n", argv[i]);
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
|
Reference in New Issue
Block a user