diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2004-03-22 15:22:58 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2004-03-22 15:22:58 +0000 |
commit | 500a1de533e2ea03f452844f537bb247b7e43af2 (patch) | |
tree | 3672d5d2283a7dd73604defc41cbf643550774de | |
parent | 2f07606d109eabf6e19431d9b9e907b604f1bc45 (diff) | |
download | libxml2-500a1de533e2ea03f452844f537bb247b7e43af2.tar.gz |
applied patch from Alfred Mickautsch for better DTD support. fixed bug
* xmlwriter.c include/libxml/xmlwriter.h doc/* : applied patch from
Alfred Mickautsch for better DTD support.
* SAX2.c HTMLparser.c parser.c xinclude.c xmllint.c xmlreader.c
xmlschemas.c: fixed bug #137867 i.e. fixed properly the way
reference counting is handled in the XML parser which had the
side effect of removing a lot of hazardous cruft added to try
to fix the problems associated as they popped up.
* xmlIO.c: FILE * close fixup for stderr/stdout
Daniel
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | HTMLparser.c | 6 | ||||
-rw-r--r-- | SAX2.c | 4 | ||||
-rw-r--r-- | doc/APIchunk10.html | 31 | ||||
-rw-r--r-- | doc/APIchunk14.html | 1 | ||||
-rw-r--r-- | doc/APIchunk15.html | 1 | ||||
-rw-r--r-- | doc/APIchunk17.html | 8 | ||||
-rw-r--r-- | doc/APIchunk18.html | 2 | ||||
-rw-r--r-- | doc/APIchunk2.html | 3 | ||||
-rw-r--r-- | doc/APIchunk20.html | 3 | ||||
-rw-r--r-- | doc/APIchunk22.html | 1 | ||||
-rw-r--r-- | doc/APIchunk25.html | 6 | ||||
-rw-r--r-- | doc/APIchunk26.html | 1 | ||||
-rw-r--r-- | doc/APIchunk4.html | 2 | ||||
-rw-r--r-- | doc/APIchunk8.html | 3 | ||||
-rw-r--r-- | doc/APIfiles.html | 1 | ||||
-rw-r--r-- | doc/APIfunctions.html | 5 | ||||
-rw-r--r-- | doc/APIsymbols.html | 1 | ||||
-rw-r--r-- | doc/html/libxml-tree.html | 18 | ||||
-rw-r--r-- | doc/html/libxml-xmlwriter.html | 21 | ||||
-rw-r--r-- | doc/libxml2-api.xml | 61 | ||||
-rw-r--r-- | doc/libxml2-refs.xml | 76 | ||||
-rw-r--r-- | include/libxml/xmlwriter.h | 206 | ||||
-rw-r--r-- | parser.c | 15 | ||||
-rw-r--r-- | python/libxml2class.txt | 476 | ||||
-rw-r--r-- | win32/libxml2.def.src | 12 | ||||
-rw-r--r-- | xinclude.c | 10 | ||||
-rw-r--r-- | xmlIO.c | 10 | ||||
-rw-r--r-- | xmllint.c | 1 | ||||
-rw-r--r-- | xmlreader.c | 6 | ||||
-rw-r--r-- | xmlschemas.c | 2 | ||||
-rw-r--r-- | xmlwriter.c | 979 |
32 files changed, 1143 insertions, 840 deletions
@@ -1,3 +1,14 @@ +Mon Mar 22 16:16:18 CET 2004 Daniel Veillard <daniel@veillard.com> + + * xmlwriter.c include/libxml/xmlwriter.h doc/* : applied patch from + Alfred Mickautsch for better DTD support. + * SAX2.c HTMLparser.c parser.c xinclude.c xmllint.c xmlreader.c + xmlschemas.c: fixed bug #137867 i.e. fixed properly the way + reference counting is handled in the XML parser which had the + side effect of removing a lot of hazardous cruft added to try + to fix the problems associated as they popped up. + * xmlIO.c: FILE * close fixup for stderr/stdout + Sun Mar 21 19:19:41 HKT 2004 William Brack <wbrack@mmm.com.hk> * relaxng.c: added an error message when an element is not diff --git a/HTMLparser.c b/HTMLparser.c index c428ead2..6cbe67e6 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -5574,12 +5574,6 @@ htmlDoRead(htmlParserCtxtPtr ctxt, const char *URL, const char *encoding, (ret->dict == ctxt->dict)) ctxt->dict = NULL; xmlFreeParserCtxt(ctxt); - } else { - /* Must duplicate the reference to the dictionary */ - if ((ctxt->dictNames) && - (ret != NULL) && - (ret->dict == ctxt->dict)) - xmlDictReference(ctxt->dict); } return (ret); } @@ -839,8 +839,10 @@ xmlSAX2StartDocument(void *ctx) ctxt->disableSAX = 1; return; } - if ((ctxt->dictNames) && (doc != NULL)) + if ((ctxt->dictNames) && (doc != NULL)) { doc->dict = ctxt->dict; + xmlDictReference(doc->dict); + } } if ((ctxt->myDoc != NULL) && (ctxt->myDoc->URL == NULL) && (ctxt->input != NULL) && (ctxt->input->filename != NULL)) { diff --git a/doc/APIchunk10.html b/doc/APIchunk10.html index 6def6a85..baeacb65 100644 --- a/doc/APIchunk10.html +++ b/doc/APIchunk10.html @@ -47,6 +47,7 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-parserInternals.html#xmlParseReference">xmlParseReference</a><br /> <a href="html/libxml-parser.html#xmlSAXUserParseFile">xmlSAXUserParseFile</a><br /> <a href="html/libxml-parser.html#xmlSAXUserParseMemory">xmlSAXUserParseMemory</a><br /> +<a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br /> <a href="html/libxml-parserInternals.html#xmlSetEntityReferenceFunc">xmlSetEntityReferenceFunc</a><br /> <a href="html/libxml-xmlreader.html#xmlTextReaderCurrentDoc">xmlTextReaderCurrentDoc</a><br /> <a href="html/libxml-xmlreader.html#xmlTextReaderExpand">xmlTextReaderExpand</a><br /> @@ -265,34 +266,6 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-tree.html#_xmlDoc">_xmlDoc</a><br /> <a href="html/libxml-tree.html#_xmlDtd">_xmlDtd</a><br /> <a href="html/libxml-tree.html#_xmlNode">_xmlNode</a><br /> -</dd><dt>children</dt><dd><a href="html/libxml-HTMLparser.html#htmlAutoCloseTag">htmlAutoCloseTag</a><br /> -<a href="html/libxml-HTMLtree.html#htmlNodeDump">htmlNodeDump</a><br /> -<a href="html/libxml-HTMLtree.html#htmlNodeDumpFile">htmlNodeDumpFile</a><br /> -<a href="html/libxml-HTMLtree.html#htmlNodeDumpFileFormat">htmlNodeDumpFileFormat</a><br /> -<a href="html/libxml-HTMLtree.html#htmlNodeDumpFormatOutput">htmlNodeDumpFormatOutput</a><br /> -<a href="html/libxml-HTMLtree.html#htmlNodeDumpOutput">htmlNodeDumpOutput</a><br /> -<a href="html/libxml-tree.html#xmlAddChild">xmlAddChild</a><br /> -<a href="html/libxml-tree.html#xmlAddNextSibling">xmlAddNextSibling</a><br /> -<a href="html/libxml-tree.html#xmlAddPrevSibling">xmlAddPrevSibling</a><br /> -<a href="html/libxml-tree.html#xmlChildrenNode">xmlChildrenNode</a><br /> -<a href="html/libxml-tree.html#xmlDocGetRootElement">xmlDocGetRootElement</a><br /> -<a href="html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a><br /> -<a href="html/libxml-tree.html#xmlElemDump">xmlElemDump</a><br /> -<a href="html/libxml-tree.html#xmlFreeNode">xmlFreeNode</a><br /> -<a href="html/libxml-tree.html#xmlFreeNodeList">xmlFreeNodeList</a><br /> -<a href="html/libxml-tree.html#xmlFreePropList">xmlFreePropList</a><br /> -<a href="html/libxml-debugXML.html#xmlLsCountNode">xmlLsCountNode</a><br /> -<a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br /> -<a href="html/libxml-tree.html#xmlNewTextChild">xmlNewTextChild</a><br /> -<a href="html/libxml-xmlwriter.html#xmlNewTextWriterTree">xmlNewTextWriterTree</a><br /> -<a href="html/libxml-tree.html#xmlNodeDump">xmlNodeDump</a><br /> -<a href="html/libxml-tree.html#xmlNodeDumpOutput">xmlNodeDumpOutput</a><br /> -<a href="html/libxml-parserInternals.html#xmlParseElementChildrenContentDecl">xmlParseElementChildrenContentDecl</a><br /> -<a href="html/libxml-parserInternals.html#xmlParseElementContentDecl">xmlParseElementContentDecl</a><br /> -<a href="html/libxml-tree.html#xmlRootNode">xmlRootNode</a><br /> -<a href="html/libxml-valid.html#xmlValidGetPotentialChildren">xmlValidGetPotentialChildren</a><br /> -<a href="html/libxml-valid.html#xmlValidGetValidElements">xmlValidGetValidElements</a><br /> -<a href="html/libxml-xpathInternals.html#xmlXPathNextChild">xmlXPathNextChild</a><br /> </dd><dt>childrens</dt><dd><a href="html/libxml-entities.html#_xmlEntity">_xmlEntity</a><br /> </dd><dt>childs</dt><dd><a href="html/libxml-tree.html#_xmlNode">_xmlNode</a><br /> <a href="html/libxml-valid.html#xmlIsMixedElement">xmlIsMixedElement</a><br /> @@ -340,6 +313,7 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-parser.html#xmlReadFd">xmlReadFd</a><br /> <a href="html/libxml-xmlreader.html#xmlReaderForFd">xmlReaderForFd</a><br /> <a href="html/libxml-xmlreader.html#xmlReaderNewFd">xmlReaderNewFd</a><br /> +<a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterEndDocument">xmlTextWriterEndDocument</a><br /> </dd><dt>closes</dt><dd><a href="html/libxml-nanohttp.html#xmlNanoHTTPClose">xmlNanoHTTPClose</a><br /> <a href="html/libxml-nanohttp.html#xmlNanoHTTPSave">xmlNanoHTTPSave</a><br /> @@ -669,6 +643,7 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-xmlreader.html#xmlTextReaderReadInnerXml">xmlTextReaderReadInnerXml</a><br /> <a href="html/libxml-xmlreader.html#xmlTextReaderReadOuterXml">xmlTextReaderReadOuterXml</a><br /> <a href="html/libxml-xmlreader.html#xmlTextReaderReadString">xmlTextReaderReadString</a><br /> +<a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDExternalEntityContents">xmlTextWriterWriteDTDExternalEntityContents</a><br /> </dd><dt>contentspec</dt><dd><a href="html/libxml-parserInternals.html#xmlParseElementContentDecl">xmlParseElementContentDecl</a><br /> <a href="html/libxml-parserInternals.html#xmlParseElementDecl">xmlParseElementDecl</a><br /> </dd><dt>contextual</dt><dd><a href="html/libxml-relaxng.html#xmlRelaxNGGetParserErrors">xmlRelaxNGGetParserErrors</a><br /> diff --git a/doc/APIchunk14.html b/doc/APIchunk14.html index b85c1ef2..8f434296 100644 --- a/doc/APIchunk14.html +++ b/doc/APIchunk14.html @@ -237,6 +237,7 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-xmlstring.html#xmlStrEqual">xmlStrEqual</a><br /> <a href="html/libxml-xmlreader.html#xmlTextReaderHasValue">xmlTextReaderHasValue</a><br /> <a href="html/libxml-xmlreader.html#xmlTextReaderReadAttributeValue">xmlTextReaderReadAttributeValue</a><br /> +<a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDExternalEntity">xmlTextWriterWriteDTDExternalEntity</a><br /> <a href="html/libxml-valid.html#xmlValidateDocumentFinal">xmlValidateDocumentFinal</a><br /> <a href="html/libxml-valid.html#xmlValidateDtdFinal">xmlValidateDtdFinal</a><br /> <a href="html/libxml-xpathInternals.html#xmlXPathIdFunction">xmlXPathIdFunction</a><br /> diff --git a/doc/APIchunk15.html b/doc/APIchunk15.html index a177b2b1..b82ce9af 100644 --- a/doc/APIchunk15.html +++ b/doc/APIchunk15.html @@ -175,7 +175,6 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-tree.html#xmlNodeDumpOutput">xmlNodeDumpOutput</a><br /> <a href="html/libxml-tree.html#xmlSaveFormatFile">xmlSaveFormatFile</a><br /> <a href="html/libxml-tree.html#xmlSaveFormatFileEnc">xmlSaveFormatFileEnc</a><br /> -<a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br /> </dd><dt>independently</dt><dd><a href="html/libxml-tree.html#xmlGetProp">xmlGetProp</a><br /> <a href="html/libxml-parserInternals.html#xmlParseAttribute">xmlParseAttribute</a><br /> </dd><dt>index</dt><dd><a href="">index</a><br /> diff --git a/doc/APIchunk17.html b/doc/APIchunk17.html index df28dfca..bea20d1f 100644 --- a/doc/APIchunk17.html +++ b/doc/APIchunk17.html @@ -35,10 +35,7 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="APIchunk25.html">x-x</a> <a href="APIchunk26.html">y-z</a> </h2><h2>Letter m:</h2><dl><dt>machine</dt><dd><a href="html/libxml-xmlIO.html#xmlCheckFilename">xmlCheckFilename</a><br /> -</dd><dt>macro</dt><dd><a href="html/libxml-xmlwriter.html#xmlTextWriterEndDTDAttlist">xmlTextWriterEndDTDAttlist</a><br /> -<a href="html/libxml-xmlwriter.html#xmlTextWriterEndDTDElement">xmlTextWriterEndDTDElement</a><br /> -<a href="html/libxml-xmlwriter.html#xmlTextWriterEndDTDEntity">xmlTextWriterEndDTDEntity</a><br /> -<a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDocType">xmlTextWriterWriteDocType</a><br /> +</dd><dt>macro</dt><dd><a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDocType">xmlTextWriterWriteDocType</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteProcessingInstruction">xmlTextWriterWriteProcessingInstruction</a><br /> </dd><dt>made</dt><dd><a href="html/libxml-xmlversion.html#LIBXML_ISO8859X_ENABLED">LIBXML_ISO8859X_ENABLED</a><br /> <a href="html/libxml-encoding.html#xmlCharEncOutFunc">xmlCharEncOutFunc</a><br /> @@ -76,9 +73,6 @@ A:link, A:visited, A:active { text-decoration: underline } </dd><dt>many</dt><dd><a href="html/libxml-parser.html#_xmlParserInput">_xmlParserInput</a><br /> <a href="html/libxml-xpathInternals.html#xmlXPathStringFunction">xmlXPathStringFunction</a><br /> </dd><dt>maps</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderLookupNamespace">xmlTextReaderLookupNamespace</a><br /> -<a href="html/libxml-xmlwriter.html#xmlTextWriterEndDTDAttlist">xmlTextWriterEndDTDAttlist</a><br /> -<a href="html/libxml-xmlwriter.html#xmlTextWriterEndDTDElement">xmlTextWriterEndDTDElement</a><br /> -<a href="html/libxml-xmlwriter.html#xmlTextWriterEndDTDEntity">xmlTextWriterEndDTDEntity</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDocType">xmlTextWriterWriteDocType</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteProcessingInstruction">xmlTextWriterWriteProcessingInstruction</a><br /> </dd><dt>mark</dt><dd><a href="html/libxml-xmlstring.html#xmlStrcat">xmlStrcat</a><br /> diff --git a/doc/APIchunk18.html b/doc/APIchunk18.html index 5252a66f..62d47a26 100644 --- a/doc/APIchunk18.html +++ b/doc/APIchunk18.html @@ -57,6 +57,8 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-c14n.html#xmlC14NDocSaveTo">xmlC14NDocSaveTo</a><br /> <a href="html/libxml-c14n.html#xmlC14NExecute">xmlC14NExecute</a><br /> <a href="html/libxml-tree.html#xmlCopyDoc">xmlCopyDoc</a><br /> +<a href="html/libxml-tree.html#xmlCopyNode">xmlCopyNode</a><br /> +<a href="html/libxml-tree.html#xmlDocCopyNode">xmlDocCopyNode</a><br /> <a href="html/libxml-tree.html#xmlFreeNsList">xmlFreeNsList</a><br /> <a href="html/libxml-tree.html#xmlGetProp">xmlGetProp</a><br /> <a href="html/libxml-tree.html#xmlReconciliateNs">xmlReconciliateNs</a><br /> diff --git a/doc/APIchunk2.html b/doc/APIchunk2.html index 43ab5825..52e3b648 100644 --- a/doc/APIchunk2.html +++ b/doc/APIchunk2.html @@ -284,6 +284,9 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-xmlwriter.html#xmlTextWriterEndCDATA">xmlTextWriterEndCDATA</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterEndComment">xmlTextWriterEndComment</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterEndDTD">xmlTextWriterEndDTD</a><br /> +<a href="html/libxml-xmlwriter.html#xmlTextWriterEndDTDAttlist">xmlTextWriterEndDTDAttlist</a><br /> +<a href="html/libxml-xmlwriter.html#xmlTextWriterEndDTDElement">xmlTextWriterEndDTDElement</a><br /> +<a href="html/libxml-xmlwriter.html#xmlTextWriterEndDTDEntity">xmlTextWriterEndDTDEntity</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterEndDocument">xmlTextWriterEndDocument</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterEndElement">xmlTextWriterEndElement</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterEndPI">xmlTextWriterEndPI</a><br /> diff --git a/doc/APIchunk20.html b/doc/APIchunk20.html index 10ad6e02..b335510b 100644 --- a/doc/APIchunk20.html +++ b/doc/APIchunk20.html @@ -409,6 +409,8 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-tree.html#xmlAddChild">xmlAddChild</a><br /> <a href="html/libxml-tree.html#xmlAddNextSibling">xmlAddNextSibling</a><br /> <a href="html/libxml-tree.html#xmlAddPrevSibling">xmlAddPrevSibling</a><br /> +<a href="html/libxml-tree.html#xmlCopyNode">xmlCopyNode</a><br /> +<a href="html/libxml-tree.html#xmlDocCopyNode">xmlDocCopyNode</a><br /> <a href="html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a><br /> <a href="html/libxml-xmlreader.html#xmlTextReaderSetParserProp">xmlTextReaderSetParserProp</a><br /> </dd><dt>property</dt><dd><a href="html/libxml-tree.html#_xmlAttr">_xmlAttr</a><br /> @@ -441,7 +443,6 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-xmlIO.html#xmlOutputMatchCallback">xmlOutputMatchCallback</a><br /> <a href="html/libxml-tree.html#xmlSaveFormatFile">xmlSaveFormatFile</a><br /> <a href="html/libxml-tree.html#xmlSaveFormatFileEnc">xmlSaveFormatFileEnc</a><br /> -<a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br /> <a href="html/libxml-xmlschemas.html#xmlSchemaValidateStream">xmlSchemaValidateStream</a><br /> <a href="html/libxml-xmlstring.html#xmlUTF8Strloc">xmlUTF8Strloc</a><br /> <a href="html/libxml-xmlstring.html#xmlUTF8Strpos">xmlUTF8Strpos</a><br /> diff --git a/doc/APIchunk22.html b/doc/APIchunk22.html index 15e00971..bac06733 100644 --- a/doc/APIchunk22.html +++ b/doc/APIchunk22.html @@ -500,6 +500,7 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-xpointer.html#xmlXPtrNewRange">xmlXPtrNewRange</a><br /> </dd><dt>start-tag</dt><dd><a href="html/libxml-parserInternals.html#xmlParseElement">xmlParseElement</a><br /> <a href="html/libxml-parserInternals.html#xmlParseStartTag">xmlParseStartTag</a><br /> +</dd><dt>started</dt><dd><a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDExternalEntity">xmlTextWriterWriteDTDExternalEntity</a><br /> </dd><dt>starting</dt><dd><a href="html/libxml-xmlautomata.html#xmlAutomataNewAllTrans">xmlAutomataNewAllTrans</a><br /> <a href="html/libxml-xmlautomata.html#xmlAutomataNewCountTrans">xmlAutomataNewCountTrans</a><br /> <a href="html/libxml-xmlautomata.html#xmlAutomataNewCountedTrans">xmlAutomataNewCountedTrans</a><br /> diff --git a/doc/APIchunk25.html b/doc/APIchunk25.html index cabe9f1d..8dc92c9a 100644 --- a/doc/APIchunk25.html +++ b/doc/APIchunk25.html @@ -191,7 +191,6 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-tree.html#xmlNodeDumpOutput">xmlNodeDumpOutput</a><br /> <a href="html/libxml-tree.html#xmlSaveFormatFile">xmlSaveFormatFile</a><br /> <a href="html/libxml-tree.html#xmlSaveFormatFileEnc">xmlSaveFormatFileEnc</a><br /> -<a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br /> </dd><dt>xmlInitParser</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br /> </dd><dt>xmlInitThreads</dt><dd><a href="html/libxml-threads.html#xmlInitThreads">xmlInitThreads</a><br /> </dd><dt>xmlInitializeCatalog</dt><dd><a href="html/libxml-catalog.html#xmlCatalogAdd">xmlCatalogAdd</a><br /> @@ -223,7 +222,6 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-tree.html#xmlNodeDumpOutput">xmlNodeDumpOutput</a><br /> <a href="html/libxml-tree.html#xmlSaveFormatFile">xmlSaveFormatFile</a><br /> <a href="html/libxml-tree.html#xmlSaveFormatFileEnc">xmlSaveFormatFileEnc</a><br /> -<a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br /> </dd><dt>xmlLineNumbersDefault</dt><dd><a href="html/libxml-tree.html#xmlGetLineNo">xmlGetLineNo</a><br /> </dd><dt>xmlListWalk</dt><dd><a href="html/libxml-list.html#xmlListWalker">xmlListWalker</a><br /> </dd><dt>xmlLoadExtDtdDefaultValue</dt><dd><a href="html/libxml-parser.html#XML_COMPLETE_ATTRS">XML_COMPLETE_ATTRS</a><br /> @@ -384,9 +382,7 @@ A:link, A:visited, A:active { text-decoration: underline } </dd><dt>xmlTextReaderLocatorPtr</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderLocatorBaseURI">xmlTextReaderLocatorBaseURI</a><br /> <a href="html/libxml-xmlreader.html#xmlTextReaderLocatorLineNumber">xmlTextReaderLocatorLineNumber</a><br /> </dd><dt>xmlTextReaderRead</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderExpand">xmlTextReaderExpand</a><br /> -</dd><dt>xmlTextWriterEndDTD</dt><dd><a href="html/libxml-xmlwriter.html#xmlTextWriterEndDTDAttlist">xmlTextWriterEndDTDAttlist</a><br /> -<a href="html/libxml-xmlwriter.html#xmlTextWriterEndDTDElement">xmlTextWriterEndDTDElement</a><br /> -<a href="html/libxml-xmlwriter.html#xmlTextWriterEndDTDEntity">xmlTextWriterEndDTDEntity</a><br /> +</dd><dt>xmlTextWriterStartDTDEntity</dt><dd><a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDExternalEntity">xmlTextWriterWriteDTDExternalEntity</a><br /> </dd><dt>xmlTextWriterWriteDTD</dt><dd><a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDocType">xmlTextWriterWriteDocType</a><br /> </dd><dt>xmlTextWriterWritePI</dt><dd><a href="html/libxml-xmlwriter.html#xmlTextWriterWriteProcessingInstruction">xmlTextWriterWriteProcessingInstruction</a><br /> </dd><dt>xmlURI</dt><dd><a href="html/libxml-uri.html#xmlCreateURI">xmlCreateURI</a><br /> diff --git a/doc/APIchunk26.html b/doc/APIchunk26.html index 6bfdb9dc..6c22f43d 100644 --- a/doc/APIchunk26.html +++ b/doc/APIchunk26.html @@ -60,6 +60,7 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-tree.html#xmlBufferCCat">xmlBufferCCat</a><br /> <a href="html/libxml-tree.html#xmlBufferCat">xmlBufferCat</a><br /> <a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br /> +<a href="html/libxml-tree.html#xmlCopyDoc">xmlCopyDoc</a><br /> <a href="html/libxml-parser.html#xmlCtxtReadDoc">xmlCtxtReadDoc</a><br /> <a href="html/libxml-tree.html#xmlDocDumpMemory">xmlDocDumpMemory</a><br /> <a href="html/libxml-xmlIO.html#xmlOutputBufferWriteString">xmlOutputBufferWriteString</a><br /> diff --git a/doc/APIchunk4.html b/doc/APIchunk4.html index 88638569..eded8bbf 100644 --- a/doc/APIchunk4.html +++ b/doc/APIchunk4.html @@ -197,6 +197,7 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-parserInternals.html#xmlParseExternalID">xmlParseExternalID</a><br /> <a href="html/libxml-parserInternals.html#xmlParsePEReference">xmlParsePEReference</a><br /> <a href="html/libxml-parserInternals.html#xmlParserHandlePEReference">xmlParserHandlePEReference</a><br /> +<a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br /> <a href="html/libxml-xmlreader.html#xmlTextReaderCurrentDoc">xmlTextReaderCurrentDoc</a><br /> </dd><dt>NRK</dt><dd><a href="html/libxml-HTMLparser.html#_htmlElemDesc">_htmlElemDesc</a><br /> </dd><dt>NSDef</dt><dd><a href="html/libxml-parserInternals.html#xmlNamespaceParseNSDef">xmlNamespaceParseNSDef</a><br /> @@ -287,7 +288,6 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-SAX2.html#xmlSAXDefaultVersion">xmlSAXDefaultVersion</a><br /> <a href="html/libxml-tree.html#xmlSaveFormatFile">xmlSaveFormatFile</a><br /> <a href="html/libxml-tree.html#xmlSaveFormatFileEnc">xmlSaveFormatFileEnc</a><br /> -<a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br /> <a href="html/libxml-xmlreader.html#xmlTextReaderSetParserProp">xmlTextReaderSetParserProp</a><br /> </dd><dt>Note:</dt><dd><a href="html/libxml-parser.html#fatalErrorSAXFunc">fatalErrorSAXFunc</a><br /> <a href="html/libxml-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a><br /> diff --git a/doc/APIchunk8.html b/doc/APIchunk8.html index 50673e4b..210b4665 100644 --- a/doc/APIchunk8.html +++ b/doc/APIchunk8.html @@ -493,6 +493,7 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTD">xmlTextWriterWriteDTD</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDEntity">xmlTextWriterWriteDTDEntity</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDExternalEntity">xmlTextWriterWriteDTDExternalEntity</a><br /> +<a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDExternalEntityContents">xmlTextWriterWriteDTDExternalEntityContents</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDNotation">xmlTextWriterWriteDTDNotation</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteFormatDTD">xmlTextWriterWriteFormatDTD</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteVFormatDTD">xmlTextWriterWriteVFormatDTD</a><br /> @@ -561,6 +562,8 @@ A:link, A:visited, A:active { text-decoration: underline } </dd><dt>appended</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttValue">xmlParseAttValue</a><br /> </dd><dt>appending</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttValue">xmlParseAttValue</a><br /> </dd><dt>appendix</dt><dd><a href="html/libxml-encoding.html#xmlDetectCharEncoding">xmlDetectCharEncoding</a><br /> +</dd><dt>applicable</dt><dd><a href="html/libxml-tree.html#xmlCopyNode">xmlCopyNode</a><br /> +<a href="html/libxml-tree.html#xmlDocCopyNode">xmlDocCopyNode</a><br /> </dd><dt>application</dt><dd><a href="html/libxml-tree.html#_xmlAttr">_xmlAttr</a><br /> <a href="html/libxml-tree.html#_xmlAttribute">_xmlAttribute</a><br /> <a href="html/libxml-tree.html#_xmlDoc">_xmlDoc</a><br /> diff --git a/doc/APIfiles.html b/doc/APIfiles.html index a36f187a..de3c2705 100644 --- a/doc/APIfiles.html +++ b/doc/APIfiles.html @@ -2550,6 +2550,7 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDElement">xmlTextWriterWriteDTDElement</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDEntity">xmlTextWriterWriteDTDEntity</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDExternalEntity">xmlTextWriterWriteDTDExternalEntity</a><br /> +<a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDExternalEntityContents">xmlTextWriterWriteDTDExternalEntityContents</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDInternalEntity">xmlTextWriterWriteDTDInternalEntity</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDNotation">xmlTextWriterWriteDTDNotation</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDocType">xmlTextWriterWriteDocType</a><br /> diff --git a/doc/APIfunctions.html b/doc/APIfunctions.html index f18e9882..290aea42 100644 --- a/doc/APIfunctions.html +++ b/doc/APIfunctions.html @@ -387,6 +387,7 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDElement">xmlTextWriterWriteDTDElement</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDEntity">xmlTextWriterWriteDTDEntity</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDExternalEntity">xmlTextWriterWriteDTDExternalEntity</a><br /> +<a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDExternalEntityContents">xmlTextWriterWriteDTDExternalEntityContents</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDInternalEntity">xmlTextWriterWriteDTDInternalEntity</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDNotation">xmlTextWriterWriteDTDNotation</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteElement">xmlTextWriterWriteElement</a><br /> @@ -1845,6 +1846,9 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-xmlwriter.html#xmlTextWriterEndCDATA">xmlTextWriterEndCDATA</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterEndComment">xmlTextWriterEndComment</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterEndDTD">xmlTextWriterEndDTD</a><br /> +<a href="html/libxml-xmlwriter.html#xmlTextWriterEndDTDAttlist">xmlTextWriterEndDTDAttlist</a><br /> +<a href="html/libxml-xmlwriter.html#xmlTextWriterEndDTDElement">xmlTextWriterEndDTDElement</a><br /> +<a href="html/libxml-xmlwriter.html#xmlTextWriterEndDTDEntity">xmlTextWriterEndDTDEntity</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterEndDocument">xmlTextWriterEndDocument</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterEndElement">xmlTextWriterEndElement</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterEndPI">xmlTextWriterEndPI</a><br /> @@ -1875,6 +1879,7 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDElement">xmlTextWriterWriteDTDElement</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDEntity">xmlTextWriterWriteDTDEntity</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDExternalEntity">xmlTextWriterWriteDTDExternalEntity</a><br /> +<a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDExternalEntityContents">xmlTextWriterWriteDTDExternalEntityContents</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDInternalEntity">xmlTextWriterWriteDTDInternalEntity</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDNotation">xmlTextWriterWriteDTDNotation</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteElement">xmlTextWriterWriteElement</a><br /> diff --git a/doc/APIsymbols.html b/doc/APIsymbols.html index 973b478e..b3d570f9 100644 --- a/doc/APIsymbols.html +++ b/doc/APIsymbols.html @@ -2356,6 +2356,7 @@ A:link, A:visited, A:active { text-decoration: underline } <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDElement">xmlTextWriterWriteDTDElement</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDEntity">xmlTextWriterWriteDTDEntity</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDExternalEntity">xmlTextWriterWriteDTDExternalEntity</a><br /> +<a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDExternalEntityContents">xmlTextWriterWriteDTDExternalEntityContents</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDInternalEntity">xmlTextWriterWriteDTDInternalEntity</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDTDNotation">xmlTextWriterWriteDTDNotation</a><br /> <a href="html/libxml-xmlwriter.html#xmlTextWriterWriteDocType">xmlTextWriterWriteDocType</a><br /> diff --git a/doc/html/libxml-tree.html b/doc/html/libxml-tree.html index 4a2d6a56..b9529198 100644 --- a/doc/html/libxml-tree.html +++ b/doc/html/libxml-tree.html @@ -88,12 +88,12 @@ A:link, A:visited, A:active { text-decoration: underline } <pre class="programlisting"><a href="libxml-tree.html#xmlDtdPtr">xmlDtdPtr</a> <a href="#xmlCopyDtd">xmlCopyDtd</a> (<a href="libxml-tree.html#xmlDtdPtr">xmlDtdPtr</a> dtd)</pre> <pre class="programlisting"><a href="libxml-tree.html#xmlNsPtr">xmlNsPtr</a> <a href="#xmlCopyNamespace">xmlCopyNamespace</a> (<a href="libxml-tree.html#xmlNsPtr">xmlNsPtr</a> cur)</pre> <pre class="programlisting"><a href="libxml-tree.html#xmlNsPtr">xmlNsPtr</a> <a href="#xmlCopyNamespaceList">xmlCopyNamespaceList</a> (<a href="libxml-tree.html#xmlNsPtr">xmlNsPtr</a> cur)</pre> -<pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> <a href="#xmlCopyNode">xmlCopyNode</a> (const <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> int recursive)</pre> +<pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> <a href="#xmlCopyNode">xmlCopyNode</a> (const <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> int extended)</pre> <pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> <a href="#xmlCopyNodeList">xmlCopyNodeList</a> (const <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node)</pre> <pre class="programlisting"><a href="libxml-tree.html#xmlAttrPtr">xmlAttrPtr</a> <a href="#xmlCopyProp">xmlCopyProp</a> (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> target, <br /> <a href="libxml-tree.html#xmlAttrPtr">xmlAttrPtr</a> cur)</pre> <pre class="programlisting"><a href="libxml-tree.html#xmlAttrPtr">xmlAttrPtr</a> <a href="#xmlCopyPropList">xmlCopyPropList</a> (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> target, <br /> <a href="libxml-tree.html#xmlAttrPtr">xmlAttrPtr</a> cur)</pre> <pre class="programlisting"><a href="libxml-tree.html#xmlDtdPtr">xmlDtdPtr</a> <a href="#xmlCreateIntSubset">xmlCreateIntSubset</a> (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * SystemID)</pre> -<pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> <a href="#xmlDocCopyNode">xmlDocCopyNode</a> (const <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> int recursive)</pre> +<pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> <a href="#xmlDocCopyNode">xmlDocCopyNode</a> (const <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> int extended)</pre> <pre class="programlisting">int <a href="#xmlDocDump">xmlDocDump</a> (FILE * f, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur)</pre> <pre class="programlisting">void <a href="#xmlDocDumpFormatMemory">xmlDocDumpFormatMemory</a> (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br /> <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** mem, <br /> int * size, <br /> int format)</pre> <pre class="programlisting">void <a href="#xmlDocDumpFormatMemoryEnc">xmlDocDumpFormatMemoryEnc</a> (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> out_doc, <br /> <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** doc_txt_ptr, <br /> int * doc_txt_len, <br /> const char * txt_encoding, <br /> int format)</pre> @@ -644,15 +644,15 @@ A:link, A:visited, A:active { text-decoration: underline } </pre><p>Builds the QName @prefix:@ncname in @memory if there is enough space and prefix is not NULL nor empty, otherwise allocate a new string. If prefix is NULL or empty it returns ncname.</p> <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ncname</tt></i>:</span></td><td>the Name</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the prefix</td></tr><tr><td><span class="term"><i><tt>memory</tt></i>:</span></td><td>preallocated memory</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>preallocated memory length</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new string which must be freed by the caller if different from @memory and @ncname or NULL in case of error</td></tr></tbody></table></div><h3><a name="xmlCopyDoc" id="xmlCopyDoc"></a>Function: xmlCopyDoc</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> xmlCopyDoc (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> int recursive)<br /> </pre><p>Do a copy of the document info. If recursive, the content tree will be copied too as well as DTD, namespaces and entities.</p> -<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>recursive</tt></i>:</span></td><td>if 1 do a recursive copy.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new #xmlDocPtr, or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlCopyDtd" id="xmlCopyDtd"></a>Function: xmlCopyDtd</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDtdPtr">xmlDtdPtr</a> xmlCopyDtd (<a href="libxml-tree.html#xmlDtdPtr">xmlDtdPtr</a> dtd)<br /> +<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>recursive</tt></i>:</span></td><td>if not zero do a recursive copy.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new #xmlDocPtr, or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlCopyDtd" id="xmlCopyDtd"></a>Function: xmlCopyDtd</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDtdPtr">xmlDtdPtr</a> xmlCopyDtd (<a href="libxml-tree.html#xmlDtdPtr">xmlDtdPtr</a> dtd)<br /> </pre><p>Do a copy of the dtd.</p> <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dtd</tt></i>:</span></td><td>the dtd</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new #xmlDtdPtr, or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlCopyNamespace" id="xmlCopyNamespace"></a>Function: xmlCopyNamespace</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNsPtr">xmlNsPtr</a> xmlCopyNamespace (<a href="libxml-tree.html#xmlNsPtr">xmlNsPtr</a> cur)<br /> </pre><p>Do a copy of the namespace.</p> <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the namespace</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new #xmlNsPtr, or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlCopyNamespaceList" id="xmlCopyNamespaceList"></a>Function: xmlCopyNamespaceList</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNsPtr">xmlNsPtr</a> xmlCopyNamespaceList (<a href="libxml-tree.html#xmlNsPtr">xmlNsPtr</a> cur)<br /> </pre><p>Do a copy of an namespace list.</p> -<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the first namespace</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new #xmlNsPtr, or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlCopyNode" id="xmlCopyNode"></a>Function: xmlCopyNode</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> xmlCopyNode (const <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> int recursive)<br /> +<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the first namespace</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new #xmlNsPtr, or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlCopyNode" id="xmlCopyNode"></a>Function: xmlCopyNode</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> xmlCopyNode (const <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> int extended)<br /> </pre><p>Do a copy of the node.</p> -<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the node</td></tr><tr><td><span class="term"><i><tt>recursive</tt></i>:</span></td><td>if 1 do a recursive copy.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new #xmlNodePtr, or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlCopyNodeList" id="xmlCopyNodeList"></a>Function: xmlCopyNodeList</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> xmlCopyNodeList (const <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br /> +<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the node</td></tr><tr><td><span class="term"><i><tt>extended</tt></i>:</span></td><td>if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new #xmlNodePtr, or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlCopyNodeList" id="xmlCopyNodeList"></a>Function: xmlCopyNodeList</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> xmlCopyNodeList (const <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br /> </pre><p>Do a recursive copy of the node list.</p> <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the first node in the list.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new #xmlNodePtr, or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlCopyProp" id="xmlCopyProp"></a>Function: xmlCopyProp</h3><pre class="programlisting"><a href="libxml-tree.html#xmlAttrPtr">xmlAttrPtr</a> xmlCopyProp (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> target, <br /> <a href="libxml-tree.html#xmlAttrPtr">xmlAttrPtr</a> cur)<br /> </pre><p>Do a copy of the attribute.</p> @@ -660,9 +660,9 @@ A:link, A:visited, A:active { text-decoration: underline } </pre><p>Do a copy of an <a href="libxml-SAX.html#attribute">attribute</a> list.</p> <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>target</tt></i>:</span></td><td>the element where the attributes will be grafted</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the first <a href="libxml-SAX.html#attribute">attribute</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new #xmlAttrPtr, or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlCreateIntSubset" id="xmlCreateIntSubset"></a>Function: xmlCreateIntSubset</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDtdPtr">xmlDtdPtr</a> xmlCreateIntSubset (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * SystemID)<br /> </pre><p>Create the internal subset of a document</p> -<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document pointer</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the DTD name</td></tr><tr><td><span class="term"><i><tt>ExternalID</tt></i>:</span></td><td>the external (PUBLIC) ID</td></tr><tr><td><span class="term"><i><tt>SystemID</tt></i>:</span></td><td>the system ID</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the new DTD structure</td></tr></tbody></table></div><h3><a name="xmlDocCopyNode" id="xmlDocCopyNode"></a>Function: xmlDocCopyNode</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> xmlDocCopyNode (const <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> int recursive)<br /> +<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document pointer</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the DTD name</td></tr><tr><td><span class="term"><i><tt>ExternalID</tt></i>:</span></td><td>the external (PUBLIC) ID</td></tr><tr><td><span class="term"><i><tt>SystemID</tt></i>:</span></td><td>the system ID</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the new DTD structure</td></tr></tbody></table></div><h3><a name="xmlDocCopyNode" id="xmlDocCopyNode"></a>Function: xmlDocCopyNode</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> xmlDocCopyNode (const <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> int extended)<br /> </pre><p>Do a copy of the node to a given document.</p> -<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the node</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>recursive</tt></i>:</span></td><td>if 1 do a recursive copy.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new #xmlNodePtr, or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlDocDump" id="xmlDocDump"></a>Function: xmlDocDump</h3><pre class="programlisting">int xmlDocDump (FILE * f, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur)<br /> +<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the node</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>extended</tt></i>:</span></td><td>if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new #xmlNodePtr, or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlDocDump" id="xmlDocDump"></a>Function: xmlDocDump</h3><pre class="programlisting">int xmlDocDump (FILE * f, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur)<br /> </pre><p>Dump an XML document to an open FILE.</p> <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>f</tt></i>:</span></td><td>the FILE*</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="xmlDocDumpFormatMemory" id="xmlDocDumpFormatMemory"></a>Function: xmlDocDumpFormatMemory</h3><pre class="programlisting">void xmlDocDumpFormatMemory (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br /> <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** mem, <br /> int * size, <br /> int format)<br /> </pre><p>Dump an XML document in memory and return the #xmlChar * and it's size. It's up to the caller to free the memory with xmlFree(). Note that @format = 1 provide node indenting only if <a href="libxml-globals.html#xmlIndentTreeOutput">xmlIndentTreeOutput</a> = 1 or xmlKeepBlanksDefault(0) was called</p> @@ -831,8 +831,8 @@ A:link, A:visited, A:active { text-decoration: underline } <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename (or URL)</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="xmlSaveFormatFileEnc" id="xmlSaveFormatFileEnc"></a>Function: xmlSaveFormatFileEnc</h3><pre class="programlisting">int xmlSaveFormatFileEnc (const char * filename, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br /> const char * encoding, <br /> int format)<br /> </pre><p>Dump an XML document to a file or an URL.</p> <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename or URL to output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document being saved</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the name of the encoding to use or NULL.</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces be added.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or -1 in case of error. Note that @format = 1 provide node indenting only if <a href="libxml-globals.html#xmlIndentTreeOutput">xmlIndentTreeOutput</a> = 1 or xmlKeepBlanksDefault(0) was called</td></tr></tbody></table></div><h3><a name="xmlSaveFormatFileTo" id="xmlSaveFormatFileTo"></a>Function: xmlSaveFormatFileTo</h3><pre class="programlisting">int xmlSaveFormatFileTo (<a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br /> const char * encoding, <br /> int format)<br /> -</pre><p>Dump an XML document to an I/O buffer.</p> -<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>an output I/O buffer</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding if any assuming the I/O layer handles the trancoding</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or -1 in case of failure. Note that @format = 1 provide node indenting only if <a href="libxml-globals.html#xmlIndentTreeOutput">xmlIndentTreeOutput</a> = 1 or xmlKeepBlanksDefault(0) was called</td></tr></tbody></table></div><h3><a name="xmlSearchNs" id="xmlSearchNs"></a>Function: xmlSearchNs</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNsPtr">xmlNsPtr</a> xmlSearchNs (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * nameSpace)<br /> +</pre><p>Dump an XML document to an I/O buffer. NOTE: the I/O buffer is closed as part of the call.</p> +<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>an output I/O buffer</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding if any assuming the I/O layer handles the trancoding</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="xmlSearchNs" id="xmlSearchNs"></a>Function: xmlSearchNs</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNsPtr">xmlNsPtr</a> xmlSearchNs (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * nameSpace)<br /> </pre><p>Search a Ns registered under a given name space for a document. recurse on the parents until it finds the defined namespace or return NULL otherwise. @nameSpace can be NULL, this is a search for the default namespace. We don't allow to cross entities boundaries. If you don't declare the namespace within those you will be in troubles !!! A warning is generated to cover this case.</p> <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>nameSpace</tt></i>:</span></td><td>the namespace prefix</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the namespace pointer or NULL.</td></tr></tbody></table></div><h3><a name="xmlSearchNsByHref" id="xmlSearchNsByHref"></a>Function: xmlSearchNsByHref</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNsPtr">xmlNsPtr</a> xmlSearchNsByHref (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * href)<br /> </pre><p>Search a Ns aliasing a given URI. Recurse on the parents until it finds the defined namespace or return NULL otherwise.</p> diff --git a/doc/html/libxml-xmlwriter.html b/doc/html/libxml-xmlwriter.html index c5f205db..458262c1 100644 --- a/doc/html/libxml-xmlwriter.html +++ b/doc/html/libxml-xmlwriter.html @@ -10,7 +10,7 @@ A:link, A:visited, A:active { text-decoration: underline } </style><style type="text/css"> div.deprecated pre.programlisting {border-style: double;border-color:red} pre.programlisting {border-style: double;background: #EECFA1} - </style><title>Module xmlwriter from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Module xmlwriter from libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://garypennington.net/libxml2/">Solaris binaries</a></li><li><a href="http://www.zveno.com/open_source/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-xmlversion.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libxml-xmlversion.html">xmlversion</a></th><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The XML C parser and toolkit of Gnome</a></th><th align="right"><a href="libxml-xpath.html">xpath</a></th><td><a accesskey="n" href="libxml-xpath.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>text writing API for XML </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#xmlTextWriterEndDTDAttlist">xmlTextWriterEndDTDAttlist</a></pre><pre class="programlisting">#define <a href="#xmlTextWriterEndDTDElement">xmlTextWriterEndDTDElement</a></pre><pre class="programlisting">#define <a href="#xmlTextWriterEndDTDEntity">xmlTextWriterEndDTDEntity</a></pre><pre class="programlisting">#define <a href="#xmlTextWriterWriteDocType">xmlTextWriterWriteDocType</a></pre><pre class="programlisting">#define <a href="#xmlTextWriterWriteProcessingInstruction">xmlTextWriterWriteProcessingInstruction</a></pre><pre class="programlisting">Structure <a href="#xmlTextWriter">xmlTextWriter</a><br />struct _xmlTextWriter + </style><title>Module xmlwriter from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Module xmlwriter from libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://garypennington.net/libxml2/">Solaris binaries</a></li><li><a href="http://www.zveno.com/open_source/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-xmlversion.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libxml-xmlversion.html">xmlversion</a></th><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The XML C parser and toolkit of Gnome</a></th><th align="right"><a href="libxml-xpath.html">xpath</a></th><td><a accesskey="n" href="libxml-xpath.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>text writing API for XML </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#xmlTextWriterWriteDocType">xmlTextWriterWriteDocType</a></pre><pre class="programlisting">#define <a href="#xmlTextWriterWriteProcessingInstruction">xmlTextWriterWriteProcessingInstruction</a></pre><pre class="programlisting">Structure <a href="#xmlTextWriter">xmlTextWriter</a><br />struct _xmlTextWriter The content of this structure is not made public by the API. </pre><pre class="programlisting">Typedef <a href="libxml-xmlwriter.html#xmlTextWriter">xmlTextWriter</a> * <a name="xmlTextWriterPtr" id="xmlTextWriterPtr">xmlTextWriterPtr</a> </pre><pre class="programlisting">void <a href="#xmlFreeTextWriter">xmlFreeTextWriter</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)</pre> @@ -24,6 +24,9 @@ The content of this structure is not made public by the API. <pre class="programlisting">int <a href="#xmlTextWriterEndCDATA">xmlTextWriterEndCDATA</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)</pre> <pre class="programlisting">int <a href="#xmlTextWriterEndComment">xmlTextWriterEndComment</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)</pre> <pre class="programlisting">int <a href="#xmlTextWriterEndDTD">xmlTextWriterEndDTD</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)</pre> +<pre class="programlisting">int <a href="#xmlTextWriterEndDTDAttlist">xmlTextWriterEndDTDAttlist</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)</pre> +<pre class="programlisting">int <a href="#xmlTextWriterEndDTDElement">xmlTextWriterEndDTDElement</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)</pre> +<pre class="programlisting">int <a href="#xmlTextWriterEndDTDEntity">xmlTextWriterEndDTDEntity</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)</pre> <pre class="programlisting">int <a href="#xmlTextWriterEndDocument">xmlTextWriterEndDocument</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)</pre> <pre class="programlisting">int <a href="#xmlTextWriterEndElement">xmlTextWriterEndElement</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)</pre> <pre class="programlisting">int <a href="#xmlTextWriterEndPI">xmlTextWriterEndPI</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)</pre> @@ -54,6 +57,7 @@ The content of this structure is not made public by the API. <pre class="programlisting">int <a href="#xmlTextWriterWriteDTDElement">xmlTextWriterWriteDTDElement</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content)</pre> <pre class="programlisting">int <a href="#xmlTextWriterWriteDTDEntity">xmlTextWriterWriteDTDEntity</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br /> int pe, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * pubid, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * sysid, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * ndataid, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content)</pre> <pre class="programlisting">int <a href="#xmlTextWriterWriteDTDExternalEntity">xmlTextWriterWriteDTDExternalEntity</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br /> int pe, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * pubid, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * sysid, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * ndataid)</pre> +<pre class="programlisting">int <a href="#xmlTextWriterWriteDTDExternalEntityContents">xmlTextWriterWriteDTDExternalEntityContents</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * pubid, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * sysid, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * ndataid)</pre> <pre class="programlisting">int <a href="#xmlTextWriterWriteDTDInternalEntity">xmlTextWriterWriteDTDInternalEntity</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br /> int pe, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content)</pre> <pre class="programlisting">int <a href="#xmlTextWriterWriteDTDNotation">xmlTextWriterWriteDTDNotation</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * pubid, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * sysid)</pre> <pre class="programlisting">int <a href="#xmlTextWriterWriteElement">xmlTextWriterWriteElement</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content)</pre> @@ -89,9 +93,6 @@ The content of this structure is not made public by the API. <pre class="programlisting">int <a href="#xmlTextWriterWriteVFormatRaw">xmlTextWriterWriteVFormatRaw</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br /> const char * format, <br /> va_list argptr)</pre> <pre class="programlisting">int <a href="#xmlTextWriterWriteVFormatString">xmlTextWriterWriteVFormatString</a> (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br /> const char * format, <br /> va_list argptr)</pre> <h2>Description</h2> -<h3><a name="xmlTextWriterEndDTDAttlist" id="xmlTextWriterEndDTDAttlist"></a>Macro: xmlTextWriterEndDTDAttlist</h3><pre>#define xmlTextWriterEndDTDAttlist</pre><p>This macro maps to <a href="libxml-xmlwriter.html#xmlTextWriterEndDTD">xmlTextWriterEndDTD</a></p> -<h3><a name="xmlTextWriterEndDTDElement" id="xmlTextWriterEndDTDElement"></a>Macro: xmlTextWriterEndDTDElement</h3><pre>#define xmlTextWriterEndDTDElement</pre><p>This macro maps to <a href="libxml-xmlwriter.html#xmlTextWriterEndDTD">xmlTextWriterEndDTD</a></p> -<h3><a name="xmlTextWriterEndDTDEntity" id="xmlTextWriterEndDTDEntity"></a>Macro: xmlTextWriterEndDTDEntity</h3><pre>#define xmlTextWriterEndDTDEntity</pre><p>This macro maps to <a href="libxml-xmlwriter.html#xmlTextWriterEndDTD">xmlTextWriterEndDTD</a></p> <h3><a name="xmlTextWriterWriteDocType" id="xmlTextWriterWriteDocType"></a>Macro: xmlTextWriterWriteDocType</h3><pre>#define xmlTextWriterWriteDocType</pre><p>this macro maps to <a href="libxml-xmlwriter.html#xmlTextWriterWriteDTD">xmlTextWriterWriteDTD</a></p> <h3><a name="xmlTextWriterWriteProcessingInstruction" id="xmlTextWriterWriteProcessingInstruction"></a>Macro: xmlTextWriterWriteProcessingInstruction</h3><pre>#define xmlTextWriterWriteProcessingInstruction</pre><p>This macro maps to <a href="libxml-xmlwriter.html#xmlTextWriterWritePI">xmlTextWriterWritePI</a></p> <h3><a name="xmlTextWriter" id="xmlTextWriter">Structure xmlTextWriter</a></h3><pre class="programlisting">Structure xmlTextWriter<br />struct _xmlTextWriter { @@ -118,6 +119,12 @@ The content of this structure is not made public by the API. </pre><p>End the current xml coment.</p> <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>writer</tt></i>:</span></td><td>the <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the bytes written (may be 0 because of buffering) or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextWriterEndDTD" id="xmlTextWriterEndDTD"></a>Function: xmlTextWriterEndDTD</h3><pre class="programlisting">int xmlTextWriterEndDTD (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)<br /> </pre><p>End an xml DTD.</p> +<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>writer</tt></i>:</span></td><td>the <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the bytes written (may be 0 because of buffering) or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextWriterEndDTDAttlist" id="xmlTextWriterEndDTDAttlist"></a>Function: xmlTextWriterEndDTDAttlist</h3><pre class="programlisting">int xmlTextWriterEndDTDAttlist (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)<br /> +</pre><p>End an xml DTD <a href="libxml-SAX.html#attribute">attribute</a> list.</p> +<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>writer</tt></i>:</span></td><td>the <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the bytes written (may be 0 because of buffering) or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextWriterEndDTDElement" id="xmlTextWriterEndDTDElement"></a>Function: xmlTextWriterEndDTDElement</h3><pre class="programlisting">int xmlTextWriterEndDTDElement (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)<br /> +</pre><p>End an xml DTD element.</p> +<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>writer</tt></i>:</span></td><td>the <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the bytes written (may be 0 because of buffering) or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextWriterEndDTDEntity" id="xmlTextWriterEndDTDEntity"></a>Function: xmlTextWriterEndDTDEntity</h3><pre class="programlisting">int xmlTextWriterEndDTDEntity (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)<br /> +</pre><p>End an xml DTD entity.</p> <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>writer</tt></i>:</span></td><td>the <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the bytes written (may be 0 because of buffering) or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextWriterEndDocument" id="xmlTextWriterEndDocument"></a>Function: xmlTextWriterEndDocument</h3><pre class="programlisting">int xmlTextWriterEndDocument (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)<br /> </pre><p>End an xml document. All open elements are closed</p> <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>writer</tt></i>:</span></td><td>the <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the bytes written (may be 0 because of buffering) or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextWriterEndElement" id="xmlTextWriterEndElement"></a>Function: xmlTextWriterEndElement</h3><pre class="programlisting">int xmlTextWriterEndElement (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)<br /> @@ -177,8 +184,10 @@ The content of this structure is not made public by the API. <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>writer</tt></i>:</span></td><td>the <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a></td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the name of the DTD element</td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td>content of the element</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the bytes written (may be 0 because of buffering) or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextWriterWriteDTDEntity" id="xmlTextWriterWriteDTDEntity"></a>Function: xmlTextWriterWriteDTDEntity</h3><pre class="programlisting">int xmlTextWriterWriteDTDEntity (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br /> int pe, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * pubid, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * sysid, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * ndataid, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content)<br /> </pre><p>Write a DTD entity.</p> <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>writer</tt></i>:</span></td><td>the <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a></td></tr><tr><td><span class="term"><i><tt>pe</tt></i>:</span></td><td>TRUE if this is a parameter entity, FALSE if not</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the name of the DTD entity</td></tr><tr><td><span class="term"><i><tt>pubid</tt></i>:</span></td><td>the public identifier, which is an alternative to the system identifier</td></tr><tr><td><span class="term"><i><tt>sysid</tt></i>:</span></td><td>the system identifier, which is the URI of the DTD</td></tr><tr><td><span class="term"><i><tt>ndataid</tt></i>:</span></td><td>the xml notation name.</td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td>content of the entity</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the bytes written (may be 0 because of buffering) or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextWriterWriteDTDExternalEntity" id="xmlTextWriterWriteDTDExternalEntity"></a>Function: xmlTextWriterWriteDTDExternalEntity</h3><pre class="programlisting">int xmlTextWriterWriteDTDExternalEntity (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br /> int pe, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * pubid, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * sysid, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * ndataid)<br /> -</pre><p>Write a DTD internal entity.</p> -<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>writer</tt></i>:</span></td><td>the <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a></td></tr><tr><td><span class="term"><i><tt>pe</tt></i>:</span></td><td>TRUE if this is a parameter entity, FALSE if not</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the name of the DTD entity</td></tr><tr><td><span class="term"><i><tt>pubid</tt></i>:</span></td><td>the public identifier, which is an alternative to the system identifier</td></tr><tr><td><span class="term"><i><tt>sysid</tt></i>:</span></td><td>the system identifier, which is the URI of the DTD</td></tr><tr><td><span class="term"><i><tt>ndataid</tt></i>:</span></td><td>the xml notation name.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the bytes written (may be 0 because of buffering) or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextWriterWriteDTDInternalEntity" id="xmlTextWriterWriteDTDInternalEntity"></a>Function: xmlTextWriterWriteDTDInternalEntity</h3><pre class="programlisting">int xmlTextWriterWriteDTDInternalEntity (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br /> int pe, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content)<br /> +</pre><p>Write a DTD external entity. The entity must have been started with <a href="libxml-xmlwriter.html#xmlTextWriterStartDTDEntity">xmlTextWriterStartDTDEntity</a></p> +<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>writer</tt></i>:</span></td><td>the <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a></td></tr><tr><td><span class="term"><i><tt>pe</tt></i>:</span></td><td>TRUE if this is a parameter entity, FALSE if not</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the name of the DTD entity</td></tr><tr><td><span class="term"><i><tt>pubid</tt></i>:</span></td><td>the public identifier, which is an alternative to the system identifier</td></tr><tr><td><span class="term"><i><tt>sysid</tt></i>:</span></td><td>the system identifier, which is the URI of the DTD</td></tr><tr><td><span class="term"><i><tt>ndataid</tt></i>:</span></td><td>the xml notation name.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the bytes written (may be 0 because of buffering) or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextWriterWriteDTDExternalEntityContents" id="xmlTextWriterWriteDTDExternalEntityContents"></a>Function: xmlTextWriterWriteDTDExternalEntityContents</h3><pre class="programlisting">int xmlTextWriterWriteDTDExternalEntityContents (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * pubid, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * sysid, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * ndataid)<br /> +</pre><p>Write the contents of a DTD external entity.</p> +<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>writer</tt></i>:</span></td><td>the <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a></td></tr><tr><td><span class="term"><i><tt>pubid</tt></i>:</span></td><td>the public identifier, which is an alternative to the system identifier</td></tr><tr><td><span class="term"><i><tt>sysid</tt></i>:</span></td><td>the system identifier, which is the URI of the DTD</td></tr><tr><td><span class="term"><i><tt>ndataid</tt></i>:</span></td><td>the xml notation name.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the bytes written (may be 0 because of buffering) or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextWriterWriteDTDInternalEntity" id="xmlTextWriterWriteDTDInternalEntity"></a>Function: xmlTextWriterWriteDTDInternalEntity</h3><pre class="programlisting">int xmlTextWriterWriteDTDInternalEntity (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br /> int pe, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content)<br /> </pre><p>Write a DTD internal entity.</p> <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>writer</tt></i>:</span></td><td>the <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a></td></tr><tr><td><span class="term"><i><tt>pe</tt></i>:</span></td><td>TRUE if this is a parameter entity, FALSE if not</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the name of the DTD entity</td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td>content of the entity</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the bytes written (may be 0 because of buffering) or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextWriterWriteDTDNotation" id="xmlTextWriterWriteDTDNotation"></a>Function: xmlTextWriterWriteDTDNotation</h3><pre class="programlisting">int xmlTextWriterWriteDTDNotation (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * pubid, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * sysid)<br /> </pre><p>Write a DTD entity.</p> diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml index 1162e1a4..3546b0c8 100644 --- a/doc/libxml2-api.xml +++ b/doc/libxml2-api.xml @@ -2709,20 +2709,17 @@ <description>text writing API for XML </description> <author>Alfred Mickautsch <alfred@mickautsch.de> </author> <exports symbol='xmlTextWriterWriteProcessingInstruction' type='macro'/> - <exports symbol='xmlTextWriterEndDTDEntity' type='macro'/> - <exports symbol='xmlTextWriterEndDTDElement' type='macro'/> - <exports symbol='xmlTextWriterEndDTDAttlist' type='macro'/> <exports symbol='xmlTextWriterWriteDocType' type='macro'/> <exports symbol='xmlTextWriter' type='typedef'/> <exports symbol='xmlTextWriterPtr' type='typedef'/> <exports symbol='xmlTextWriterStartDocument' type='function'/> - <exports symbol='xmlTextWriterEndDocument' type='function'/> + <exports symbol='xmlTextWriterEndPI' type='function'/> <exports symbol='xmlTextWriterWriteBase64' type='function'/> <exports symbol='xmlTextWriterSetIndentString' type='function'/> <exports symbol='xmlTextWriterStartAttribute' type='function'/> <exports symbol='xmlTextWriterEndComment' type='function'/> <exports symbol='xmlTextWriterWriteRawLen' type='function'/> - <exports symbol='xmlTextWriterWriteVFormatDTD' type='function'/> + <exports symbol='xmlTextWriterWriteDTDExternalEntityContents' type='function'/> <exports symbol='xmlTextWriterWriteVFormatCDATA' type='function'/> <exports symbol='xmlTextWriterStartAttributeNS' type='function'/> <exports symbol='xmlNewTextWriterPushParser' type='function'/> @@ -2734,10 +2731,11 @@ <exports symbol='xmlTextWriterSetIndent' type='function'/> <exports symbol='xmlTextWriterWriteFormatPI' type='function'/> <exports symbol='xmlTextWriterWriteDTDAttlist' type='function'/> - <exports symbol='xmlTextWriterEndPI' type='function'/> <exports symbol='xmlTextWriterStartComment' type='function'/> + <exports symbol='xmlTextWriterWriteVFormatDTD' type='function'/> <exports symbol='xmlTextWriterEndCDATA' type='function'/> <exports symbol='xmlTextWriterStartElementNS' type='function'/> + <exports symbol='xmlTextWriterEndDTDEntity' type='function'/> <exports symbol='xmlNewTextWriter' type='function'/> <exports symbol='xmlFreeTextWriter' type='function'/> <exports symbol='xmlTextWriterWriteVFormatDTDAttlist' type='function'/> @@ -2745,9 +2743,11 @@ <exports symbol='xmlTextWriterStartElement' type='function'/> <exports symbol='xmlTextWriterWriteDTDExternalEntity' type='function'/> <exports symbol='xmlTextWriterWriteFormatRaw' type='function'/> + <exports symbol='xmlTextWriterWritePI' type='function'/> <exports symbol='xmlTextWriterWriteCDATA' type='function'/> <exports symbol='xmlTextWriterWriteVFormatDTDInternalEntity' type='function'/> <exports symbol='xmlTextWriterWriteVFormatAttribute' type='function'/> + <exports symbol='xmlTextWriterEndDTDElement' type='function'/> <exports symbol='xmlTextWriterWriteComment' type='function'/> <exports symbol='xmlTextWriterWriteElement' type='function'/> <exports symbol='xmlTextWriterEndElement' type='function'/> @@ -2757,9 +2757,9 @@ <exports symbol='xmlTextWriterWriteVFormatElement' type='function'/> <exports symbol='xmlTextWriterWriteFormatComment' type='function'/> <exports symbol='xmlTextWriterWriteAttributeNS' type='function'/> - <exports symbol='xmlTextWriterWritePI' type='function'/> - <exports symbol='xmlTextWriterWriteVFormatRaw' type='function'/> <exports symbol='xmlTextWriterWriteFormatDTDInternalEntity' type='function'/> + <exports symbol='xmlTextWriterWriteVFormatRaw' type='function'/> + <exports symbol='xmlTextWriterEndDocument' type='function'/> <exports symbol='xmlTextWriterWriteVFormatString' type='function'/> <exports symbol='xmlTextWriterWriteDTDInternalEntity' type='function'/> <exports symbol='xmlTextWriterWriteVFormatElementNS' type='function'/> @@ -2774,6 +2774,7 @@ <exports symbol='xmlTextWriterWriteAttribute' type='function'/> <exports symbol='xmlNewTextWriterDoc' type='function'/> <exports symbol='xmlTextWriterWriteFormatDTDElement' type='function'/> + <exports symbol='xmlTextWriterEndDTDAttlist' type='function'/> <exports symbol='xmlNewTextWriterTree' type='function'/> <exports symbol='xmlNewTextWriterMemory' type='function'/> <exports symbol='xmlTextWriterWriteFormatCDATA' type='function'/> @@ -3550,15 +3551,6 @@ <macro name='xmlRootNode' file='tree'> <info>Macro for compatibility naming layer with libxml1. Maps to "children".</info> </macro> - <macro name='xmlTextWriterEndDTDAttlist' file='xmlwriter'> - <info>This macro maps to xmlTextWriterEndDTD</info> - </macro> - <macro name='xmlTextWriterEndDTDElement' file='xmlwriter'> - <info>This macro maps to xmlTextWriterEndDTD</info> - </macro> - <macro name='xmlTextWriterEndDTDEntity' file='xmlwriter'> - <info>This macro maps to xmlTextWriterEndDTD</info> - </macro> <macro name='xmlTextWriterWriteDocType' file='xmlwriter'> <info>this macro maps to xmlTextWriterWriteDTD</info> </macro> @@ -7227,7 +7219,7 @@ actually an xmlCharEncoding'/> <info>Do a copy of the document info. If recursive, the content tree will be copied too as well as DTD, namespaces and entities.</info> <return type='xmlDocPtr' info='a new #xmlDocPtr, or NULL in case of error.'/> <arg name='doc' type='xmlDocPtr' info='the document'/> - <arg name='recursive' type='int' info='if 1 do a recursive copy.'/> + <arg name='recursive' type='int' info='if not zero do a recursive copy.'/> </function> <function name='xmlCopyDtd' file='tree'> <info>Do a copy of the dtd.</info> @@ -7274,7 +7266,7 @@ actually an xmlCharEncoding'/> <info>Do a copy of the node.</info> <return type='xmlNodePtr' info='a new #xmlNodePtr, or NULL in case of error.'/> <arg name='node' type='const xmlNodePtr' info='the node'/> - <arg name='recursive' type='int' info='if 1 do a recursive copy.'/> + <arg name='extended' type='int' info='if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable)'/> </function> <function name='xmlCopyNodeList' file='tree'> <info>Do a recursive copy of the node list.</info> @@ -7599,7 +7591,7 @@ actually an xmlCharEncoding'/> <return type='xmlNodePtr' info='a new #xmlNodePtr, or NULL in case of error.'/> <arg name='node' type='const xmlNodePtr' info='the node'/> <arg name='doc' type='xmlDocPtr' info='the document'/> - <arg name='recursive' type='int' info='if 1 do a recursive copy.'/> + <arg name='extended' type='int' info='if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable)'/> </function> <function name='xmlDocDump' file='tree'> <info>Dump an XML document to an open FILE.</info> @@ -10989,8 +10981,8 @@ actually an xmlCharEncoding'/> <arg name='format' type='int' info='should formatting spaces be added.'/> </function> <function name='xmlSaveFormatFileTo' file='tree'> - <info>Dump an XML document to an I/O buffer.</info> - <return type='int' info='the number of bytes written or -1 in case of failure. Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was called'/> + <info>Dump an XML document to an I/O buffer. NOTE: the I/O buffer is closed as part of the call.</info> + <return type='int' info='the number of bytes written or -1 in case of failure.'/> <arg name='buf' type='xmlOutputBufferPtr' info='an output I/O buffer'/> <arg name='cur' type='xmlDocPtr' info='the document'/> <arg name='encoding' type='const char *' info='the encoding if any assuming the I/O layer handles the trancoding'/> @@ -12015,6 +12007,21 @@ actually an xmlCharEncoding'/> <return type='int' info='the bytes written (may be 0 because of buffering) or -1 in case of error'/> <arg name='writer' type='xmlTextWriterPtr' info='the xmlTextWriterPtr'/> </function> + <function name='xmlTextWriterEndDTDAttlist' file='xmlwriter'> + <info>End an xml DTD attribute list.</info> + <return type='int' info='the bytes written (may be 0 because of buffering) or -1 in case of error'/> + <arg name='writer' type='xmlTextWriterPtr' info='the xmlTextWriterPtr'/> + </function> + <function name='xmlTextWriterEndDTDElement' file='xmlwriter'> + <info>End an xml DTD element.</info> + <return type='int' info='the bytes written (may be 0 because of buffering) or -1 in case of error'/> + <arg name='writer' type='xmlTextWriterPtr' info='the xmlTextWriterPtr'/> + </function> + <function name='xmlTextWriterEndDTDEntity' file='xmlwriter'> + <info>End an xml DTD entity.</info> + <return type='int' info='the bytes written (may be 0 because of buffering) or -1 in case of error'/> + <arg name='writer' type='xmlTextWriterPtr' info='the xmlTextWriterPtr'/> + </function> <function name='xmlTextWriterEndDocument' file='xmlwriter'> <info>End an xml document. All open elements are closed</info> <return type='int' info='the bytes written (may be 0 because of buffering) or -1 in case of error'/> @@ -12210,7 +12217,7 @@ actually an xmlCharEncoding'/> <arg name='content' type='const xmlChar *' info='content of the entity'/> </function> <function name='xmlTextWriterWriteDTDExternalEntity' file='xmlwriter'> - <info>Write a DTD internal entity.</info> + <info>Write a DTD external entity. The entity must have been started with xmlTextWriterStartDTDEntity</info> <return type='int' info='the bytes written (may be 0 because of buffering) or -1 in case of error'/> <arg name='writer' type='xmlTextWriterPtr' info='the xmlTextWriterPtr'/> <arg name='pe' type='int' info='TRUE if this is a parameter entity, FALSE if not'/> @@ -12219,6 +12226,14 @@ actually an xmlCharEncoding'/> <arg name='sysid' type='const xmlChar *' info='the system identifier, which is the URI of the DTD'/> <arg name='ndataid' type='const xmlChar *' info='the xml notation name.'/> </function> + <function name='xmlTextWriterWriteDTDExternalEntityContents' file='xmlwriter'> + <info>Write the contents of a DTD external entity.</info> + <return type='int' info='the bytes written (may be 0 because of buffering) or -1 in case of error'/> + <arg name='writer' type='xmlTextWriterPtr' info='the xmlTextWriterPtr'/> + <arg name='pubid' type='const xmlChar *' info='the public identifier, which is an alternative to the system identifier'/> + <arg name='sysid' type='const xmlChar *' info='the system identifier, which is the URI of the DTD'/> + <arg name='ndataid' type='const xmlChar *' info='the xml notation name.'/> + </function> <function name='xmlTextWriterWriteDTDInternalEntity' file='xmlwriter'> <info>Write a DTD internal entity.</info> <return type='int' info='the bytes written (may be 0 because of buffering) or -1 in case of error'/> diff --git a/doc/libxml2-refs.xml b/doc/libxml2-refs.xml index 0bdf8a4f..da0f2e22 100644 --- a/doc/libxml2-refs.xml +++ b/doc/libxml2-refs.xml @@ -2350,6 +2350,7 @@ <reference name='xmlTextWriterWriteDTDElement' href='html/libxml-xmlwriter.html#xmlTextWriterWriteDTDElement'/> <reference name='xmlTextWriterWriteDTDEntity' href='html/libxml-xmlwriter.html#xmlTextWriterWriteDTDEntity'/> <reference name='xmlTextWriterWriteDTDExternalEntity' href='html/libxml-xmlwriter.html#xmlTextWriterWriteDTDExternalEntity'/> + <reference name='xmlTextWriterWriteDTDExternalEntityContents' href='html/libxml-xmlwriter.html#xmlTextWriterWriteDTDExternalEntityContents'/> <reference name='xmlTextWriterWriteDTDInternalEntity' href='html/libxml-xmlwriter.html#xmlTextWriterWriteDTDInternalEntity'/> <reference name='xmlTextWriterWriteDTDNotation' href='html/libxml-xmlwriter.html#xmlTextWriterWriteDTDNotation'/> <reference name='xmlTextWriterWriteDocType' href='html/libxml-xmlwriter.html#xmlTextWriterWriteDocType'/> @@ -5264,6 +5265,7 @@ <ref name='xmlTextWriterWriteDTDElement'/> <ref name='xmlTextWriterWriteDTDEntity'/> <ref name='xmlTextWriterWriteDTDExternalEntity'/> + <ref name='xmlTextWriterWriteDTDExternalEntityContents'/> <ref name='xmlTextWriterWriteDTDInternalEntity'/> <ref name='xmlTextWriterWriteDTDNotation'/> <ref name='xmlTextWriterWriteDocType'/> @@ -6868,6 +6870,7 @@ <ref name='xmlTextWriterWriteDTDElement'/> <ref name='xmlTextWriterWriteDTDEntity'/> <ref name='xmlTextWriterWriteDTDExternalEntity'/> + <ref name='xmlTextWriterWriteDTDExternalEntityContents'/> <ref name='xmlTextWriterWriteDTDInternalEntity'/> <ref name='xmlTextWriterWriteDTDNotation'/> <ref name='xmlTextWriterWriteElement'/> @@ -8624,6 +8627,9 @@ <ref name='xmlTextWriterEndCDATA'/> <ref name='xmlTextWriterEndComment'/> <ref name='xmlTextWriterEndDTD'/> + <ref name='xmlTextWriterEndDTDAttlist'/> + <ref name='xmlTextWriterEndDTDElement'/> + <ref name='xmlTextWriterEndDTDEntity'/> <ref name='xmlTextWriterEndDocument'/> <ref name='xmlTextWriterEndElement'/> <ref name='xmlTextWriterEndPI'/> @@ -8654,6 +8660,7 @@ <ref name='xmlTextWriterWriteDTDElement'/> <ref name='xmlTextWriterWriteDTDEntity'/> <ref name='xmlTextWriterWriteDTDExternalEntity'/> + <ref name='xmlTextWriterWriteDTDExternalEntityContents'/> <ref name='xmlTextWriterWriteDTDInternalEntity'/> <ref name='xmlTextWriterWriteDTDNotation'/> <ref name='xmlTextWriterWriteElement'/> @@ -11493,6 +11500,7 @@ <ref name='xmlTextWriterWriteDTDElement'/> <ref name='xmlTextWriterWriteDTDEntity'/> <ref name='xmlTextWriterWriteDTDExternalEntity'/> + <ref name='xmlTextWriterWriteDTDExternalEntityContents'/> <ref name='xmlTextWriterWriteDTDInternalEntity'/> <ref name='xmlTextWriterWriteDTDNotation'/> <ref name='xmlTextWriterWriteDocType'/> @@ -13003,6 +13011,9 @@ <ref name='xmlTextWriterEndCDATA'/> <ref name='xmlTextWriterEndComment'/> <ref name='xmlTextWriterEndDTD'/> + <ref name='xmlTextWriterEndDTDAttlist'/> + <ref name='xmlTextWriterEndDTDElement'/> + <ref name='xmlTextWriterEndDTDEntity'/> <ref name='xmlTextWriterEndDocument'/> <ref name='xmlTextWriterEndElement'/> <ref name='xmlTextWriterEndPI'/> @@ -13992,6 +14003,7 @@ <ref name='xmlParseExternalID'/> <ref name='xmlParsePEReference'/> <ref name='xmlParserHandlePEReference'/> + <ref name='xmlSaveFormatFileTo'/> <ref name='xmlTextReaderCurrentDoc'/> </word> <word name='NRK'> @@ -14136,7 +14148,6 @@ <ref name='xmlSAXDefaultVersion'/> <ref name='xmlSaveFormatFile'/> <ref name='xmlSaveFormatFileEnc'/> - <ref name='xmlSaveFormatFileTo'/> <ref name='xmlTextReaderSetParserProp'/> </word> <word name='Note:'> @@ -16232,6 +16243,7 @@ <ref name='xmlTextWriterWriteDTD'/> <ref name='xmlTextWriterWriteDTDEntity'/> <ref name='xmlTextWriterWriteDTDExternalEntity'/> + <ref name='xmlTextWriterWriteDTDExternalEntityContents'/> <ref name='xmlTextWriterWriteDTDNotation'/> <ref name='xmlTextWriterWriteFormatDTD'/> <ref name='xmlTextWriterWriteVFormatDTD'/> @@ -16353,6 +16365,10 @@ <word name='appendix'> <ref name='xmlDetectCharEncoding'/> </word> + <word name='applicable'> + <ref name='xmlCopyNode'/> + <ref name='xmlDocCopyNode'/> + </word> <word name='application'> <ref name='_xmlAttr'/> <ref name='_xmlAttribute'/> @@ -16849,6 +16865,7 @@ <ref name='xmlParseReference'/> <ref name='xmlSAXUserParseFile'/> <ref name='xmlSAXUserParseMemory'/> + <ref name='xmlSaveFormatFileTo'/> <ref name='xmlSetEntityReferenceFunc'/> <ref name='xmlTextReaderCurrentDoc'/> <ref name='xmlTextReaderExpand'/> @@ -17144,36 +17161,6 @@ <ref name='_xmlDtd'/> <ref name='_xmlNode'/> </word> - <word name='children'> - <ref name='htmlAutoCloseTag'/> - <ref name='htmlNodeDump'/> - <ref name='htmlNodeDumpFile'/> - <ref name='htmlNodeDumpFileFormat'/> - <ref name='htmlNodeDumpFormatOutput'/> - <ref name='htmlNodeDumpOutput'/> - <ref name='xmlAddChild'/> - <ref name='xmlAddNextSibling'/> - <ref name='xmlAddPrevSibling'/> - <ref name='xmlChildrenNode'/> - <ref name='xmlDocGetRootElement'/> - <ref name='xmlDocSetRootElement'/> - <ref name='xmlElemDump'/> - <ref name='xmlFreeNode'/> - <ref name='xmlFreeNodeList'/> - <ref name='xmlFreePropList'/> - <ref name='xmlLsCountNode'/> - <ref name='xmlNewChild'/> - <ref name='xmlNewTextChild'/> - <ref name='xmlNewTextWriterTree'/> - <ref name='xmlNodeDump'/> - <ref name='xmlNodeDumpOutput'/> - <ref name='xmlParseElementChildrenContentDecl'/> - <ref name='xmlParseElementContentDecl'/> - <ref name='xmlRootNode'/> - <ref name='xmlValidGetPotentialChildren'/> - <ref name='xmlValidGetValidElements'/> - <ref name='xmlXPathNextChild'/> - </word> <word name='childrens'> <ref name='_xmlEntity'/> </word> @@ -17248,6 +17235,7 @@ <ref name='xmlReadFd'/> <ref name='xmlReaderForFd'/> <ref name='xmlReaderNewFd'/> + <ref name='xmlSaveFormatFileTo'/> <ref name='xmlTextWriterEndDocument'/> </word> <word name='closes'> @@ -17725,6 +17713,7 @@ <ref name='xmlTextReaderReadInnerXml'/> <ref name='xmlTextReaderReadOuterXml'/> <ref name='xmlTextReaderReadString'/> + <ref name='xmlTextWriterWriteDTDExternalEntityContents'/> </word> <word name='contentspec'> <ref name='xmlParseElementContentDecl'/> @@ -19921,6 +19910,7 @@ <ref name='xmlStrEqual'/> <ref name='xmlTextReaderHasValue'/> <ref name='xmlTextReaderReadAttributeValue'/> + <ref name='xmlTextWriterWriteDTDExternalEntity'/> <ref name='xmlValidateDocumentFinal'/> <ref name='xmlValidateDtdFinal'/> <ref name='xmlXPathIdFunction'/> @@ -20298,7 +20288,6 @@ <ref name='xmlNodeDumpOutput'/> <ref name='xmlSaveFormatFile'/> <ref name='xmlSaveFormatFileEnc'/> - <ref name='xmlSaveFormatFileTo'/> </word> <word name='independently'> <ref name='xmlGetProp'/> @@ -21206,9 +21195,6 @@ <ref name='xmlCheckFilename'/> </word> <word name='macro'> - <ref name='xmlTextWriterEndDTDAttlist'/> - <ref name='xmlTextWriterEndDTDElement'/> - <ref name='xmlTextWriterEndDTDEntity'/> <ref name='xmlTextWriterWriteDocType'/> <ref name='xmlTextWriterWriteProcessingInstruction'/> </word> @@ -21279,9 +21265,6 @@ </word> <word name='maps'> <ref name='xmlTextReaderLookupNamespace'/> - <ref name='xmlTextWriterEndDTDAttlist'/> - <ref name='xmlTextWriterEndDTDElement'/> - <ref name='xmlTextWriterEndDTDEntity'/> <ref name='xmlTextWriterWriteDocType'/> <ref name='xmlTextWriterWriteProcessingInstruction'/> </word> @@ -21643,6 +21626,8 @@ <ref name='xmlC14NDocSaveTo'/> <ref name='xmlC14NExecute'/> <ref name='xmlCopyDoc'/> + <ref name='xmlCopyNode'/> + <ref name='xmlDocCopyNode'/> <ref name='xmlFreeNsList'/> <ref name='xmlGetProp'/> <ref name='xmlReconciliateNs'/> @@ -22941,6 +22926,8 @@ <ref name='xmlAddChild'/> <ref name='xmlAddNextSibling'/> <ref name='xmlAddPrevSibling'/> + <ref name='xmlCopyNode'/> + <ref name='xmlDocCopyNode'/> <ref name='xmlTextReaderRead'/> <ref name='xmlTextReaderSetParserProp'/> </word> @@ -22983,7 +22970,6 @@ <ref name='xmlOutputMatchCallback'/> <ref name='xmlSaveFormatFile'/> <ref name='xmlSaveFormatFileEnc'/> - <ref name='xmlSaveFormatFileTo'/> <ref name='xmlSchemaValidateStream'/> <ref name='xmlUTF8Strloc'/> <ref name='xmlUTF8Strpos'/> @@ -24543,6 +24529,9 @@ <ref name='xmlParseElement'/> <ref name='xmlParseStartTag'/> </word> + <word name='started'> + <ref name='xmlTextWriterWriteDTDExternalEntity'/> + </word> <word name='starting'> <ref name='xmlAutomataNewAllTrans'/> <ref name='xmlAutomataNewCountTrans'/> @@ -26441,7 +26430,6 @@ <ref name='xmlNodeDumpOutput'/> <ref name='xmlSaveFormatFile'/> <ref name='xmlSaveFormatFileEnc'/> - <ref name='xmlSaveFormatFileTo'/> </word> <word name='xmlInitParser'> <ref name='htmlInitAutoClose'/> @@ -26523,7 +26511,6 @@ <ref name='xmlNodeDumpOutput'/> <ref name='xmlSaveFormatFile'/> <ref name='xmlSaveFormatFileEnc'/> - <ref name='xmlSaveFormatFileTo'/> </word> <word name='xmlLineNumbersDefault'> <ref name='xmlGetLineNo'/> @@ -26885,10 +26872,8 @@ <word name='xmlTextReaderRead'> <ref name='xmlTextReaderExpand'/> </word> - <word name='xmlTextWriterEndDTD'> - <ref name='xmlTextWriterEndDTDAttlist'/> - <ref name='xmlTextWriterEndDTDElement'/> - <ref name='xmlTextWriterEndDTDEntity'/> + <word name='xmlTextWriterStartDTDEntity'> + <ref name='xmlTextWriterWriteDTDExternalEntity'/> </word> <word name='xmlTextWriterWriteDTD'> <ref name='xmlTextWriterWriteDocType'/> @@ -27070,6 +27055,7 @@ <ref name='xmlBufferCCat'/> <ref name='xmlBufferCat'/> <ref name='xmlByteConsumed'/> + <ref name='xmlCopyDoc'/> <ref name='xmlCtxtReadDoc'/> <ref name='xmlDocDumpMemory'/> <ref name='xmlOutputBufferWriteString'/> diff --git a/include/libxml/xmlwriter.h b/include/libxml/xmlwriter.h index 37cf40c6..f1e1fd84 100644 --- a/include/libxml/xmlwriter.h +++ b/include/libxml/xmlwriter.h @@ -37,8 +37,8 @@ extern "C" { XMLPUBFUN xmlTextWriterPtr XMLCALL xmlNewTextWriterDoc(xmlDocPtr * doc, int compression); XMLPUBFUN xmlTextWriterPtr XMLCALL - xmlNewTextWriterTree(xmlDocPtr doc, - xmlNodePtr node, int compression); + xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node, + int compression); XMLPUBFUN void XMLCALL xmlFreeTextWriter(xmlTextWriterPtr writer); /* @@ -54,14 +54,14 @@ extern "C" { const char *version, const char *encoding, const char *standalone); - XMLPUBFUN int XMLCALL - xmlTextWriterEndDocument(xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL xmlTextWriterEndDocument(xmlTextWriterPtr + writer); /* * Comments */ - XMLPUBFUN int XMLCALL - xmlTextWriterStartComment(xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL xmlTextWriterStartComment(xmlTextWriterPtr + writer); XMLPUBFUN int XMLCALL xmlTextWriterEndComment(xmlTextWriterPtr writer); XMLPUBFUN int XMLCALL xmlTextWriterWriteFormatComment(xmlTextWriterPtr writer, @@ -70,9 +70,10 @@ extern "C" { xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer, const char *format, va_list argptr); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteComment(xmlTextWriterPtr writer, - const xmlChar * content); + XMLPUBFUN int XMLCALL xmlTextWriterWriteComment(xmlTextWriterPtr + writer, + const xmlChar * + content); /* * Elements @@ -80,14 +81,16 @@ extern "C" { XMLPUBFUN int XMLCALL xmlTextWriterStartElement(xmlTextWriterPtr writer, const xmlChar * name); - XMLPUBFUN int XMLCALL - xmlTextWriterStartElementNS(xmlTextWriterPtr writer, - const xmlChar * prefix, - const xmlChar * name, - const xmlChar * namespaceURI); + XMLPUBFUN int XMLCALL xmlTextWriterStartElementNS(xmlTextWriterPtr + writer, + const xmlChar * + prefix, + const xmlChar * name, + const xmlChar * + namespaceURI); XMLPUBFUN int XMLCALL xmlTextWriterEndElement(xmlTextWriterPtr writer); - XMLPUBFUN int XMLCALL - xmlTextWriterFullEndElement(xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL xmlTextWriterFullEndElement(xmlTextWriterPtr + writer); /* * Elements conveniency functions @@ -101,10 +104,11 @@ extern "C" { const xmlChar * name, const char *format, va_list argptr); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteElement(xmlTextWriterPtr writer, - const xmlChar * name, - const xmlChar * content); + XMLPUBFUN int XMLCALL xmlTextWriterWriteElement(xmlTextWriterPtr + writer, + const xmlChar * name, + const xmlChar * + content); XMLPUBFUN int XMLCALL xmlTextWriterWriteFormatElementNS(xmlTextWriterPtr writer, const xmlChar * prefix, @@ -118,12 +122,15 @@ extern "C" { const xmlChar * namespaceURI, const char *format, va_list argptr); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteElementNS(xmlTextWriterPtr writer, - const xmlChar * prefix, - const xmlChar * name, - const xmlChar * namespaceURI, - const xmlChar * content); + XMLPUBFUN int XMLCALL xmlTextWriterWriteElementNS(xmlTextWriterPtr + writer, + const xmlChar * + prefix, + const xmlChar * name, + const xmlChar * + namespaceURI, + const xmlChar * + content); /* * Text @@ -140,22 +147,24 @@ extern "C" { XMLPUBFUN int XMLCALL xmlTextWriterWriteRaw(xmlTextWriterPtr writer, const xmlChar * content); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteFormatString(xmlTextWriterPtr writer, - const char *format, ...); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteVFormatString(xmlTextWriterPtr writer, - const char *format, - va_list argptr); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteString(xmlTextWriterPtr writer, - const xmlChar * content); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteBase64(xmlTextWriterPtr writer, - const char *data, int start, int len); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteBinHex(xmlTextWriterPtr writer, - const char *data, int start, int len); + XMLPUBFUN int XMLCALL xmlTextWriterWriteFormatString(xmlTextWriterPtr + writer, + const char + *format, ...); + XMLPUBFUN int XMLCALL xmlTextWriterWriteVFormatString(xmlTextWriterPtr + writer, + const char + *format, + va_list argptr); + XMLPUBFUN int XMLCALL xmlTextWriterWriteString(xmlTextWriterPtr writer, + const xmlChar * + content); + XMLPUBFUN int XMLCALL xmlTextWriterWriteBase64(xmlTextWriterPtr writer, + const char *data, + int start, int len); + XMLPUBFUN int XMLCALL xmlTextWriterWriteBinHex(xmlTextWriterPtr writer, + const char *data, + int start, int len); /* * Attributes @@ -163,13 +172,16 @@ extern "C" { XMLPUBFUN int XMLCALL xmlTextWriterStartAttribute(xmlTextWriterPtr writer, const xmlChar * name); - XMLPUBFUN int XMLCALL - xmlTextWriterStartAttributeNS(xmlTextWriterPtr writer, - const xmlChar * prefix, - const xmlChar * name, - const xmlChar * namespaceURI); - XMLPUBFUN int XMLCALL - xmlTextWriterEndAttribute(xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL xmlTextWriterStartAttributeNS(xmlTextWriterPtr + writer, + const xmlChar * + prefix, + const xmlChar * + name, + const xmlChar * + namespaceURI); + XMLPUBFUN int XMLCALL xmlTextWriterEndAttribute(xmlTextWriterPtr + writer); /* * Attributes conveniency functions @@ -183,10 +195,11 @@ extern "C" { const xmlChar * name, const char *format, va_list argptr); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteAttribute(xmlTextWriterPtr writer, - const xmlChar * name, - const xmlChar * content); + XMLPUBFUN int XMLCALL xmlTextWriterWriteAttribute(xmlTextWriterPtr + writer, + const xmlChar * name, + const xmlChar * + content); XMLPUBFUN int XMLCALL xmlTextWriterWriteFormatAttributeNS(xmlTextWriterPtr writer, const xmlChar * prefix, @@ -200,12 +213,16 @@ extern "C" { const xmlChar * namespaceURI, const char *format, va_list argptr); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteAttributeNS(xmlTextWriterPtr writer, - const xmlChar * prefix, - const xmlChar * name, - const xmlChar * namespaceURI, - const xmlChar * content); + XMLPUBFUN int XMLCALL xmlTextWriterWriteAttributeNS(xmlTextWriterPtr + writer, + const xmlChar * + prefix, + const xmlChar * + name, + const xmlChar * + namespaceURI, + const xmlChar * + content); /* * PI's @@ -302,13 +319,8 @@ extern "C" { XMLPUBFUN int XMLCALL xmlTextWriterStartDTDElement(xmlTextWriterPtr writer, const xmlChar * name); - -/** - * xmlTextWriterEndDTDElement: - * - * This macro maps to xmlTextWriterEndDTD - */ -#define xmlTextWriterEndDTDElement xmlTextWriterEndDTD + XMLPUBFUN int XMLCALL xmlTextWriterEndDTDElement(xmlTextWriterPtr + writer); /* * DTD element definition conveniency functions @@ -322,10 +334,12 @@ extern "C" { const xmlChar * name, const char *format, va_list argptr); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteDTDElement(xmlTextWriterPtr writer, - const xmlChar * name, - const xmlChar * content); + XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDElement(xmlTextWriterPtr + writer, + const xmlChar * + name, + const xmlChar * + content); /* * DTD attribute list definition @@ -333,13 +347,8 @@ extern "C" { XMLPUBFUN int XMLCALL xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer, const xmlChar * name); - -/** - * xmlTextWriterEndDTDAttlist: - * - * This macro maps to xmlTextWriterEndDTD - */ -#define xmlTextWriterEndDTDAttlist xmlTextWriterEndDTD + XMLPUBFUN int XMLCALL xmlTextWriterEndDTDAttlist(xmlTextWriterPtr + writer); /* * DTD attribute list definition conveniency functions @@ -353,10 +362,12 @@ extern "C" { const xmlChar * name, const char *format, va_list argptr); - XMLPUBFUN int XMLCALL - xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr writer, - const xmlChar * name, - const xmlChar * content); + XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr + writer, + const xmlChar * + name, + const xmlChar * + content); /* * DTD entity definition @@ -364,13 +375,8 @@ extern "C" { XMLPUBFUN int XMLCALL xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer, int pe, const xmlChar * name); - -/** - * xmlTextWriterEndDTDEntity: - * - * This macro maps to xmlTextWriterEndDTD - */ -#define xmlTextWriterEndDTDEntity xmlTextWriterEndDTD + XMLPUBFUN int XMLCALL xmlTextWriterEndDTDEntity(xmlTextWriterPtr + writer); /* * DTD entity definition conveniency functions @@ -399,13 +405,23 @@ extern "C" { const xmlChar * sysid, const xmlChar * ndataid); XMLPUBFUN int XMLCALL - xmlTextWriterWriteDTDEntity(xmlTextWriterPtr writer, - int pe, - const xmlChar * name, - const xmlChar * pubid, - const xmlChar * sysid, - const xmlChar * ndataid, - const xmlChar * content); + xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr + writer, + const xmlChar * pubid, + const xmlChar * sysid, + const xmlChar * + ndataid); + XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDEntity(xmlTextWriterPtr + writer, int pe, + const xmlChar * name, + const xmlChar * + pubid, + const xmlChar * + sysid, + const xmlChar * + ndataid, + const xmlChar * + content); /* * DTD notation definition @@ -9949,7 +9949,7 @@ xmlIOParseDTD(xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input, if (ctxt->sax != NULL) xmlFree(ctxt->sax); ctxt->sax = sax; - ctxt->userData = NULL; + ctxt->userData = ctxt; } xmlDetectSAX2(ctxt); @@ -12025,25 +12025,12 @@ xmlDoRead(xmlParserCtxtPtr ctxt, const char *URL, const char *encoding, else { ret = NULL; if (ctxt->myDoc != NULL) { - if ((ctxt->dictNames) && - (ctxt->myDoc->dict == ctxt->dict)) - xmlDictReference(ctxt->dict); xmlFreeDoc(ctxt->myDoc); } } ctxt->myDoc = NULL; if (!reuse) { - if ((ctxt->dictNames) && - (ret != NULL) && - (ret->dict == ctxt->dict)) - ctxt->dict = NULL; xmlFreeParserCtxt(ctxt); - } else { - /* Must duplicate the reference to the dictionary */ - if ((ctxt->dictNames) && - (ret != NULL) && - (ret->dict == ctxt->dict)) - xmlDictReference(ctxt->dict); } return (ret); diff --git a/python/libxml2class.txt b/python/libxml2class.txt index ae0e658b..1df60379 100644 --- a/python/libxml2class.txt +++ b/python/libxml2class.txt @@ -632,6 +632,57 @@ 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() + freeCatalog() + remove() + resolve() + resolvePublic() + resolveSystem() + resolveURI() + + +Class xmlElement(xmlNode) Class xmlAttr(xmlNode) @@ -650,6 +701,62 @@ 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 @@ -657,6 +764,34 @@ Class xmlReg() regexpFreeRegexp() regexpIsDeterminist() regexpPrint() + + +Class xmlEntity(xmlNode) + + # functions from module parserInternals + handleEntity() +Class relaxNgSchema() + + # functions from module relaxng + relaxNGDump() + relaxNGDumpTree() + relaxNGFree() + relaxNGNewValidCtxt() + + # functions from module xmlreader + RelaxNGSetSchema() +Class Error() + # accessors + code() + domain() + file() + level() + line() + message() + + # functions from module xmlerror + copyError() + resetError() Class relaxNgValidCtxt() # functions from module relaxng @@ -665,6 +800,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) @@ -772,92 +974,6 @@ Class xmlDtd(xmlNode) dtdElementDesc() dtdQAttrDesc() dtdQElementDesc() -Class relaxNgParserCtxt() - - # functions from module relaxng - relaxNGFreeParserCtxt() - 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 catalog() - - # functions from module catalog - add() - catalogIsEmpty() - convertSGMLCatalog() - dump() - freeCatalog() - remove() - resolve() - resolvePublic() - resolveSystem() - resolveURI() Class xmlNs(xmlNode) @@ -881,6 +997,42 @@ Class xmlNs(xmlNode) # functions from module xpathInternals xpathNodeSetFreeNs() + + +Class inputBuffer(ioReadWrapper) + + # functions from module xmlIO + freeParserInputBuffer() + grow() + push() + read() + + # functions from module xmlreader + newTextReader() +Class relaxNgParserCtxt() + + # functions from module relaxng + relaxNGFreeParserCtxt() + 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 xmlTextReaderLocator() # functions from module xmlreader @@ -912,155 +1064,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 Error() - # accessors - code() - domain() - file() - level() - line() - message() - - # functions from module xmlerror - copyError() - resetError() -Class relaxNgSchema() - - # functions from module relaxng - relaxNGDump() - relaxNGDumpTree() - relaxNGFree() - relaxNGNewValidCtxt() - - # functions from module xmlreader - RelaxNGSetSchema() - - -Class inputBuffer(ioReadWrapper) - - # functions from module xmlIO - freeParserInputBuffer() - grow() - push() - read() - - # functions from module xmlreader - newTextReader() - - -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/win32/libxml2.def.src b/win32/libxml2.def.src index 1d4e9d5d..3faab29f 100644 --- a/win32/libxml2.def.src +++ b/win32/libxml2.def.src @@ -1450,12 +1450,20 @@ xmlSAXParseMemoryWithData xmlSAXUserParseFile xmlSAXUserParseMemory xmlSAXVersion +xmlSaveClose +xmlSaveDoc xmlSaveFile xmlSaveFileEnc xmlSaveFileTo +xmlSaveFlush xmlSaveFormatFile xmlSaveFormatFileEnc xmlSaveFormatFileTo +xmlSaveToBuffer +xmlSaveToFd +xmlSaveToFilename +xmlSaveToIO +xmlSaveTree xmlSaveUri xmlScanName #ifdef LIBXML_SCHEMAS_ENABLED @@ -1692,6 +1700,9 @@ xmlTextWriterEndAttribute xmlTextWriterEndCDATA xmlTextWriterEndComment xmlTextWriterEndDTD +xmlTextWriterEndDTDAttlist +xmlTextWriterEndDTDElement +xmlTextWriterEndDTDEntity xmlTextWriterEndDocument xmlTextWriterEndElement xmlTextWriterEndPI @@ -1722,6 +1733,7 @@ xmlTextWriterWriteDTDAttlist xmlTextWriterWriteDTDElement xmlTextWriterWriteDTDEntity xmlTextWriterWriteDTDExternalEntity +xmlTextWriterWriteDTDExternalEntityContents xmlTextWriterWriteDTDInternalEntity xmlTextWriterWriteDTDNotation xmlTextWriterWriteElement @@ -453,19 +453,11 @@ xmlXIncludeParseFile(xmlXIncludeCtxtPtr ctxt, const char *URL) { if (pctxt->wellFormed) { ret = pctxt->myDoc; - xmlDictReference(pctxt->dict); } else { ret = NULL; - if (pctxt->myDoc != NULL) { - if ((ctxt->doc != NULL) && (ctxt->doc->dict != NULL) && - (pctxt->myDoc->dict == ctxt->doc->dict)) - xmlDictReference(ctxt->doc->dict); - else if ((pctxt->dict != NULL) && - (pctxt->dict == pctxt->myDoc->dict)) - xmlDictReference(pctxt->dict); + if (pctxt->myDoc != NULL) xmlFreeDoc(pctxt->myDoc); - } pctxt->myDoc = NULL; } xmlFreeParserCtxt(pctxt); @@ -785,11 +785,13 @@ xmlFileClose (void * context) { int ret; fil = (FILE *) context; - if (fil == stdin) - return(0); - if (fil == stdout) + if ((fil == stdout) || (fil == stderr)) { + ret = fflush(fil); + if (ret < 0) + xmlIOErr(0, "fflush()"); return(0); - if (fil == stderr) + } + if (fil == stdin) return(0); ret = ( fclose((FILE *) context) == EOF ) ? -1 : 0; if (ret < 0) @@ -874,6 +874,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { if (res > 0) { ctxt = xmlCreatePushParserCtxt(NULL, NULL, chars, res, filename); + xmlCtxtUseOptions(ctxt, options); while ((res = fread(chars, 1, size, f)) > 0) { xmlParseChunk(ctxt, chars, res, 0); } diff --git a/xmlreader.c b/xmlreader.c index 8a533a28..e1c2ef8a 100644 --- a/xmlreader.c +++ b/xmlreader.c @@ -496,6 +496,7 @@ xmlTextReaderFreeDoc(xmlTextReaderPtr reader, xmlDocPtr cur) { if (cur->encoding != NULL) xmlFree((char *) cur->encoding); if (cur->oldNs != NULL) xmlFreeNsList(cur->oldNs); if (cur->URL != NULL) xmlFree((char *) cur->URL); + if (cur->dict != NULL) xmlDictFree(cur->dict); xmlFree(cur); } @@ -3649,9 +3650,6 @@ xmlTextReaderCurrentDoc(xmlTextReaderPtr reader) { return(NULL); reader->preserve = 1; - if ((reader->ctxt->myDoc->dict != NULL) && - (reader->ctxt->myDoc->dict == reader->ctxt->dict)) - xmlDictReference(reader->ctxt->dict); return(reader->ctxt->myDoc); } @@ -4178,8 +4176,6 @@ xmlTextReaderSetup(xmlTextReaderPtr reader, xmlParserInputBufferPtr buf; xmlCharEncoding enc = XML_CHAR_ENCODING_NONE; - if (reader->ctxt->myDoc != NULL) - xmlDictReference(reader->ctxt->myDoc->dict); xmlCtxtReset(reader->ctxt); buf = xmlAllocParserInputBuffer(enc); if (buf == NULL) return(-1); diff --git a/xmlschemas.c b/xmlschemas.c index 3a3602f0..192cfe87 100644 --- a/xmlschemas.c +++ b/xmlschemas.c @@ -374,8 +374,8 @@ xmlSchemaNewSchema(xmlSchemaParserCtxtPtr ctxt) return (NULL); } memset(ret, 0, sizeof(xmlSchema)); - xmlDictReference(ctxt->dict); ret->dict = ctxt->dict; + xmlDictReference(ret->dict); return (ret); } diff --git a/xmlwriter.c b/xmlwriter.c index 43e5f63d..e5c7e5fc 100644 --- a/xmlwriter.c +++ b/xmlwriter.c @@ -38,9 +38,13 @@ typedef enum { XML_TEXTWRITER_DTD, XML_TEXTWRITER_DTD_TEXT, XML_TEXTWRITER_DTD_ELEM, + XML_TEXTWRITER_DTD_ELEM_TEXT, XML_TEXTWRITER_DTD_ATTL, - XML_TEXTWRITER_DTD_ENTY, - XML_TEXTWRITER_COMMENT + XML_TEXTWRITER_DTD_ATTL_TEXT, + XML_TEXTWRITER_DTD_ENTY, /* entity */ + XML_TEXTWRITER_DTD_ENTY_TEXT, + XML_TEXTWRITER_DTD_PENT, /* parameter entity */ + XML_TEXTWRITER_COMMENT, } xmlTextWriterState; typedef struct _xmlTextWriterStackEntry xmlTextWriterStackEntry; @@ -87,6 +91,9 @@ static int xmlOutputBufferWriteBase64(xmlOutputBufferPtr out, int len, const unsigned char *data); static void xmlTextWriterStartDocumentCallback(void *ctx); static int xmlTextWriterWriteIndent(xmlTextWriterPtr writer); +static int + xmlTextWriterHandleStateDependencies(xmlTextWriterPtr writer, + xmlTextWriterStackEntry * p); /** * xmlNewTextWriter: @@ -127,7 +134,7 @@ xmlNewTextWriter(xmlOutputBufferPtr out) if (ret->nsstack == NULL) { xmlGenericError(xmlGenericErrorContext, "xmlNewTextWriter : out of memory!\n"); - xmlFree(ret->nodes); + xmlListDelete(ret->nodes); xmlFree(ret); return NULL; } @@ -136,8 +143,14 @@ xmlNewTextWriter(xmlOutputBufferPtr out) ret->ichar = xmlStrdup(BAD_CAST " "); ret->qchar = '"'; - if (!ret->ichar) + if (!ret->ichar) { + xmlListDelete(ret->nodes); + xmlListDelete(ret->nsstack); + xmlFree(ret); + xmlGenericError(xmlGenericErrorContext, + "xmlNewTextWriter : out of memory!\n"); return NULL; + } return ret; } @@ -233,6 +246,12 @@ xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, xmlTextWriterPtr ret; xmlOutputBufferPtr out; + if (ctxt == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlNewTextWriterPushParser : invalid context!\n"); + return NULL; + } + out = xmlOutputBufferCreateIO((xmlOutputWriteCallback) xmlTextWriterWriteDocCallback, (xmlOutputCloseCallback) @@ -301,8 +320,10 @@ xmlNewTextWriterDoc(xmlDocPtr * doc, int compression) return NULL; } - *doc = ctxt->myDoc; - xmlSetDocCompressMode(*doc, compression); + xmlSetDocCompressMode(ctxt->myDoc, compression); + + if (doc != NULL) + *doc = ctxt->myDoc; return ret; } @@ -326,6 +347,8 @@ xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node, int compression) xmlParserCtxtPtr ctxt; if (doc == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlNewTextWriterTree : invalid document tree!\n"); return NULL; } @@ -342,16 +365,17 @@ xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node, int compression) return NULL; } - ctxt->myDoc = doc; - ctxt->node = node; - ret = xmlNewTextWriterPushParser(ctxt, compression); if (ret == NULL) { + xmlFreeParserCtxt(ctxt); xmlGenericError(xmlGenericErrorContext, "xmlNewTextWriterDoc : error at xmlNewTextWriterPushParser!\n"); return NULL; } + ctxt->myDoc = doc; + ctxt->node = node; + xmlSetDocCompressMode(doc, compression); return ret; @@ -406,13 +430,16 @@ xmlTextWriterStartDocument(xmlTextWriterPtr writer, const char *version, xmlLinkPtr lk; xmlCharEncodingHandlerPtr encoder; - if ((writer == NULL) || (writer->out == NULL)) + if ((writer == NULL) || (writer->out == NULL)) { + xmlGenericError(xmlGenericErrorContext, + "xmlTextWriterStartDocument : invalid writer!\n"); return -1; + } lk = xmlListFront(writer->nodes); if ((lk != NULL) && (xmlLinkGetData(lk) != NULL)) { xmlGenericError(xmlGenericErrorContext, - "xmlTextWriterStartDocument : only one prolog allowed in an XML document!\n"); + "xmlTextWriterStartDocument : not allowed in this context!\n"); return -1; } @@ -517,8 +544,11 @@ xmlTextWriterEndDocument(xmlTextWriterPtr writer) xmlLinkPtr lk; xmlTextWriterStackEntry *p; - if (writer == NULL) + if (writer == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlTextWriterEndDocument : invalid writer!\n"); return -1; + } sum = 0; while ((lk = xmlListFront(writer->nodes)) != NULL) { @@ -548,6 +578,14 @@ xmlTextWriterEndDocument(xmlTextWriterPtr writer) sum += count; break; case XML_TEXTWRITER_DTD: + case XML_TEXTWRITER_DTD_TEXT: + case XML_TEXTWRITER_DTD_ELEM: + case XML_TEXTWRITER_DTD_ELEM_TEXT: + case XML_TEXTWRITER_DTD_ATTL: + case XML_TEXTWRITER_DTD_ATTL_TEXT: + case XML_TEXTWRITER_DTD_ENTY: + case XML_TEXTWRITER_DTD_ENTY_TEXT: + case XML_TEXTWRITER_DTD_PENT: count = xmlTextWriterEndDTD(writer); if (count < 0) return -1; @@ -573,11 +611,6 @@ xmlTextWriterEndDocument(xmlTextWriterPtr writer) return sum; } - - - - - /** * xmlTextWriterStartComment: * @writer: the xmlTextWriterPtr @@ -594,8 +627,11 @@ xmlTextWriterStartComment(xmlTextWriterPtr writer) xmlLinkPtr lk; xmlTextWriterStackEntry *p; - if (writer == NULL) + if (writer == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlTextWriterStartComment : invalid writer!\n"); return -1; + } sum = 0; lk = xmlListFront(writer->nodes); @@ -611,6 +647,13 @@ xmlTextWriterStartComment(xmlTextWriterPtr writer) if (count < 0) return -1; sum += count; + if (writer->indent) { + count = + xmlOutputBufferWriteString(writer->out, "\n"); + if (count < 0) + return -1; + sum += count; + } p->state = XML_TEXTWRITER_TEXT; break; default: @@ -633,10 +676,6 @@ xmlTextWriterStartComment(xmlTextWriterPtr writer) xmlListPushFront(writer->nodes, p); if (writer->indent) { - count = xmlOutputBufferWriteString(writer->out, "\n"); - if (count < 0) - return -1; - sum += count; count = xmlTextWriterWriteIndent(writer); if (count < 0) return -1; @@ -667,12 +706,18 @@ xmlTextWriterEndComment(xmlTextWriterPtr writer) xmlLinkPtr lk; xmlTextWriterStackEntry *p; - if (writer == NULL) + if (writer == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlTextWriterEndComment : invalid writer!\n"); return -1; + } lk = xmlListFront(writer->nodes); - if (lk == 0) + if (lk == 0) { + xmlGenericError(xmlGenericErrorContext, + "xmlTextWriterEndComment : not allowed in this context!\n"); return -1; + } p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); if (p == 0) @@ -743,8 +788,11 @@ xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer, int rc; xmlChar *buf; - if (writer == NULL) + if (writer == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlTextWriterWriteVFormatComment : invalid writer!\n"); return -1; + } buf = xmlTextWriterVSprintf(format, argptr); if (buf == 0) @@ -1142,50 +1190,38 @@ xmlTextWriterWriteRawLen(xmlTextWriterPtr writer, const xmlChar * content, xmlLinkPtr lk; xmlTextWriterStackEntry *p; - if (writer == NULL) + if (writer == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlTextWriterWriteRawLen : invalid writer!\n"); return -1; + } - lk = xmlListFront(writer->nodes); - if (lk == 0) - return 0; - - p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); - if (p == 0) - return 0; + if ((content == NULL) && (len > 0)) { + xmlGenericError(xmlGenericErrorContext, + "xmlTextWriterWriteRawLen : invalid content!\n"); + return -1; + } sum = 0; - switch (p->state) { - case XML_TEXTWRITER_NONE: + lk = xmlListFront(writer->nodes); + if (lk != 0) { + p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); + count = xmlTextWriterHandleStateDependencies(writer, p); + if (count < 0) return -1; - case XML_TEXTWRITER_NAME: - count = xmlOutputBufferWriteString(writer->out, ">"); - if (count < 0) - return -1; - sum += count; - p->state = XML_TEXTWRITER_TEXT; - break; - case XML_TEXTWRITER_PI: - count = xmlOutputBufferWriteString(writer->out, " "); - if (count < 0) - return -1; - sum += count; - p->state = XML_TEXTWRITER_PI_TEXT; - break; - case XML_TEXTWRITER_DTD: - count = xmlOutputBufferWriteString(writer->out, " ["); - if (count < 0) - return -1; - sum += count; - p->state = XML_TEXTWRITER_DTD_TEXT; - break; - default: - break; + sum += count; } - count = xmlOutputBufferWrite(writer->out, len, (const char *) content); - if (count < 0) - return -1; - sum += count; + if (writer->indent) + writer->doindent = 0; + + if (content != NULL) { + count = + xmlOutputBufferWrite(writer->out, len, (const char *) content); + if (count < 0) + return -1; + sum += count; + } return sum; } @@ -1272,82 +1308,45 @@ xmlTextWriterWriteVFormatString(xmlTextWriterPtr writer, int xmlTextWriterWriteString(xmlTextWriterPtr writer, const xmlChar * content) { - int count = 0; + int count; int sum; xmlLinkPtr lk; xmlTextWriterStackEntry *p; - xmlChar *buf = NULL; + xmlChar *buf; if (writer == NULL) return -1; - lk = xmlListFront(writer->nodes); - if (lk == 0) - return -1; - - p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); - if (p == 0) - return -1; - sum = 0; - switch (p->state) { - case XML_TEXTWRITER_NONE: - return -1; - case XML_TEXTWRITER_NAME: - count = xmlOutputBufferWriteString(writer->out, ">"); - if (count < 0) - return -1; - sum += count; - p->state = XML_TEXTWRITER_TEXT; - goto encode; - case XML_TEXTWRITER_PI: - count = xmlOutputBufferWriteString(writer->out, " "); - if (count < 0) - return -1; - sum += count; - p->state = XML_TEXTWRITER_PI_TEXT; - /* fallthrough */ - case XML_TEXTWRITER_PI_TEXT: - case XML_TEXTWRITER_TEXT: - encode: - buf = xmlEncodeSpecialChars(NULL, content); - if (buf == NULL) - count = -1; - break; - case XML_TEXTWRITER_ATTRIBUTE: - xmlAttrSerializeTxtContent(writer->out->buffer, NULL, - NULL, content); - break; - case XML_TEXTWRITER_DTD: - count = xmlOutputBufferWriteString(writer->out, " ["); - if (count < 0) - return -1; - sum += count; - p->state = XML_TEXTWRITER_DTD_TEXT; - /* fallthrough */ - case XML_TEXTWRITER_DTD_TEXT: - case XML_TEXTWRITER_DTD_ELEM: - case XML_TEXTWRITER_CDATA: - case XML_TEXTWRITER_COMMENT: - buf = xmlStrdup(content); - if (buf == NULL) - count = -1; - break; - default: - break; + buf = (xmlChar *) content; + lk = xmlListFront(writer->nodes); + if (lk != 0) { + p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); + if (p != 0) { + switch (p->state) { + case XML_TEXTWRITER_NAME: + case XML_TEXTWRITER_TEXT: + encode: + buf = xmlEncodeSpecialChars(NULL, content); + break; + case XML_TEXTWRITER_ATTRIBUTE: + buf = NULL; + xmlAttrSerializeTxtContent(writer->out->buffer, NULL, + NULL, content); + break; + } + } } - if (writer->indent) - writer->doindent = 0; + if (buf != NULL) { + count = xmlTextWriterWriteRaw(writer, buf); + if (count < 0) + return -1; + sum += count; - if (buf != 0) { - count = - xmlOutputBufferWriteString(writer->out, (const char *) buf); - xmlFree(buf); + if (buf != content) /* buf was allocated by us, so free it */ + xmlFree(buf); } - if (count < 0) - return -1; - sum += count; return sum; } @@ -1449,41 +1448,16 @@ xmlTextWriterWriteBase64(xmlTextWriterPtr writer, const char *data, if (writer == NULL) return -1; - lk = xmlListFront(writer->nodes); - if (lk == 0) - return 0; - - p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); - if (p == 0) - return 0; - sum = 0; - switch (p->state) { - case XML_TEXTWRITER_NONE: - return -1; - case XML_TEXTWRITER_NAME: - count = xmlOutputBufferWriteString(writer->out, ">"); - if (count < 0) - return -1; - sum += count; - p->state = XML_TEXTWRITER_TEXT; - break; - case XML_TEXTWRITER_PI: - count = xmlOutputBufferWriteString(writer->out, " "); - if (count < 0) - return -1; - sum += count; - p->state = XML_TEXTWRITER_PI_TEXT; - break; - case XML_TEXTWRITER_DTD: - count = xmlOutputBufferWriteString(writer->out, " ["); + lk = xmlListFront(writer->nodes); + if (lk != 0) { + p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); + if (p != 0) { + count = xmlTextWriterHandleStateDependencies(writer, p); if (count < 0) return -1; sum += count; - p->state = XML_TEXTWRITER_DTD_TEXT; - break; - default: - break; + } } if (writer->indent) @@ -1565,41 +1539,16 @@ xmlTextWriterWriteBinHex(xmlTextWriterPtr writer, const char *data, if (writer == NULL) return -1; - lk = xmlListFront(writer->nodes); - if (lk == 0) - return 0; - - p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); - if (p == 0) - return 0; - sum = 0; - switch (p->state) { - case XML_TEXTWRITER_NONE: - return -1; - case XML_TEXTWRITER_NAME: - count = xmlOutputBufferWriteString(writer->out, ">"); - if (count < 0) - return -1; - sum += count; - p->state = XML_TEXTWRITER_TEXT; - break; - case XML_TEXTWRITER_PI: - count = xmlOutputBufferWriteString(writer->out, " "); - if (count < 0) - return -1; - sum += count; - p->state = XML_TEXTWRITER_PI_TEXT; - break; - case XML_TEXTWRITER_DTD: - count = xmlOutputBufferWriteString(writer->out, " ["); + lk = xmlListFront(writer->nodes); + if (lk != 0) { + p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); + if (p != 0) { + count = xmlTextWriterHandleStateDependencies(writer, p); if (count < 0) return -1; sum += count; - p->state = XML_TEXTWRITER_DTD_TEXT; - break; - default: - break; + } } if (writer->indent) @@ -2741,7 +2690,20 @@ xmlTextWriterStartDTD(xmlTextWriterPtr writer, return -1; } - count = xmlOutputBufferWriteString(writer->out, " PUBLIC \""); + if (writer->indent) + count = xmlOutputBufferWrite(writer->out, 1, "\n"); + else + count = xmlOutputBufferWrite(writer->out, 1, " "); + if (count < 0) + return -1; + sum += count; + + count = xmlOutputBufferWriteString(writer->out, "PUBLIC "); + if (count < 0) + return -1; + sum += count; + + count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar); if (count < 0) return -1; sum += count; @@ -2752,7 +2714,7 @@ xmlTextWriterStartDTD(xmlTextWriterPtr writer, return -1; sum += count; - count = xmlOutputBufferWriteString(writer->out, "\""); + count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar); if (count < 0) return -1; sum += count; @@ -2760,13 +2722,25 @@ xmlTextWriterStartDTD(xmlTextWriterPtr writer, if (sysid != 0) { if (pubid == 0) { - count = xmlOutputBufferWriteString(writer->out, " SYSTEM"); + if (writer->indent) + count = xmlOutputBufferWrite(writer->out, 1, "\n"); + else + count = xmlOutputBufferWrite(writer->out, 1, " "); + if (count < 0) + return -1; + sum += count; + count = xmlOutputBufferWriteString(writer->out, "SYSTEM "); + if (count < 0) + return -1; + sum += count; + } else if (writer->indent) { + count = xmlOutputBufferWriteString(writer->out, "\n "); if (count < 0) return -1; sum += count; } - count = xmlOutputBufferWriteString(writer->out, " \""); + count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar); if (count < 0) return -1; sum += count; @@ -2777,7 +2751,7 @@ xmlTextWriterStartDTD(xmlTextWriterPtr writer, return -1; sum += count; - count = xmlOutputBufferWriteString(writer->out, "\""); + count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar); if (count < 0) return -1; sum += count; @@ -2797,6 +2771,7 @@ xmlTextWriterStartDTD(xmlTextWriterPtr writer, int xmlTextWriterEndDTD(xmlTextWriterPtr writer) { + int loop; int count; int sum; xmlLinkPtr lk; @@ -2806,34 +2781,59 @@ xmlTextWriterEndDTD(xmlTextWriterPtr writer) return -1; sum = 0; - lk = xmlListFront(writer->nodes); - if (lk == 0) - return -1; + loop = 1; + while (loop) { + lk = xmlListFront(writer->nodes); + if (lk == NULL) + break; + p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); + if (p == 0) + break; + switch (p->state) { + case XML_TEXTWRITER_DTD_TEXT: + count = xmlOutputBufferWriteString(writer->out, "]"); + if (count < 0) + return -1; + sum += count; + /* fallthrough */ + case XML_TEXTWRITER_DTD: + count = xmlOutputBufferWriteString(writer->out, ">"); - p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); - if (p == 0) - return -1; + if (writer->indent) { + if (count < 0) + return -1; + sum += count; + count = xmlOutputBufferWriteString(writer->out, "\n"); + } - switch (p->state) { - case XML_TEXTWRITER_DTD_TEXT: - count = xmlOutputBufferWriteString(writer->out, "]"); - if (count < 0) - return -1; - sum += count; - /* fallthrough */ - case XML_TEXTWRITER_DTD: - case XML_TEXTWRITER_DTD_ELEM: - case XML_TEXTWRITER_DTD_ATTL: - count = xmlOutputBufferWriteString(writer->out, ">"); - if (count < 0) - return -1; - sum += count; - break; - default: + xmlListPopFront(writer->nodes); + break; + case XML_TEXTWRITER_DTD_ELEM: + case XML_TEXTWRITER_DTD_ELEM_TEXT: + count = xmlTextWriterEndDTDElement(writer); + break; + case XML_TEXTWRITER_DTD_ATTL: + case XML_TEXTWRITER_DTD_ATTL_TEXT: + count = xmlTextWriterEndDTDAttlist(writer); + break; + case XML_TEXTWRITER_DTD_ENTY: + case XML_TEXTWRITER_DTD_PENT: + case XML_TEXTWRITER_DTD_ENTY_TEXT: + count = xmlTextWriterEndDTDEntity(writer); + break; + case XML_TEXTWRITER_COMMENT: + count = xmlTextWriterEndComment(writer); + break; + default: + loop = 0; + continue; + } + + if (count < 0) return -1; + sum += count; } - xmlListPopFront(writer->nodes); return sum; } @@ -2971,27 +2971,27 @@ xmlTextWriterStartDTDElement(xmlTextWriterPtr writer, const xmlChar * name) } p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); - if (p == 0) - return -1; - - switch (p->state) { - case XML_TEXTWRITER_DTD: - count = xmlOutputBufferWriteString(writer->out, " ["); - if (count < 0) - return -1; - sum += count; - p->state = XML_TEXTWRITER_DTD_TEXT; - /* fallthrough */ - case XML_TEXTWRITER_DTD_TEXT: - break; - case XML_TEXTWRITER_DTD_ELEM: - count = xmlTextWriterEndDTDElement(writer); - if (count < 0) + if (p != 0) { + switch (p->state) { + case XML_TEXTWRITER_DTD: + count = xmlOutputBufferWriteString(writer->out, " ["); + if (count < 0) + return -1; + sum += count; + if (writer->indent) { + count = xmlOutputBufferWriteString(writer->out, "\n"); + if (count < 0) + return -1; + sum += count; + } + p->state = XML_TEXTWRITER_DTD_TEXT; + /* fallthrough */ + case XML_TEXTWRITER_DTD_TEXT: + case XML_TEXTWRITER_NONE: + break; + default: return -1; - sum += count; - break; - default: - return -1; + } } p = (xmlTextWriterStackEntry *) @@ -3013,6 +3013,13 @@ xmlTextWriterStartDTDElement(xmlTextWriterPtr writer, const xmlChar * name) xmlListPushFront(writer->nodes, p); + if (writer->indent) { + count = xmlTextWriterWriteIndent(writer); + if (count < 0) + return -1; + sum += count; + } + count = xmlOutputBufferWriteString(writer->out, "<!ELEMENT "); if (count < 0) return -1; @@ -3026,6 +3033,57 @@ xmlTextWriterStartDTDElement(xmlTextWriterPtr writer, const xmlChar * name) } /** + * xmlTextWriterEndDTDElement: + * @writer: the xmlTextWriterPtr + * + * End an xml DTD element. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ +int +xmlTextWriterEndDTDElement(xmlTextWriterPtr writer) +{ + int count; + int sum; + xmlLinkPtr lk; + xmlTextWriterStackEntry *p; + + if (writer == NULL) + return -1; + + sum = 0; + lk = xmlListFront(writer->nodes); + if (lk == 0) + return -1; + + p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); + if (p == 0) + return -1; + + switch (p->state) { + case XML_TEXTWRITER_DTD_ELEM: + case XML_TEXTWRITER_DTD_ELEM_TEXT: + count = xmlOutputBufferWriteString(writer->out, ">"); + if (count < 0) + return -1; + sum += count; + break; + default: + return -1; + } + + if (writer->indent) { + count = xmlOutputBufferWriteString(writer->out, "\n"); + if (count < 0) + return -1; + sum += count; + } + + xmlListPopFront(writer->nodes); + return sum; +} + +/** * xmlTextWriterWriteFormatDTDElement: * @writer: the xmlTextWriterPtr * @name: the name of the DTD element @@ -3110,10 +3168,6 @@ xmlTextWriterWriteDTDElement(xmlTextWriterPtr writer, return -1; sum += count; - count = xmlTextWriterWriteString(writer, BAD_CAST " "); - if (count == -1) - return -1; - sum += count; count = xmlTextWriterWriteString(writer, content); if (count == -1) return -1; @@ -3154,29 +3208,27 @@ xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer, const xmlChar * name) } p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); - if (p == 0) - return -1; - - switch (p->state) { - case XML_TEXTWRITER_DTD: - count = xmlOutputBufferWriteString(writer->out, " ["); - if (count < 0) - return -1; - sum += count; - p->state = XML_TEXTWRITER_DTD_TEXT; - /* fallthrough */ - case XML_TEXTWRITER_DTD_TEXT: - break; - case XML_TEXTWRITER_DTD_ELEM: - case XML_TEXTWRITER_DTD_ATTL: - case XML_TEXTWRITER_DTD_ENTY: - count = xmlTextWriterEndDTD(writer); - if (count < 0) + if (p != 0) { + switch (p->state) { + case XML_TEXTWRITER_DTD: + count = xmlOutputBufferWriteString(writer->out, " ["); + if (count < 0) + return -1; + sum += count; + if (writer->indent) { + count = xmlOutputBufferWriteString(writer->out, "\n"); + if (count < 0) + return -1; + sum += count; + } + p->state = XML_TEXTWRITER_DTD_TEXT; + /* fallthrough */ + case XML_TEXTWRITER_DTD_TEXT: + case XML_TEXTWRITER_NONE: + break; + default: return -1; - sum += count; - break; - default: - return -1; + } } p = (xmlTextWriterStackEntry *) @@ -3198,6 +3250,13 @@ xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer, const xmlChar * name) xmlListPushFront(writer->nodes, p); + if (writer->indent) { + count = xmlTextWriterWriteIndent(writer); + if (count < 0) + return -1; + sum += count; + } + count = xmlOutputBufferWriteString(writer->out, "<!ATTLIST "); if (count < 0) return -1; @@ -3211,6 +3270,57 @@ xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer, const xmlChar * name) } /** + * xmlTextWriterEndDTDAttlist: + * @writer: the xmlTextWriterPtr + * + * End an xml DTD attribute list. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ +int +xmlTextWriterEndDTDAttlist(xmlTextWriterPtr writer) +{ + int count; + int sum; + xmlLinkPtr lk; + xmlTextWriterStackEntry *p; + + if (writer == NULL) + return -1; + + sum = 0; + lk = xmlListFront(writer->nodes); + if (lk == 0) + return -1; + + p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); + if (p == 0) + return -1; + + switch (p->state) { + case XML_TEXTWRITER_DTD_ATTL: + case XML_TEXTWRITER_DTD_ATTL_TEXT: + count = xmlOutputBufferWriteString(writer->out, ">"); + if (count < 0) + return -1; + sum += count; + break; + default: + return -1; + } + + if (writer->indent) { + count = xmlOutputBufferWriteString(writer->out, "\n"); + if (count < 0) + return -1; + sum += count; + } + + xmlListPopFront(writer->nodes); + return sum; +} + +/** * xmlTextWriterWriteFormatDTDAttlist: * @writer: the xmlTextWriterPtr * @name: the name of the DTD ATTLIST @@ -3295,10 +3405,6 @@ xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr writer, return -1; sum += count; - count = xmlTextWriterWriteString(writer, BAD_CAST " "); - if (count == -1) - return -1; - sum += count; count = xmlTextWriterWriteString(writer, content); if (count == -1) return -1; @@ -3336,34 +3442,32 @@ xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer, sum = 0; lk = xmlListFront(writer->nodes); - if (lk == 0) { - return -1; - } - - p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); - if (p == 0) - return -1; + if (lk != 0) { - switch (p->state) { - case XML_TEXTWRITER_DTD: - count = xmlOutputBufferWriteString(writer->out, " ["); - if (count < 0) - return -1; - sum += count; - p->state = XML_TEXTWRITER_DTD_TEXT; - /* fallthrough */ - case XML_TEXTWRITER_DTD_TEXT: - break; - case XML_TEXTWRITER_DTD_ELEM: - case XML_TEXTWRITER_DTD_ATTL: - case XML_TEXTWRITER_DTD_ENTY: - count = xmlTextWriterEndDTD(writer); - if (count < 0) - return -1; - sum += count; - break; - default: - return -1; + p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); + if (p != 0) { + switch (p->state) { + case XML_TEXTWRITER_DTD: + count = xmlOutputBufferWriteString(writer->out, " ["); + if (count < 0) + return -1; + sum += count; + if (writer->indent) { + count = + xmlOutputBufferWriteString(writer->out, "\n"); + if (count < 0) + return -1; + sum += count; + } + p->state = XML_TEXTWRITER_DTD_TEXT; + /* fallthrough */ + case XML_TEXTWRITER_DTD_TEXT: + case XML_TEXTWRITER_NONE: + break; + default: + return -1; + } + } } p = (xmlTextWriterStackEntry *) @@ -3381,17 +3485,28 @@ xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer, xmlFree(p); return -1; } - p->state = XML_TEXTWRITER_DTD_ENTY; + + if (pe != 0) + p->state = XML_TEXTWRITER_DTD_PENT; + else + p->state = XML_TEXTWRITER_DTD_ENTY; xmlListPushFront(writer->nodes, p); + if (writer->indent) { + count = xmlTextWriterWriteIndent(writer); + if (count < 0) + return -1; + sum += count; + } + count = xmlOutputBufferWriteString(writer->out, "<!ENTITY "); if (count < 0) return -1; sum += count; if (pe != 0) { - count = xmlOutputBufferWriteString(writer->out, " % "); + count = xmlOutputBufferWriteString(writer->out, "% "); if (count < 0) return -1; sum += count; @@ -3406,6 +3521,63 @@ xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer, } /** + * xmlTextWriterEndDTDEntity: + * @writer: the xmlTextWriterPtr + * + * End an xml DTD entity. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ +int +xmlTextWriterEndDTDEntity(xmlTextWriterPtr writer) +{ + int count; + int sum; + xmlLinkPtr lk; + xmlTextWriterStackEntry *p; + + if (writer == NULL) + return -1; + + sum = 0; + lk = xmlListFront(writer->nodes); + if (lk == 0) + return -1; + + p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); + if (p == 0) + return -1; + + switch (p->state) { + case XML_TEXTWRITER_DTD_ENTY_TEXT: + count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar); + if (count < 0) + return -1; + sum += count; + case XML_TEXTWRITER_DTD_ENTY: + case XML_TEXTWRITER_DTD_PENT: + enddtd: + count = xmlOutputBufferWriteString(writer->out, ">"); + if (count < 0) + return -1; + sum += count; + break; + default: + return -1; + } + + if (writer->indent) { + count = xmlOutputBufferWriteString(writer->out, "\n"); + if (count < 0) + return -1; + sum += count; + } + + xmlListPopFront(writer->nodes); + return sum; +} + +/** * xmlTextWriterWriteFormatDTDInternalEntity: * @writer: the xmlTextWriterPtr * @pe: TRUE if this is a parameter entity, FALSE if not @@ -3493,13 +3665,12 @@ xmlTextWriterWriteDTDEntity(xmlTextWriterPtr writer, const xmlChar * ndataid, const xmlChar * content) { - if (((content == NULL) && (pubid == NULL) && (sysid == NULL)) - || ((content != NULL) && ((pubid != NULL) || (sysid != NULL)))) + if ((content == NULL) && (pubid == NULL) && (sysid == NULL)) return -1; if ((pe != 0) && (ndataid != NULL)) return -1; - if (content != 0) + if ((pubid == NULL) && (sysid == NULL)) return xmlTextWriterWriteDTDInternalEntity(writer, pe, name, content); @@ -3536,22 +3707,10 @@ xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer, return -1; sum += count; - count = xmlTextWriterWriteString(writer, BAD_CAST " "); - if (count == -1) - return -1; - sum += count; - count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar); - if (count < 0) - return -1; - sum += count; count = xmlTextWriterWriteString(writer, content); if (count == -1) return -1; sum += count; - count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar); - if (count < 0) - return -1; - sum += count; count = xmlTextWriterEndDTDEntity(writer); if (count == -1) @@ -3570,7 +3729,7 @@ xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer, * @sysid: the system identifier, which is the URI of the DTD * @ndataid: the xml notation name. * - * Write a DTD internal entity. + * Write a DTD external entity. The entity must have been started with xmlTextWriterStartDTDEntity * * Returns the bytes written (may be 0 because of buffering) or -1 in case of error */ @@ -3585,8 +3744,7 @@ xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer, int count; int sum; - if ((name == NULL) || (*name == '\0') - || ((pubid == NULL) && (sysid == NULL))) + if (((pubid == NULL) && (sysid == NULL))) return -1; if ((pe != 0) && (ndataid != NULL)) return -1; @@ -3597,10 +3755,81 @@ xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer, return -1; sum += count; + count = + xmlTextWriterWriteDTDExternalEntityContents(writer, pubid, sysid, + ndataid); + if (count < 0) + return -1; + sum += count; + + count = xmlTextWriterEndDTDEntity(writer); + if (count == -1) + return -1; + sum += count; + + return sum; +} + +/** + * xmlTextWriterWriteDTDExternalEntityContents: + * @writer: the xmlTextWriterPtr + * @pubid: the public identifier, which is an alternative to the system identifier + * @sysid: the system identifier, which is the URI of the DTD + * @ndataid: the xml notation name. + * + * Write the contents of a DTD external entity. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ +int +xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr writer, + const xmlChar * pubid, + const xmlChar * sysid, + const xmlChar * ndataid) +{ + int count; + int sum; + xmlLinkPtr lk; + xmlTextWriterStackEntry *p; + + if (writer == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlTextWriterWriteDTDExternalEntityContents: xmlTextWriterPtr invalid!\n"); + return -1; + } + + sum = 0; + lk = xmlListFront(writer->nodes); + if (lk == 0) { + xmlGenericError(xmlGenericErrorContext, + "xmlTextWriterWriteDTDExternalEntityContents: you must call xmlTextWriterStartDTDEntity before the call to this function!\n"); + return -1; + } + + p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); + if (p == 0) + return -1; + + switch (p->state) { + case XML_TEXTWRITER_DTD_ENTY: + break; + case XML_TEXTWRITER_DTD_PENT: + if (ndataid != NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlTextWriterWriteDTDExternalEntityContents: notation not allowed with parameter entities!\n"); + return -1; + } + break; + default: + xmlGenericError(xmlGenericErrorContext, + "xmlTextWriterWriteDTDExternalEntityContents: you must call xmlTextWriterStartDTDEntity before the call to this function!\n"); + return -1; + } + if (pubid != 0) { if (sysid == 0) { xmlGenericError(xmlGenericErrorContext, - "xmlTextWriterWriteDTDEntity : system identifier needed!\n"); + "xmlTextWriterWriteDTDExternalEntityContents: system identifier needed!\n"); return -1; } @@ -3670,11 +3899,6 @@ xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer, sum += count; } - count = xmlTextWriterEndDTDEntity(writer); - if (count == -1) - return -1; - sum += count; - return sum; } @@ -3709,29 +3933,33 @@ xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer, } p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk); - if (p == 0) - return -1; - - switch (p->state) { - case XML_TEXTWRITER_DTD: - count = xmlOutputBufferWriteString(writer->out, " ["); - if (count < 0) - return -1; - sum += count; - p->state = XML_TEXTWRITER_DTD_TEXT; - /* fallthrough */ - case XML_TEXTWRITER_DTD_TEXT: - break; - case XML_TEXTWRITER_DTD_ELEM: - case XML_TEXTWRITER_DTD_ATTL: - case XML_TEXTWRITER_DTD_ENTY: - count = xmlTextWriterEndDTD(writer); - if (count < 0) + if (p != 0) { + switch (p->state) { + case XML_TEXTWRITER_DTD: + count = xmlOutputBufferWriteString(writer->out, " ["); + if (count < 0) + return -1; + sum += count; + if (writer->indent) { + count = xmlOutputBufferWriteString(writer->out, "\n"); + if (count < 0) + return -1; + sum += count; + } + p->state = XML_TEXTWRITER_DTD_TEXT; + /* fallthrough */ + case XML_TEXTWRITER_DTD_TEXT: + break; + default: return -1; - sum += count; - break; - default: + } + } + + if (writer->indent) { + count = xmlTextWriterWriteIndent(writer); + if (count < 0) return -1; + sum += count; } count = xmlOutputBufferWriteString(writer->out, "<!NOTATION "); @@ -4162,7 +4390,6 @@ xmlTextWriterSetIndent(xmlTextWriterPtr writer, int indent) int xmlTextWriterSetIndentString(xmlTextWriterPtr writer, const xmlChar * str) { - if (!str) return -1; @@ -4204,4 +4431,74 @@ xmlTextWriterWriteIndent(xmlTextWriterPtr writer) return (lksize - 1); } +/** + * xmlTextWriterHandleStateDependencies: + * @writer: the xmlTextWriterPtr + * @p: the xmlTextWriterStackEntry + * + * Write state dependent strings. + * + * Returns -1 on error or the number of characters written. + */ +static int +xmlTextWriterHandleStateDependencies(xmlTextWriterPtr writer, + xmlTextWriterStackEntry * p) +{ + int count; + int sum; + char extra[3]; + + if (writer == NULL) + return -1; + + if (p == NULL) + return 0; + + sum = 0; + extra[0] = extra[1] = extra[2] = '\0'; + if (p != 0) { + sum = 0; + switch (p->state) { + case XML_TEXTWRITER_NAME: + extra[0] = '>'; + p->state = XML_TEXTWRITER_TEXT; + break; + case XML_TEXTWRITER_PI: + extra[0] = ' '; + p->state = XML_TEXTWRITER_PI_TEXT; + break; + case XML_TEXTWRITER_DTD: + extra[0] = ' '; + extra[1] = '['; + p->state = XML_TEXTWRITER_DTD_TEXT; + break; + case XML_TEXTWRITER_DTD_ELEM: + extra[0] = ' '; + p->state = XML_TEXTWRITER_DTD_ELEM_TEXT; + break; + case XML_TEXTWRITER_DTD_ATTL: + extra[0] = ' '; + p->state = XML_TEXTWRITER_DTD_ATTL_TEXT; + break; + case XML_TEXTWRITER_DTD_ENTY: + case XML_TEXTWRITER_DTD_PENT: + extra[0] = ' '; + extra[1] = writer->qchar; + p->state = XML_TEXTWRITER_DTD_ENTY_TEXT; + break; + default: + break; + } + } + + if (*extra != '\0') { + count = xmlOutputBufferWriteString(writer->out, extra); + if (count < 0) + return -1; + sum += count; + } + + return sum; +} + #endif |