mirror of
https://github.com/GNOME/libxml2.git
synced 2025-03-13 18:47:01 +08:00
rebuilt the API added the new options --nocdata and --nsclean to remove
* doc/libxml2-api.xml: rebuilt the API * xmllint.c doc/xmllint.1 doc/xmllint.xml: added the new options --nocdata and --nsclean to remove CDATA section and surperfluous namespace declarations * parser.c SAX2.c: implementation of the 2 new options Daniel
This commit is contained in:
parent
9475a352bd
commit
dca8cc79db
@ -1,3 +1,11 @@
|
||||
Fri Sep 26 15:50:44 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* doc/libxml2-api.xml: rebuilt the API
|
||||
* xmllint.c doc/xmllint.1 doc/xmllint.xml: added the new options
|
||||
--nocdata and --nsclean to remove CDATA section and surperfluous
|
||||
namespace declarations
|
||||
* parser.c SAX2.c: implementation of the 2 new options
|
||||
|
||||
Fri Sep 26 14:41:53 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* HTMLparser.c testHTML.c xmllint.c include/libxml/HTMLparser.h:
|
||||
|
6
SAX2.c
6
SAX2.c
@ -1608,9 +1608,11 @@ xmlSAX2TextNode(xmlParserCtxtPtr ctxt, const xmlChar *str, int len) {
|
||||
if (ctxt->dictNames) {
|
||||
xmlChar cur = str[len];
|
||||
|
||||
if ((len <= 3) && ((cur == '"') || (cur == '\'') || (cur == '<'))) {
|
||||
if ((len <= 3) && ((cur == '"') || (cur == '\'') ||
|
||||
((cur == '<') && (str[len + 1] != '!')))) {
|
||||
intern = xmlDictLookup(ctxt->dict, str, len);
|
||||
} else if (IS_BLANK(*str) && (len < 60) && (cur == '<')) {
|
||||
} else if (IS_BLANK(*str) && (len < 60) && (cur == '<') &&
|
||||
(str[len + 1] != '!')) {
|
||||
int i;
|
||||
|
||||
for (i = 1;i < len;i++) {
|
||||
|
@ -986,6 +986,11 @@
|
||||
<exports symbol='HTML_DEPRECATED'/>
|
||||
<exports symbol='HTML_INVALID'/>
|
||||
<exports symbol='HTML_NA'/>
|
||||
<exports symbol='HTML_PARSE_NOBLANKS'/>
|
||||
<exports symbol='HTML_PARSE_NOERROR'/>
|
||||
<exports symbol='HTML_PARSE_NONET'/>
|
||||
<exports symbol='HTML_PARSE_NOWARNING'/>
|
||||
<exports symbol='HTML_PARSE_PEDANTIC'/>
|
||||
<exports symbol='HTML_REQUIRED'/>
|
||||
<exports symbol='HTML_VALID'/>
|
||||
<exports symbol='UTF8ToHtml'/>
|
||||
@ -995,6 +1000,13 @@
|
||||
<exports symbol='htmlAutoCloseTag'/>
|
||||
<exports symbol='htmlCreateMemoryParserCtxt'/>
|
||||
<exports symbol='htmlCreatePushParserCtxt'/>
|
||||
<exports symbol='htmlCtxtReadDoc'/>
|
||||
<exports symbol='htmlCtxtReadFd'/>
|
||||
<exports symbol='htmlCtxtReadFile'/>
|
||||
<exports symbol='htmlCtxtReadIO'/>
|
||||
<exports symbol='htmlCtxtReadMemory'/>
|
||||
<exports symbol='htmlCtxtReset'/>
|
||||
<exports symbol='htmlCtxtUseOptions'/>
|
||||
<exports symbol='htmlDefaultSubelement'/>
|
||||
<exports symbol='htmlDocPtr'/>
|
||||
<exports symbol='htmlElemDesc'/>
|
||||
@ -1025,6 +1037,12 @@
|
||||
<exports symbol='htmlParserInput'/>
|
||||
<exports symbol='htmlParserInputPtr'/>
|
||||
<exports symbol='htmlParserNodeInfo'/>
|
||||
<exports symbol='htmlParserOption'/>
|
||||
<exports symbol='htmlReadDoc'/>
|
||||
<exports symbol='htmlReadFd'/>
|
||||
<exports symbol='htmlReadFile'/>
|
||||
<exports symbol='htmlReadIO'/>
|
||||
<exports symbol='htmlReadMemory'/>
|
||||
<exports symbol='htmlRequiredAttrs'/>
|
||||
<exports symbol='htmlSAXHandler'/>
|
||||
<exports symbol='htmlSAXHandlerPtr'/>
|
||||
@ -1059,11 +1077,13 @@
|
||||
<exports symbol='XML_PARSE_DTDLOAD'/>
|
||||
<exports symbol='XML_PARSE_DTDVALID'/>
|
||||
<exports symbol='XML_PARSE_NOBLANKS'/>
|
||||
<exports symbol='XML_PARSE_NOCDATA'/>
|
||||
<exports symbol='XML_PARSE_NODICT'/>
|
||||
<exports symbol='XML_PARSE_NOENT'/>
|
||||
<exports symbol='XML_PARSE_NOERROR'/>
|
||||
<exports symbol='XML_PARSE_NONET'/>
|
||||
<exports symbol='XML_PARSE_NOWARNING'/>
|
||||
<exports symbol='XML_PARSE_NSCLEAN'/>
|
||||
<exports symbol='XML_PARSE_PEDANTIC'/>
|
||||
<exports symbol='XML_PARSE_RECOVER'/>
|
||||
<exports symbol='XML_PARSE_SAX1'/>
|
||||
@ -2687,6 +2707,11 @@
|
||||
<enum name='HTML_DEPRECATED' file='HTMLparser' value='2' type='htmlStatus'/>
|
||||
<enum name='HTML_INVALID' file='HTMLparser' value='1' type='htmlStatus'/>
|
||||
<enum name='HTML_NA' file='HTMLparser' value='0' type='htmlStatus' info='something we don't check at all'/>
|
||||
<enum name='HTML_PARSE_NOBLANKS' file='HTMLparser' value='256' type='htmlParserOption' info='remove blank nodes'/>
|
||||
<enum name='HTML_PARSE_NOERROR' file='HTMLparser' value='32' type='htmlParserOption' info='suppress error reports'/>
|
||||
<enum name='HTML_PARSE_NONET' file='HTMLparser' value='2048' type='htmlParserOption' info=' Forbid network access'/>
|
||||
<enum name='HTML_PARSE_NOWARNING' file='HTMLparser' value='64' type='htmlParserOption' info='suppress warning reports'/>
|
||||
<enum name='HTML_PARSE_PEDANTIC' file='HTMLparser' value='128' type='htmlParserOption' info='pedantic error reporting'/>
|
||||
<enum name='HTML_REQUIRED' file='HTMLparser' value='12' type='htmlStatus' info=' VALID bit set so ( & HTML_VALID ) is TRUE'/>
|
||||
<enum name='HTML_VALID' file='HTMLparser' value='4' type='htmlStatus'/>
|
||||
<enum name='XLINK_ACTUATE_AUTO' file='xlink' value='1' type='xlinkActuate'/>
|
||||
@ -2913,11 +2938,13 @@
|
||||
<enum name='XML_PARSE_DTDLOAD' file='parser' value='4' type='xmlParserOption' info='load the external subset'/>
|
||||
<enum name='XML_PARSE_DTDVALID' file='parser' value='16' type='xmlParserOption' info='validate with the DTD'/>
|
||||
<enum name='XML_PARSE_NOBLANKS' file='parser' value='256' type='xmlParserOption' info='remove blank nodes'/>
|
||||
<enum name='XML_PARSE_NODICT' file='parser' value='4096' type='xmlParserOption' info=' Do not reuse the context dictionnary'/>
|
||||
<enum name='XML_PARSE_NOCDATA' file='parser' value='16384' type='xmlParserOption' info=' merge CDATA as text nodes'/>
|
||||
<enum name='XML_PARSE_NODICT' file='parser' value='4096' type='xmlParserOption' info='Do not reuse the context dictionnary'/>
|
||||
<enum name='XML_PARSE_NOENT' file='parser' value='2' type='xmlParserOption' info='substitute entities'/>
|
||||
<enum name='XML_PARSE_NOERROR' file='parser' value='32' type='xmlParserOption' info='suppress error reports'/>
|
||||
<enum name='XML_PARSE_NONET' file='parser' value='2048' type='xmlParserOption' info='Forbid network access'/>
|
||||
<enum name='XML_PARSE_NOWARNING' file='parser' value='64' type='xmlParserOption' info='suppress warning reports'/>
|
||||
<enum name='XML_PARSE_NSCLEAN' file='parser' value='8192' type='xmlParserOption' info='remove redundant namespaces declarations'/>
|
||||
<enum name='XML_PARSE_PEDANTIC' file='parser' value='128' type='xmlParserOption' info='pedantic error reporting'/>
|
||||
<enum name='XML_PARSE_RECOVER' file='parser' value='1' type='xmlParserOption' info='recover on errors'/>
|
||||
<enum name='XML_PARSE_SAX1' file='parser' value='512' type='xmlParserOption' info='use the SAX1 interface internally'/>
|
||||
@ -3131,6 +3158,7 @@ if necessary or NULL'/>
|
||||
<typedef name='htmlParserInput' file='HTMLparser' type='xmlParserInput'/>
|
||||
<typedef name='htmlParserInputPtr' file='HTMLparser' type='xmlParserInputPtr'/>
|
||||
<typedef name='htmlParserNodeInfo' file='HTMLparser' type='xmlParserNodeInfo'/>
|
||||
<typedef name='htmlParserOption' file='HTMLparser' type='enum'/>
|
||||
<typedef name='htmlSAXHandler' file='HTMLparser' type='xmlSAXHandler'/>
|
||||
<typedef name='htmlSAXHandlerPtr' file='HTMLparser' type='xmlSAXHandlerPtr'/>
|
||||
<typedef name='htmlStatus' file='HTMLparser' type='enum'/>
|
||||
@ -3498,7 +3526,8 @@ actually an xmlCharEncoding'/>
|
||||
<field name='pushTab' type='void * *' info=' array of data for push'/>
|
||||
<field name='attsDefault' type='xmlHashTablePtr' info=' defaulted attributes if any'/>
|
||||
<field name='attsSpecial' type='xmlHashTablePtr' info=' non-CDATA attributes if any'/>
|
||||
<field name='nsWellFormed' type='int' info='* Those fields are needed only for treaming parsing so far
|
||||
<field name='nsWellFormed' type='int' info=' is the document XML Nanespace okay'/>
|
||||
<field name='options' type='int' info='* Those fields are needed only for treaming parsing so far
|
||||
*'/>
|
||||
<field name='dictNames' type='int' info=' Use dictionary names for the tree'/>
|
||||
<field name='freeElemsNr' type='int' info=' number of freed element nodes'/>
|
||||
@ -4353,6 +4382,64 @@ actually an xmlCharEncoding'/>
|
||||
<arg name='filename' type='const char *' info='an optional file name or URI'/>
|
||||
<arg name='enc' type='xmlCharEncoding' info='an optional encoding'/>
|
||||
</function>
|
||||
<function name='htmlCtxtReadDoc' file='HTMLparser'>
|
||||
<info>parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context</info>
|
||||
<return type='htmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='ctxt' type='htmlParserCtxtPtr' info='an HTML parser context'/>
|
||||
<arg name='cur' type='const xmlChar *' info='a pointer to a zero terminated string'/>
|
||||
<arg name='URL' type='const char *' info='the base URL to use for the document'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of htmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='htmlCtxtReadFd' file='HTMLparser'>
|
||||
<info>parse an XML from a file descriptor and build a tree. This reuses the existing @ctxt parser context</info>
|
||||
<return type='htmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='ctxt' type='htmlParserCtxtPtr' info='an HTML parser context'/>
|
||||
<arg name='fd' type='int' info='an open file descriptor'/>
|
||||
<arg name='URL' type='const char *' info='the base URL to use for the document'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of htmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='htmlCtxtReadFile' file='HTMLparser'>
|
||||
<info>parse an XML file from the filesystem or the network. This reuses the existing @ctxt parser context</info>
|
||||
<return type='htmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='ctxt' type='htmlParserCtxtPtr' info='an HTML parser context'/>
|
||||
<arg name='filename' type='const char *' info='a file or URL'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of htmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='htmlCtxtReadIO' file='HTMLparser'>
|
||||
<info>parse an HTML document from I/O functions and source and build a tree. This reuses the existing @ctxt parser context</info>
|
||||
<return type='htmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='ctxt' type='htmlParserCtxtPtr' info='an HTML parser context'/>
|
||||
<arg name='ioread' type='xmlInputReadCallback' info='an I/O read function'/>
|
||||
<arg name='ioclose' type='xmlInputCloseCallback' info='an I/O close function'/>
|
||||
<arg name='ioctx' type='void *' info='an I/O handler'/>
|
||||
<arg name='URL' type='const char *' info='the base URL to use for the document'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of htmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='htmlCtxtReadMemory' file='HTMLparser'>
|
||||
<info>parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context</info>
|
||||
<return type='htmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='ctxt' type='htmlParserCtxtPtr' info='an HTML parser context'/>
|
||||
<arg name='buffer' type='const char *' info='a pointer to a char array'/>
|
||||
<arg name='size' type='int' info='the size of the array'/>
|
||||
<arg name='URL' type='const char *' info='the base URL to use for the document'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of htmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='htmlCtxtReset' file='HTMLparser'>
|
||||
<info>Reset a parser context</info>
|
||||
<return type='void'/>
|
||||
<arg name='ctxt' type='htmlParserCtxtPtr' info='an XML parser context'/>
|
||||
</function>
|
||||
<function name='htmlCtxtUseOptions' file='HTMLparser'>
|
||||
<info>Applies the options to the parser context</info>
|
||||
<return type='int' info='0 in case of success, the set of unknown or unimplemented options in case of error.'/>
|
||||
<arg name='ctxt' type='htmlParserCtxtPtr' info='an HTML parser context'/>
|
||||
<arg name='options' type='int' info='a combination of htmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='htmlDefaultSAXHandlerInit' file='SAX2'>
|
||||
<info>Initialize the default SAX handler</info>
|
||||
<return type='void'/>
|
||||
@ -4550,6 +4637,48 @@ actually an xmlCharEncoding'/>
|
||||
<arg name='filename' type='const char *' info='the filename'/>
|
||||
<arg name='encoding' type='const char *' info='a free form C string describing the HTML document encoding, or NULL'/>
|
||||
</function>
|
||||
<function name='htmlReadDoc' file='HTMLparser'>
|
||||
<info>parse an XML in-memory document and build a tree.</info>
|
||||
<return type='htmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='cur' type='const xmlChar *' info='a pointer to a zero terminated string'/>
|
||||
<arg name='URL' type='const char *' info='the base URL to use for the document'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of htmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='htmlReadFd' file='HTMLparser'>
|
||||
<info>parse an XML from a file descriptor and build a tree.</info>
|
||||
<return type='htmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='fd' type='int' info='an open file descriptor'/>
|
||||
<arg name='URL' type='const char *' info='the base URL to use for the document'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of htmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='htmlReadFile' file='HTMLparser'>
|
||||
<info>parse an XML file from the filesystem or the network.</info>
|
||||
<return type='htmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='filename' type='const char *' info='a file or URL'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of htmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='htmlReadIO' file='HTMLparser'>
|
||||
<info>parse an HTML document from I/O functions and source and build a tree.</info>
|
||||
<return type='htmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='ioread' type='xmlInputReadCallback' info='an I/O read function'/>
|
||||
<arg name='ioclose' type='xmlInputCloseCallback' info='an I/O close function'/>
|
||||
<arg name='ioctx' type='void *' info='an I/O handler'/>
|
||||
<arg name='URL' type='const char *' info='the base URL to use for the document'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of htmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='htmlReadMemory' file='HTMLparser'>
|
||||
<info>parse an XML in-memory document and build a tree.</info>
|
||||
<return type='htmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='buffer' type='const char *' info='a pointer to a char array'/>
|
||||
<arg name='size' type='int' info='the size of the array'/>
|
||||
<arg name='URL' type='const char *' info='the base URL to use for the document'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of htmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='htmlSAXParseDoc' file='HTMLparser'>
|
||||
<info>Parse an HTML in-memory document. If sax is not NULL, use the SAX callbacks to handle parse events. If sax is NULL, fallback to the default DOM behavior and return a tree.</info>
|
||||
<return type='htmlDocPtr' info='the resulting document tree unless SAX is NULL or the document is not well formed.'/>
|
||||
|
@ -24,11 +24,16 @@ xmllint \- command line XML tool
|
||||
|
||||
.nf
|
||||
\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--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--repeat\fR
|
||||
| \fB--insert\fR | \fB--compress\fR | \fB--html\fR | \fB--push\fR | \fB--memory\fR | \fB--nowarning\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--loaddtd\fR | \fB--dtdattr\fR | \fB--dropdtd\fR | \fB--stream\fR | \fB--chkregister\fR | \fB--relaxng\fR | \fB--schema\fR | \fB--nonet\fR] [\fBxmlfile\fR]
|
||||
|
||||
\fB--copy\fR | \fB--recover\fR | \fB--noent\fR | \fB--nocdata\fR | \fB--nsclean\fR
|
||||
| \fB--noout\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--repeat\fR | \fB--insert\fR | \fB--compress\fR
|
||||
| \fB--html\fR | \fB--push\fR | \fB--memory\fR | \fB--nowarning\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--loaddtd\fR | \fB--dtdattr\fR | \fB--dropdtd\fR | \fB--stream\fR
|
||||
| \fB--chkregister\fR | \fB--relaxng\fR | \fB--schema\fR | \fB--nonet\fR]
|
||||
[\fBxmlfile\fR]
|
||||
.fi
|
||||
|
||||
.SH "INTRODUCTION"
|
||||
@ -69,6 +74,14 @@ Output any parsable portions of an invalid document.
|
||||
\fB--noent\fR
|
||||
Substitute entity values for entity references. By default, xmllint leaves entity references in place.
|
||||
|
||||
.TP
|
||||
\fB--nocdata\fR
|
||||
Substitute CDATA section by equivalent text nodes.
|
||||
|
||||
.TP
|
||||
\fB--nsclean\fR
|
||||
Remove redundant namespace declarations.
|
||||
|
||||
.TP
|
||||
\fB--noout\fR
|
||||
Suppress output. By default, xmllint outputs the result tree.
|
||||
|
@ -50,6 +50,8 @@
|
||||
<arg>--copy</arg>
|
||||
<arg>--recover</arg>
|
||||
<arg>--noent</arg>
|
||||
<arg>--nocdata</arg>
|
||||
<arg>--nsclean</arg>
|
||||
<arg>--noout</arg>
|
||||
<arg>--htmlout</arg>
|
||||
<arg>--nowrap</arg>
|
||||
@ -173,6 +175,24 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--nocdata</option></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Substitute CDATA section by equivalent text nodes.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--nsclean</option></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Remove redundant namespace declarations.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--noout</option></term>
|
||||
<listitem>
|
||||
|
23
parser.c
23
parser.c
@ -675,11 +675,24 @@ xmlEntityPtr xmlParseStringEntityRef(xmlParserCtxtPtr ctxt,
|
||||
*
|
||||
* Pushes a new parser namespace on top of the ns stack
|
||||
*
|
||||
* Returns -1 in case of error, the index in the stack otherwise
|
||||
* Returns -1 in case of error, the index in the stack otherwise,
|
||||
* and -2 if the namespace should be discarded.
|
||||
*/
|
||||
static int
|
||||
nsPush(xmlParserCtxtPtr ctxt, const xmlChar *prefix, const xmlChar *URL)
|
||||
{
|
||||
if (ctxt->options & XML_PARSE_NSCLEAN) {
|
||||
int i;
|
||||
for (i = 0;i < ctxt->nsNr;i += 2) {
|
||||
if (ctxt->nsTab[i] == prefix) {
|
||||
/* in scope */
|
||||
if (ctxt->nsTab[i + 1] == URL)
|
||||
return(-2);
|
||||
/* out of scope keep it */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((ctxt->nsMax == 0) || (ctxt->nsTab == NULL)) {
|
||||
ctxt->nsMax = 10;
|
||||
ctxt->nsNr = 0;
|
||||
@ -12096,6 +12109,14 @@ xmlCtxtUseOptions(xmlParserCtxtPtr ctxt, int options)
|
||||
} else {
|
||||
ctxt->dictNames = 1;
|
||||
}
|
||||
if (options & XML_PARSE_NOCDATA) {
|
||||
ctxt->sax->cdataBlock = NULL;
|
||||
options -= XML_PARSE_NOCDATA;
|
||||
}
|
||||
if (options & XML_PARSE_NSCLEAN) {
|
||||
ctxt->options |= XML_PARSE_NSCLEAN;
|
||||
options -= XML_PARSE_NSCLEAN;
|
||||
}
|
||||
return (options);
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,10 @@ htmlHandleOmittedElem()
|
||||
htmlIsScriptAttribute()
|
||||
htmlParseDoc()
|
||||
htmlParseFile()
|
||||
htmlReadDoc()
|
||||
htmlReadFd()
|
||||
htmlReadFile()
|
||||
htmlReadMemory()
|
||||
|
||||
# functions from module HTMLtree
|
||||
htmlIsBooleanAttr()
|
||||
@ -812,6 +816,12 @@ Class parserCtxt(parserCtxtCore)
|
||||
wellFormed()
|
||||
|
||||
# functions from module HTMLparser
|
||||
htmlCtxtReadDoc()
|
||||
htmlCtxtReadFd()
|
||||
htmlCtxtReadFile()
|
||||
htmlCtxtReadMemory()
|
||||
htmlCtxtReset()
|
||||
htmlCtxtUseOptions()
|
||||
htmlFreeParserCtxt()
|
||||
htmlParseCharRef()
|
||||
htmlParseChunk()
|
||||
|
@ -236,6 +236,27 @@ htmlCreateMemoryParserCtxt
|
||||
htmlCreatePushParserCtxt
|
||||
#endif
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
htmlCtxtReadDoc
|
||||
#endif
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
htmlCtxtReadFd
|
||||
#endif
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
htmlCtxtReadFile
|
||||
#endif
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
htmlCtxtReadIO
|
||||
#endif
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
htmlCtxtReadMemory
|
||||
#endif
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
htmlCtxtReset
|
||||
#endif
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
htmlCtxtUseOptions
|
||||
#endif
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
htmlDefaultSAXHandlerInit
|
||||
#endif
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
@ -332,6 +353,21 @@ htmlParseEntityRef
|
||||
htmlParseFile
|
||||
#endif
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
htmlReadDoc
|
||||
#endif
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
htmlReadFd
|
||||
#endif
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
htmlReadFile
|
||||
#endif
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
htmlReadIO
|
||||
#endif
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
htmlReadMemory
|
||||
#endif
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
htmlSAXParseDoc
|
||||
#endif
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
|
@ -1293,6 +1293,8 @@ static void usage(const char *name) {
|
||||
#endif
|
||||
printf("\t--nowarning : do not emit warnings from parser/validator\n");
|
||||
printf("\t--noblanks : drop (ignorable?) blanks spaces\n");
|
||||
printf("\t--nocdata : replace cdata section with text nodes\n");
|
||||
printf("\t--nsclean : remove redundant namespace declarations\n");
|
||||
printf("\t--format : reformat/reindent the input\n");
|
||||
printf("\t--testIO : test user I/O support\n");
|
||||
printf("\t--encode encoding : output in the given encoding\n");
|
||||
@ -1370,6 +1372,12 @@ main(int argc, char **argv) {
|
||||
(!strcmp(argv[i], "--noent"))) {
|
||||
noent++;
|
||||
options |= XML_PARSE_NOENT;
|
||||
} else if ((!strcmp(argv[i], "-nsclean")) ||
|
||||
(!strcmp(argv[i], "--nsclean"))) {
|
||||
options |= XML_PARSE_NSCLEAN;
|
||||
} else if ((!strcmp(argv[i], "-nocdata")) ||
|
||||
(!strcmp(argv[i], "--nocdata"))) {
|
||||
options |= XML_PARSE_NOCDATA;
|
||||
} else if ((!strcmp(argv[i], "-nodict")) ||
|
||||
(!strcmp(argv[i], "--nodict"))) {
|
||||
options |= XML_PARSE_NODICT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user