diff --git a/ChangeLog b/ChangeLog index 1a5a542c..23801752 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Thu Nov 20 12:54:30 CET 2003 Daniel Veillard + + * xmlwriter.c include/libxml/xmlwriter.h: applied patch from + Alfred Mickautsch, bugfixes and comments + * doc/examples/*: added his test as the xmlWriter example + * doc/html/ doc/*.html: this resulted in some improvements + * include/libxml/hash.h: fixed an inclusion problem when + wasn't preceeded by + Wed Nov 19 17:19:35 CET 2003 Daniel Veillard * xinclude.c: fix an error message diff --git a/doc/APIchunk0.html b/doc/APIchunk0.html index 15bfdbc8..93642086 100644 --- a/doc/APIchunk0.html +++ b/doc/APIchunk0.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter A:

A-Z
xmlCheckLanguageID
A-Za-z
xmlParseEncName
A-Za-z0-9
xmlParseEncName
@@ -72,6 +72,11 @@ A:link, A:visited, A:active { text-decoration: underline } xmlGetEncodingAlias
xmlNewCharEncodingHandler
xmlParseCharEncoding
+
ATTLIST
xmlTextWriterStartDTDAttlist
+xmlTextWriterStartDTDEntity
+xmlTextWriterWriteDTDAttlist
+xmlTextWriterWriteFormatDTDAttlist
+xmlTextWriterWriteVFormatDTDAttlist
ATTRIBUTE
xmlAddChild
xmlAddNextSibling
xmlAddPrevSibling
@@ -263,6 +268,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk1.html b/doc/APIchunk1.html index 2694149d..99dbcc69 100644 --- a/doc/APIchunk1.html +++ b/doc/APIchunk1.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter C:

C14N
xmlC14NDocSaveTo
xmlC14NExecute
CATALOG
xmlLoadACatalog
@@ -348,6 +348,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk10.html b/doc/APIchunk10.html index 2812ea27..f0811ddd 100644 --- a/doc/APIchunk10.html +++ b/doc/APIchunk10.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter c:

cae
xmlSchemaCheckFacet
call
xmlCharEncOutFunc
xmlCharEncodingOutputFunc
@@ -281,6 +281,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlLsCountNode
xmlNewChild
xmlNewTextChild
+xmlNewTextWriterTree
xmlNodeDump
xmlNodeDumpOutput
xmlParseElementChildrenContentDecl
@@ -463,8 +464,11 @@ A:link, A:visited, A:active { text-decoration: underline }
completely
xmlNodeGetBase
compound
xmlXPathFreeNodeSet
xmlXPtrFreeLocationSet
-
compress
xmlNewTextWriterFilename
+
compress
xmlNewTextWriterDoc
+xmlNewTextWriterFilename
xmlNewTextWriterMemory
+xmlNewTextWriterPushParser
+xmlNewTextWriterTree
compressed
_xmlParserInputBuffer
docbCreateFileParserCtxt
docbParseFile
@@ -488,6 +492,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlGetDocCompressMode
xmlIOHTTPOpenW
xmlNewTextWriterMemory
+xmlNewTextWriterPushParser
xmlOutputBufferCreateFilename
xmlSaveFile
xmlSaveFormatFile
@@ -794,6 +799,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk11.html b/doc/APIchunk11.html index 1ba15686..c2943843 100644 --- a/doc/APIchunk11.html +++ b/doc/APIchunk11.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter d:

dangerous
xmlTextReaderCurrentNode
xmlTextReaderPreserve
day
ftpListCallback
@@ -408,8 +408,10 @@ A:link, A:visited, A:active { text-decoration: underline }
div
xmlXPathDivValues
xmlXPathSubstringFunction
doc
htmlNodeDumpFileFormat
+xmlNewTextWriterDoc
doc-
xmlDocGetRootElement
xmlDocSetRootElement
+xmlNewTextWriterTree
doctypedecl
xmlParseDocTypeDecl
xmlParseDocument
documents
xmlIsID
@@ -553,6 +555,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk12.html b/doc/APIchunk12.html index d033ac8f..66aa9f33 100644 --- a/doc/APIchunk12.html +++ b/doc/APIchunk12.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter e:

each
_xmlParserCtxt
xmlHashCopy
xmlHashScan
@@ -399,6 +399,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk13.html b/doc/APIchunk13.html index 527f0578..eb477b3d 100644 --- a/doc/APIchunk13.html +++ b/doc/APIchunk13.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter f:

fTP
xmlNanoFTPConnectTo
facet
XML_SCHEMAS_FACET_COLLAPSE
XML_SCHEMAS_FACET_PRESERVE
@@ -231,6 +231,9 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextWriterWriteFormatAttributeNS
xmlTextWriterWriteFormatCDATA
xmlTextWriterWriteFormatDTD
+xmlTextWriterWriteFormatDTDAttlist
+xmlTextWriterWriteFormatDTDElement
+xmlTextWriterWriteFormatDTDInternalEntity
xmlTextWriterWriteFormatElement
xmlTextWriterWriteFormatElementNS
xmlTextWriterWriteFormatPI
@@ -240,6 +243,9 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextWriterWriteVFormatAttributeNS
xmlTextWriterWriteVFormatCDATA
xmlTextWriterWriteVFormatDTD
+xmlTextWriterWriteVFormatDTDAttlist
+xmlTextWriterWriteVFormatDTDElement
+xmlTextWriterWriteVFormatDTDInternalEntity
xmlTextWriterWriteVFormatElement
xmlTextWriterWriteVFormatElementNS
xmlTextWriterWriteVFormatPI
@@ -371,6 +377,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk14.html b/doc/APIchunk14.html index 2362e80a..39677aad 100644 --- a/doc/APIchunk14.html +++ b/doc/APIchunk14.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter g:

garbage
xmlGcMemGet
xmlGcMemSetup
genChRanges
xmlIsBaseCharQ
@@ -157,6 +157,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCheckHTTPInput
xmlHandleEntity
xmlNewTextWriterMemory
+xmlNewTextWriterPushParser
xmlOutputBufferWrite
xmlOutputBufferWriteString
xmlParseReference
@@ -261,7 +262,9 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParseElement
xmlRelaxNGParse
xmlSchemaParse
-
hold
xmlReconciliateNs
+
hold
xmlNewTextWriterDoc
+xmlNewTextWriterPushParser
+xmlReconciliateNs
holding
_xmlAttribute
_xmlID
_xmlRef
@@ -347,6 +350,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk15.html b/doc/APIchunk15.html index 801a5285..248b81da 100644 --- a/doc/APIchunk15.html +++ b/doc/APIchunk15.html @@ -31,22 +31,10 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter i:

iconv
LIBXML_ICONV_ENABLED
LIBXML_ISO8859X_ENABLED
-
identifier
_xmlDtd
-_xmlEntity
-_xmlNotation
-_xmlParserInput
-_xmlURI
-xmlAddNotationDecl
-xmlIsXHTML
-xmlParseExternalSubset
-xmlTextWriterStartDTD
-xmlTextWriterWriteDTD
-xmlTextWriterWriteFormatDTD
-xmlTextWriterWriteVFormatDTD
identify
xmlParseAttributeType
ignorable
ignorableWhitespace
ignorableWhitespaceSAXFunc
@@ -498,6 +486,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk16.html b/doc/APIchunk16.html index fd88fd80..061a8c3f 100644 --- a/doc/APIchunk16.html +++ b/doc/APIchunk16.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter j:

just
htmlSetMetaEncoding
inputPop
namePop
@@ -392,6 +392,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk17.html b/doc/APIchunk17.html index 2fb69dfc..5488718e 100644 --- a/doc/APIchunk17.html +++ b/doc/APIchunk17.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter m:

machine
xmlCheckFilename
made
LIBXML_ISO8859X_ENABLED
xmlCharEncOutFunc
@@ -134,9 +134,15 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSAXParseMemoryWithData
xmlTextWriterWriteVFormatAttribute
xmlTextWriterWriteVFormatAttributeNS
+xmlTextWriterWriteVFormatCDATA
xmlTextWriterWriteVFormatComment
+xmlTextWriterWriteVFormatDTD
+xmlTextWriterWriteVFormatDTDAttlist
+xmlTextWriterWriteVFormatDTDElement
+xmlTextWriterWriteVFormatDTDInternalEntity
xmlTextWriterWriteVFormatElement
xmlTextWriterWriteVFormatElementNS
+xmlTextWriterWriteVFormatPI
xmlTextWriterWriteVFormatRaw
xmlTextWriterWriteVFormatString
xmlXPathStringFunction
@@ -286,6 +292,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk18.html b/doc/APIchunk18.html index d4bbe56b..13a8a20e 100644 --- a/doc/APIchunk18.html +++ b/doc/APIchunk18.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter n:

named
xmlAddEncodingAlias
names
_xmlDoc
_xmlParserCtxt
@@ -217,24 +217,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathNormalizeFunction
normalizing
xmlCurrentChar
normally
c
-
notation
notationDecl
-notationDeclSAXFunc
-unparsedEntityDecl
-unparsedEntityDeclSAXFunc
-xmlAddNotationDecl
-xmlCanonicPath
-xmlCopyNotationTable
-xmlDumpNotationDecl
-xmlDumpNotationTable
-xmlFreeNotationTable
-xmlGetDtdNotationDesc
-xmlParseEntityDecl
-xmlParseNotationDecl
-xmlParseNotationType
-xmlSAX2NotationDecl
-xmlSAX2UnparsedEntityDecl
-xmlValidateNotationDecl
-xmlValidateNotationUse
notations
_xmlDtd
xmlValidateDtdFinal
note
xmlCheckUTF8
@@ -293,6 +275,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk19.html b/doc/APIchunk19.html index a02602db..8f641f7b 100644 --- a/doc/APIchunk19.html +++ b/doc/APIchunk19.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter o:

object?
xmlXPathNumberFunction
xmlXPathStringFunction
objects
xmlXPathCompareValues
@@ -279,8 +279,11 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextReaderNormalization
xmlXPathFunction
xmlXPathNodeSetItem
-
output?
xmlNewTextWriterFilename
+
output?
xmlNewTextWriterDoc
+xmlNewTextWriterFilename
xmlNewTextWriterMemory
+xmlNewTextWriterPushParser
+xmlNewTextWriterTree
outside
xmlReconciliateNs
overflow
_xmlParserInput
override
resolveEntity
@@ -324,6 +327,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk2.html b/doc/APIchunk2.html index 5a7da897..94371361 100644 --- a/doc/APIchunk2.html +++ b/doc/APIchunk2.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter D:

DEBUG_MEMORY
DEBUG_MEMORY
DEBUG_MEMORY_FREED
DEBUG_MEMORY
DEBUG_MEMORY_LOCATION
DEBUG_MEMORY
@@ -403,6 +403,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk20.html b/doc/APIchunk20.html index bc6d384e..5386ed16 100644 --- a/doc/APIchunk20.html +++ b/doc/APIchunk20.html @@ -31,35 +31,14 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter p:

pairs
startElement
startElementNsSAX2Func
startElementSAXFunc
xmlSAX2StartElement
xmlSAX2StartElementNs
param
_xmlDtd
-
parameter
XML_SUBSTITUTE_BOTH
-XML_SUBSTITUTE_PEREF
-getParameterEntity
-getParameterEntitySAXFunc
-xmlC14NExecute
-xmlCanonicPath
-xmlGetParameterEntity
-xmlListReverseWalk
-xmlListWalk
-xmlNanoFTPRead
-xmlNanoHTTPRead
-xmlNewDocTextLen
-xmlNewTextLen
-xmlParseElementChildrenContentDecl
-xmlParseEntityRef
-xmlParseMarkupDecl
-xmlParsePEReference
-xmlParserHandlePEReference
-xmlRelaxNGNewDocParserCtxt
-xmlSAX2GetParameterEntity
-xmlSetupParserForBuffer
parameter-entity
xmlParseElementChildrenContentDecl
xmlParseMarkupDecl
parameters
ATTRIBUTE_UNUSED
@@ -319,30 +298,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlElemDump
xmlNodeDump
xmlNodeDumpOutput
-
printf
xmlStrPrintf
-xmlStrVPrintf
-xmlTextWriterWriteFormatAttribute
-xmlTextWriterWriteFormatAttributeNS
-xmlTextWriterWriteFormatCDATA
-xmlTextWriterWriteFormatComment
-xmlTextWriterWriteFormatDTD
-xmlTextWriterWriteFormatElement
-xmlTextWriterWriteFormatElementNS
-xmlTextWriterWriteFormatPI
-xmlTextWriterWriteFormatRaw
-xmlTextWriterWriteFormatString
-xmlTextWriterWriteVFormatAttribute
-xmlTextWriterWriteVFormatAttributeNS
-xmlTextWriterWriteVFormatCDATA
-xmlTextWriterWriteVFormatComment
-xmlTextWriterWriteVFormatDTD
-xmlTextWriterWriteVFormatElement
-xmlTextWriterWriteVFormatElementNS
-xmlTextWriterWriteVFormatPI
-xmlTextWriterWriteVFormatRaw
-xmlTextWriterWriteVFormatString
-xmlValidityErrorFunc
-xmlValidityWarningFunc
prior
xmlSetupParserForBuffer
private
xmlCatalogLocalResolve
xmlCatalogLocalResolveURI
@@ -544,6 +499,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk21.html b/doc/APIchunk21.html index a02e3b6d..73786858 100644 --- a/doc/APIchunk21.html +++ b/doc/APIchunk21.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter q:

qualified
XML_SCHEMAS_QUALIF_ATTR
XML_SCHEMAS_QUALIF_ELEM
xmlGetDtdQAttrDesc
@@ -579,6 +579,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk22.html b/doc/APIchunk22.html index b7fce3d8..c7e9b061 100644 --- a/doc/APIchunk22.html +++ b/doc/APIchunk22.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter s:

safe
BAD_CAST
xmlInitializeCatalog
xmlLoadCatalog
@@ -483,6 +483,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlAutomataNewTransition
xmlAutomataNewTransition2
xmlNewCharRef
+xmlNewTextWriterTree
xmlXPathSubstringFunction
xmlXPtrNewCollapsedRange
xmlXPtrNewRange
@@ -775,6 +776,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk23.html b/doc/APIchunk23.html index 01df70a4..2d368420 100644 --- a/doc/APIchunk23.html +++ b/doc/APIchunk23.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter t:

tag
_htmlElemDesc
htmlAutoCloseTag
htmlIsAutoClosed
@@ -417,6 +417,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk24.html b/doc/APIchunk24.html index d9888885..be72136e 100644 --- a/doc/APIchunk24.html +++ b/doc/APIchunk24.html @@ -7,7 +7,7 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -API Alphabetic Index u-v for libxml2
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

The XML C parser and toolkit of Gnome

API Alphabetic Index u-v for libxml2

Developer Menu
API Indexes
Related links

A-B +API Alphabetic Index u-w for libxml2
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

The XML C parser and toolkit of Gnome

API Alphabetic Index u-w for libxml2

Developer Menu
API Indexes
Related links

A-B C-C D-E F-I @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter u:

ugly
_xmlParserCtxt
htmlEntityLookup
htmlEntityValueLookup
@@ -210,21 +210,6 @@ A:link, A:visited, A:active { text-decoration: underline }
varags
xmlGenericErrorFunc
vararg
xmlValidityErrorFunc
xmlValidityWarningFunc
-
variable
_xmlXPathContext
-_xmlXPathVariable
-xmlTextWriterWriteVFormatAttribute
-xmlTextWriterWriteVFormatAttributeNS
-xmlTextWriterWriteVFormatComment
-xmlTextWriterWriteVFormatElement
-xmlTextWriterWriteVFormatElementNS
-xmlTextWriterWriteVFormatRaw
-xmlTextWriterWriteVFormatString
-xmlXPathRegisterVariable
-xmlXPathRegisterVariableLookup
-xmlXPathRegisterVariableNS
-xmlXPathVariableLookup
-xmlXPathVariableLookupFunc
-xmlXPathVariableLookupNS
variables
_xmlXPathContext
xmlNanoFTPProxy
xmlXPathRegisteredNsCleanup
@@ -241,6 +226,201 @@ A:link, A:visited, A:active { text-decoration: underline }
visible
xmlC14NExecute
void
xmlSAXParseFileWithData
xmlSAXParseMemoryWithData
+

Letter w:

walker
xmlListReverseWalk
+xmlListWalk
+xmlListWalker
+
walking
_xmlXPathContext
+_xmlXPathParserContext
+xmlListWalker
+
want
xmlCharEncFirstLine
+xmlCharEncInFunc
+xmlCharEncOutFunc
+
warn
xmlCheckVersion
+
warning
_xmlValidCtxt
+docbCreatePushParserCtxt
+htmlCreatePushParserCtxt
+initxmlDefaultSAXHandler
+warningSAXFunc
+xmlCreatePushParserCtxt
+xmlEncodeEntities
+xmlParserValidityWarning
+xmlParserWarning
+xmlRelaxNGGetParserErrors
+xmlRelaxNGGetValidErrors
+xmlRelaxNGSetParserErrors
+xmlRelaxNGSetValidErrors
+xmlSAX2InitDefaultSAXHandler
+xmlSchemaSetParserErrors
+xmlSchemaSetValidErrors
+xmlSearchNs
+xmlTextReaderSetErrorHandler
+xmlValidityWarningFunc
+
warnings
_xmlParserCtxt
+xmlPedanticParserDefault
+xmlTextReaderSetErrorHandler
+
way
HTML_COMMENT_NODE
+HTML_ENTITY_REF_NODE
+HTML_PI_NODE
+HTML_PRESERVE_NODE
+HTML_TEXT_NODE
+_xmlDoc
+xmlBoolToText
+xmlKeepBlanksDefault
+xmlNewGlobalNs
+
ways:
xmlValidGetValidElements
+
well
_xmlParserCtxt
+htmlSAXParseDoc
+htmlSAXParseFile
+startElementNsSAX2Func
+xmlCopyDoc
+xmlParseBalancedChunkMemory
+xmlParseBalancedChunkMemoryRecover
+xmlParseCtxtExternalEntity
+xmlParseExternalEntity
+xmlSAX2StartElementNs
+
well-balanced
xmlParseBalancedChunkMemory
+xmlParseBalancedChunkMemoryRecover
+
well-formed
xmlParseCtxtExternalEntity
+xmlParseEntityRef
+xmlParseExtParsedEnt
+xmlParseExternalEntity
+xmlParserHandleReference
+xmlValidateDtdFinal
+
well-formedness
xmlCtxtResetLastError
+xmlParseEntityRef
+xmlResetLastError
+
wellformed
xmlParseFile
+
were
_xmlParserCtxt
+xmlCheckLanguageID
+xmlKeepBlanksDefault
+xmlMemShow
+xmlXIncludeProcess
+xmlXIncludeProcessNode
+xmlXIncludeProcessTree
+
wether
_xmlNodeSet
+
what
xmlCatalogGetDefaults
+xmlCatalogSetDefaults
+xmlParseNamespace
+xmlTextReaderGetRemainder
+
where
_htmlElemDesc
+xmlCopyProp
+xmlCopyPropList
+xmlFileRead
+xmlIOFTPRead
+xmlIOHTTPRead
+xmlNanoHTTPFetch
+xmlNanoHTTPSave
+xmlNewNs
+xmlParseMarkupDecl
+xmlParseSDDecl
+
while
xmlInitCharEncodingHandlers
+xmlParseAttributeType
+xmlParseEnumeratedType
+xmlParseEnumerationType
+xmlParseNotationType
+xmlSetGenericErrorFunc
+xmlSetStructuredErrorFunc
+xmlTextReaderNext
+xmlTextReaderNextSibling
+xmlValidGetValidElements
+
white
xmlKeepBlanksDefault
+xmlParseSDDecl
+xmlTextReaderNormalization
+xmlXPathNormalizeFunction
+
whitespace
xmlIsBlankNode
+xmlParseAttValue
+xmlXPathIdFunction
+xmlXPathNormalizeFunction
+
whitespace-separated
xmlXPathIdFunction
+
whitespaces
ignorableWhitespace
+ignorableWhitespaceSAXFunc
+xmlSAX2IgnorableWhitespace
+
whose
xmlAutomataNewCountTrans
+xmlAutomataNewOnceTrans
+xmlTextReaderLookupNamespace
+
with_ns
_xmlNodeSet
+
within
_xmlValidCtxt
+xmlAutomataNewCounterTrans
+xmlNewDocComment
+xmlNewDocNode
+xmlNewDocNodeEatName
+xmlNewDocRawNode
+xmlNewDocText
+xmlNodeGetBase
+xmlParseCharData
+xmlParseComment
+xmlParseCtxtExternalEntity
+xmlParseMarkupDecl
+xmlParseSDDecl
+xmlParserFindNodeInfo
+xmlParserHandlePEReference
+xmlParserPrintFileContext
+xmlReconciliateNs
+xmlSAXParseFileWithData
+xmlSAXParseMemoryWithData
+xmlSearchNs
+xmlTextReaderConstXmlLang
+xmlTextReaderXmlLang
+xmlTextWriterWriteBase64
+xmlTextWriterWriteBinHex
+xmlValidGetValidElements
+xmlXPathIntersection
+
without
_xmlEntity
+entityDecl
+entityDeclSAXFunc
+htmlNewDocNoDtD
+xmlNewGlobalNs
+xmlParseEntityRef
+xmlParsePEReference
+xmlParseSDDecl
+xmlParserHandlePEReference
+xmlSAX2EntityDecl
+xmlScanName
+xmlValidateOneAttribute
+xmlValidateOneNamespace
+
won
_xmlParserCtxt
+xmlBufferCreateStatic
+xmlLoadSGMLSuperCatalog
+xmlParseAttValue
+
word
_htmlElemDesc
+
words
xmlXPathNormalizeFunction
+xmlXPathStringLengthFunction
+
work
XML_GET_LINE
+xmlNodeGetBase
+xmlRemoveProp
+xmlSAXParseDoc
+xmlSAXParseFile
+xmlSAXParseFileWithData
+xmlSAXParseMemory
+xmlSAXParseMemoryWithData
+
worked
xmlNanoFTPCwd
+xmlNanoFTPDele
+
works
xmlShellDu
+
would
htmlAutoCloseTag
+
write
xmlFileRead
+xmlFindCharEncodingHandler
+xmlGetCharEncodingHandler
+xmlIOFTPRead
+xmlIOHTTPRead
+xmlNewCharEncodingHandler
+xmlOutputBufferCreateIO
+xmlOutputWriteCallback
+xmlShellWrite
+
writer
xmlFreeTextWriter
+
writes
xmlBufferWriteQuotedString
+xmlOutputBufferWrite
+xmlOutputBufferWriteString
+
writing
xmlOutputBufferCreateFilename
+
www
getSystemId
+xmlC14NDocDumpMemory
+xmlC14NDocSave
+xmlC14NDocSaveTo
+xmlC14NExecute
+xmlGetCharEncodingName
+xmlParserHandlePEReference
+xmlParserHandleReference
+xmlSAX2GetSystemId
+xmlSchemaGetPredefinedType

A-B C-C D-E @@ -265,6 +445,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk25.html b/doc/APIchunk25.html index 1a9bb1cc..61e7ac7e 100644 --- a/doc/APIchunk25.html +++ b/doc/APIchunk25.html @@ -7,7 +7,7 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -API Alphabetic Index w-x for libxml2
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

The XML C parser and toolkit of Gnome

API Alphabetic Index w-x for libxml2

Developer Menu
API Indexes
Related links

A-B +API Alphabetic Index x-x for libxml2
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

The XML C parser and toolkit of Gnome

API Alphabetic Index x-x for libxml2

Developer Menu
API Indexes
Related links

A-B C-C D-E F-I @@ -31,204 +31,9 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x -

Letter w:

walker
xmlListReverseWalk
-xmlListWalk
-xmlListWalker
-
walking
_xmlXPathContext
-_xmlXPathParserContext
-xmlListWalker
-
want
xmlCharEncFirstLine
-xmlCharEncInFunc
-xmlCharEncOutFunc
-
warn
xmlCheckVersion
-
warning
_xmlValidCtxt
-docbCreatePushParserCtxt
-htmlCreatePushParserCtxt
-initxmlDefaultSAXHandler
-warningSAXFunc
-xmlCreatePushParserCtxt
-xmlEncodeEntities
-xmlParserValidityWarning
-xmlParserWarning
-xmlRelaxNGGetParserErrors
-xmlRelaxNGGetValidErrors
-xmlRelaxNGSetParserErrors
-xmlRelaxNGSetValidErrors
-xmlSAX2InitDefaultSAXHandler
-xmlSchemaSetParserErrors
-xmlSchemaSetValidErrors
-xmlSearchNs
-xmlTextReaderSetErrorHandler
-xmlValidityWarningFunc
-
warnings
_xmlParserCtxt
-xmlPedanticParserDefault
-xmlTextReaderSetErrorHandler
-
way
HTML_COMMENT_NODE
-HTML_ENTITY_REF_NODE
-HTML_PI_NODE
-HTML_PRESERVE_NODE
-HTML_TEXT_NODE
-_xmlDoc
-xmlBoolToText
-xmlKeepBlanksDefault
-xmlNewGlobalNs
-
ways:
xmlValidGetValidElements
-
well
_xmlParserCtxt
-htmlSAXParseDoc
-htmlSAXParseFile
-startElementNsSAX2Func
-xmlCopyDoc
-xmlParseBalancedChunkMemory
-xmlParseBalancedChunkMemoryRecover
-xmlParseCtxtExternalEntity
-xmlParseExternalEntity
-xmlSAX2StartElementNs
-
well-balanced
xmlParseBalancedChunkMemory
-xmlParseBalancedChunkMemoryRecover
-
well-formed
xmlParseCtxtExternalEntity
-xmlParseEntityRef
-xmlParseExtParsedEnt
-xmlParseExternalEntity
-xmlParserHandleReference
-xmlValidateDtdFinal
-
well-formedness
xmlCtxtResetLastError
-xmlParseEntityRef
-xmlResetLastError
-
wellformed
xmlParseFile
-
were
_xmlParserCtxt
-xmlCheckLanguageID
-xmlKeepBlanksDefault
-xmlMemShow
-xmlXIncludeProcess
-xmlXIncludeProcessNode
-xmlXIncludeProcessTree
-
wether
_xmlNodeSet
-
what
xmlCatalogGetDefaults
-xmlCatalogSetDefaults
-xmlParseNamespace
-xmlTextReaderGetRemainder
-
where
_htmlElemDesc
-xmlCopyProp
-xmlCopyPropList
-xmlFileRead
-xmlIOFTPRead
-xmlIOHTTPRead
-xmlNanoHTTPFetch
-xmlNanoHTTPSave
-xmlNewNs
-xmlParseMarkupDecl
-xmlParseSDDecl
-
while
xmlInitCharEncodingHandlers
-xmlParseAttributeType
-xmlParseEnumeratedType
-xmlParseEnumerationType
-xmlParseNotationType
-xmlSetGenericErrorFunc
-xmlSetStructuredErrorFunc
-xmlTextReaderNext
-xmlTextReaderNextSibling
-xmlValidGetValidElements
-
white
xmlKeepBlanksDefault
-xmlParseSDDecl
-xmlTextReaderNormalization
-xmlXPathNormalizeFunction
-
whitespace
xmlIsBlankNode
-xmlParseAttValue
-xmlXPathIdFunction
-xmlXPathNormalizeFunction
-
whitespace-separated
xmlXPathIdFunction
-
whitespaces
ignorableWhitespace
-ignorableWhitespaceSAXFunc
-xmlSAX2IgnorableWhitespace
-
whose
xmlAutomataNewCountTrans
-xmlAutomataNewOnceTrans
-xmlTextReaderLookupNamespace
-
with_ns
_xmlNodeSet
-
within
_xmlValidCtxt
-xmlAutomataNewCounterTrans
-xmlNewDocComment
-xmlNewDocNode
-xmlNewDocNodeEatName
-xmlNewDocRawNode
-xmlNewDocText
-xmlNodeGetBase
-xmlParseCharData
-xmlParseComment
-xmlParseCtxtExternalEntity
-xmlParseMarkupDecl
-xmlParseSDDecl
-xmlParserFindNodeInfo
-xmlParserHandlePEReference
-xmlParserPrintFileContext
-xmlReconciliateNs
-xmlSAXParseFileWithData
-xmlSAXParseMemoryWithData
-xmlSearchNs
-xmlTextReaderConstXmlLang
-xmlTextReaderXmlLang
-xmlTextWriterWriteBase64
-xmlTextWriterWriteBinHex
-xmlValidGetValidElements
-xmlXPathIntersection
-
without
_xmlEntity
-entityDecl
-entityDeclSAXFunc
-htmlNewDocNoDtD
-xmlNewGlobalNs
-xmlParseEntityRef
-xmlParsePEReference
-xmlParseSDDecl
-xmlParserHandlePEReference
-xmlSAX2EntityDecl
-xmlScanName
-xmlValidateOneAttribute
-xmlValidateOneNamespace
-
won
_xmlParserCtxt
-xmlBufferCreateStatic
-xmlLoadSGMLSuperCatalog
-xmlParseAttValue
-
word
_htmlElemDesc
-
words
xmlXPathNormalizeFunction
-xmlXPathStringLengthFunction
-
work
XML_GET_LINE
-xmlNodeGetBase
-xmlRemoveProp
-xmlSAXParseDoc
-xmlSAXParseFile
-xmlSAXParseFileWithData
-xmlSAXParseMemory
-xmlSAXParseMemoryWithData
-
worked
xmlNanoFTPCwd
-xmlNanoFTPDele
-
works
xmlShellDu
-
would
htmlAutoCloseTag
-
write
xmlFileRead
-xmlFindCharEncodingHandler
-xmlGetCharEncodingHandler
-xmlIOFTPRead
-xmlIOHTTPRead
-xmlNewCharEncodingHandler
-xmlOutputBufferCreateIO
-xmlOutputWriteCallback
-xmlShellWrite
-
writer
xmlFreeTextWriter
-
writes
xmlBufferWriteQuotedString
-xmlOutputBufferWrite
-xmlOutputBufferWriteString
-
writing
xmlOutputBufferCreateFilename
-
www
getSystemId
-xmlC14NDocDumpMemory
-xmlC14NDocSave
-xmlC14NDocSaveTo
-xmlC14NExecute
-xmlGetCharEncodingName
-xmlParserHandlePEReference
-xmlParserHandleReference
-xmlSAX2GetSystemId
-xmlSchemaGetPredefinedType
-

Letter x:

x00B7
IS_EXTENDER
+u-w +x-x +

Letter x:

x00B7
IS_EXTENDER
x02D0
IS_EXTENDER
x02D1
IS_EXTENDER
x0387
IS_EXTENDER
@@ -321,6 +126,8 @@ A:link, A:visited, A:active { text-decoration: underline } setDocumentLocatorSAXFunc
xmlSAX2SetDocumentLocator
xmlDocPtr
xmlCopyDoc
+xmlNewTextWriterDoc
+xmlNewTextWriterTree
xmlTextReaderCurrentDoc
xmlDocumentGetBase
xmlNodeGetBase
xmlDtdPtr
xmlCopyDtd
@@ -436,13 +243,17 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlNewNode
xmlNewNodeEatName
xmlNewTextChild
xmlNewChild
xmlNewTextWriter
xmlNewTextWriter
+xmlNewTextWriterDoc
xmlNewTextWriterFilename
xmlNewTextWriterMemory
+xmlNewTextWriterPushParser
+xmlNewTextWriterTree
xmlNodeListGetString
xmlNodeListGetRawString
xmlNodePtr
xmlCopyNode
xmlCopyNodeList
xmlDocCopyNode
xmlDocGetRootElement
+xmlNewTextWriterTree
xmlTextReaderCurrentNode
xmlTextReaderPreserve
xmlXPathNodeSetAdd
@@ -475,6 +286,7 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlParseNamespace:
xmlParseNamespace
xmlParseURI
xmlURIEscape
xmlParserCtxtPtr
xmlNewParserCtxt
+xmlNewTextWriterPushParser
xmlParserError
_xmlError
xmlParserErrors
docbParseChunk
htmlParseChunk
@@ -662,6 +474,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk3.html b/doc/APIchunk3.html index 98812a72..269e004d 100644 --- a/doc/APIchunk3.html +++ b/doc/APIchunk3.html @@ -31,9 +31,15 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x -

Letter F:

FFFE
IS_CHAR
+u-w +x-x +

Letter F:

FALSE
xmlTextWriterStartDTDEntity
+xmlTextWriterWriteDTDEntity
+xmlTextWriterWriteDTDExternalEntity
+xmlTextWriterWriteDTDInternalEntity
+xmlTextWriterWriteFormatDTDInternalEntity
+xmlTextWriterWriteVFormatDTDInternalEntity
+
FFFE
IS_CHAR
FFFF
IS_CHAR
FIXED
xmlGetNoNsProp
xmlGetNsProp
@@ -329,6 +335,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk4.html b/doc/APIchunk4.html index 808194b3..00f04952 100644 --- a/doc/APIchunk4.html +++ b/doc/APIchunk4.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter J:

Jan
_htmlElemDesc
Java
xmlCheckUTF8

Letter K:

Kanbun
xmlUCSIsKanbun
@@ -319,6 +319,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk5.html b/doc/APIchunk5.html index b9f96e68..8cafb655 100644 --- a/doc/APIchunk5.html +++ b/doc/APIchunk5.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter O:

OBSOLETE:
xmlHandleEntity
ONCE
_xmlElementContent
OPT
_xmlElementContent
@@ -269,6 +269,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk6.html b/doc/APIchunk6.html index 1e30dbab..6a3972f7 100644 --- a/doc/APIchunk6.html +++ b/doc/APIchunk6.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter R:

REC
IS_BASECHAR
IS_COMBINING
IS_DIGIT
@@ -409,6 +409,9 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextWriterStartAttributeNS
xmlTextWriterStartCDATA
xmlTextWriterStartDTD
+xmlTextWriterStartDTDAttlist
+xmlTextWriterStartDTDElement
+xmlTextWriterStartDTDEntity
xmlTextWriterStartDocument
xmlTextWriterStartElement
xmlTextWriterStartElementNS
@@ -460,6 +463,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk7.html b/doc/APIchunk7.html index e331f4ab..c5bb0bb5 100644 --- a/doc/APIchunk7.html +++ b/doc/APIchunk7.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter T:

TEXT
xmlAddChild
xmlAddChildList
xmlAddPrevSibling
@@ -57,6 +57,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNamespaceParseNSDef
xmlNamespaceParseQName
xmlNewTextWriterMemory
+xmlNewTextWriterPushParser
xmlOutputBufferCreateFilename
xmlParseNamespace
xmlParseQuotedString
@@ -64,6 +65,12 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParserInputBufferGrow
xmlScanName
xmlXPathNextAttribute
+
TRUE
xmlTextWriterStartDTDEntity
+xmlTextWriterWriteDTDEntity
+xmlTextWriterWriteDTDExternalEntity
+xmlTextWriterWriteDTDInternalEntity
+xmlTextWriterWriteFormatDTDInternalEntity
+xmlTextWriterWriteVFormatDTDInternalEntity
Tagalog
xmlUCSIsTagalog
Tagbanwa
xmlUCSIsTagbanwa
Tags
xmlUCSIsTags
@@ -258,6 +265,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk8.html b/doc/APIchunk8.html index a35952e3..6a686865 100644 --- a/doc/APIchunk8.html +++ b/doc/APIchunk8.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter V:

Valid
xmlValidateOneElement
Validate
xmlRelaxNGValidateDoc
xmlRelaxNGValidateFullElement
@@ -339,6 +339,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlHashUpdateEntry2
xmlHashUpdateEntry3
xmlXPathSubstringFunction
+
address
xmlNewTextWriterDoc
adds
xmlAutomataNewAllTrans
xmlAutomataNewCountTrans
xmlAutomataNewCountedTrans
@@ -478,6 +479,9 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathStringEvalNumber
alternative
xmlTextWriterStartDTD
xmlTextWriterWriteDTD
+xmlTextWriterWriteDTDEntity
+xmlTextWriterWriteDTDExternalEntity
+xmlTextWriterWriteDTDNotation
xmlTextWriterWriteFormatDTD
xmlTextWriterWriteVFormatDTD
always
INPUT_CHUNK
@@ -653,6 +657,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIchunk9.html b/doc/APIchunk9.html index 90a6f9a4..c568fb10 100644 --- a/doc/APIchunk9.html +++ b/doc/APIchunk9.html @@ -31,8 +31,8 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Letter b:

back
xmlEntityReferenceFunc
xmlKeepBlanksDefault
xmlNanoFTPGet
@@ -276,6 +276,6 @@ A:link, A:visited, A:active { text-decoration: underline } q-r s-s t-t -u-v -w-x +u-w +x-x

Daniel Veillard

diff --git a/doc/APIconstructors.html b/doc/APIconstructors.html index 2a7d0eed..2364f7d6 100644 --- a/doc/APIconstructors.html +++ b/doc/APIconstructors.html @@ -458,8 +458,11 @@ A:link, A:visited, A:active { text-decoration: underline } xmlReaderWalker
xmlReaderForMemory

Type xmlTextWriterPtr:

xmlNewTextWriter
+xmlNewTextWriterDoc
xmlNewTextWriterMemory
xmlNewTextWriterFilename
+xmlNewTextWriterPushParser
+xmlNewTextWriterTree

Type xmlURIPtr:

xmlCreateURI
xmlParseURI

Type xmlValidCtxtPtr:

xmlNewValidCtxt
@@ -496,9 +499,9 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathEval
xmlXPathNewCString
xmlXPathCompiledEval
-xmlXPathVariableLookup
xmlXPtrNewRange
xmlXPathVariableLookupNS
+xmlXPathVariableLookup
xmlXPtrNewRangeNodeObject
xmlXPathConvertBoolean
xmlXPtrEval
diff --git a/doc/APIfiles.html b/doc/APIfiles.html index 689f2544..c15f9003 100644 --- a/doc/APIfiles.html +++ b/doc/APIfiles.html @@ -2469,6 +2469,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextWriterWriteVFormatDTD
xmlTextWriterWriteVFormatCDATA
xmlTextWriterStartAttributeNS
+xmlNewTextWriterPushParser
xmlTextWriterWriteFormatAttributeNS
xmlTextWriterWriteDTDEntity
xmlTextWriterWriteVFormatPI
@@ -2503,9 +2504,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextWriterWriteFormatComment
xmlTextWriterWriteAttributeNS
xmlTextWriterWritePI
-xmlTextWriterWriteVFormatRaw
xmlTextWriterWriteFormatDTDInternalEntity
-xmlTextWriterWriteVFormatString
+xmlTextWriterEndDTDEntity
xmlTextWriterWriteDTDInternalEntity
xmlTextWriterWriteVFormatElementNS
xmlTextWriterWriteDTDNotation
@@ -2514,16 +2514,19 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextWriterWriteString
xmlTextWriterWriteRaw
xmlTextWriterFullEndElement
+xmlTextWriterWriteVFormatString
xmlTextWriterWriteVFormatAttributeNS
xmlTextWriterFlush
xmlTextWriterStartDTD
xmlTextWriterWriteAttribute
+xmlNewTextWriterDoc
xmlTextWriterWriteFormatDTDElement
xmlTextWriterEndDTDAttlist
+xmlNewTextWriterTree
xmlNewTextWriterMemory
xmlTextWriterWriteFormatCDATA
xmlTextWriterStartDTDAttlist
-xmlTextWriterStartDTDElement
+xmlTextWriterWriteVFormatRaw
xmlTextWriterWriteFormatDTD
xmlTextWriterWriteFormatDTDAttlist
xmlTextWriterPtr
@@ -2532,7 +2535,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextWriterWriteFormatAttribute
xmlTextWriterStartDTDEntity
xmlTextWriterWriteVFormatDTDElement
-xmlTextWriterEndDTDEntity
+xmlTextWriterStartDTDElement
xmlTextWriterWriteFormatElementNS

Module xpath:

xmlXPathCastNodeSetToBoolean
_xmlXPathVariable
diff --git a/doc/APIfunctions.html b/doc/APIfunctions.html index 9e635f17..f99d7b0b 100644 --- a/doc/APIfunctions.html +++ b/doc/APIfunctions.html @@ -1309,6 +1309,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNewDtd
xmlNewGlobalNs
xmlNewReference
+xmlNewTextWriterTree
xmlNodeDump
xmlNodeDumpOutput
xmlNodeGetBase
@@ -1365,6 +1366,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathNewContext
xmlXPathOrderDocElems
xmlXPtrNewContext
+

Type xmlDocPtr *:

xmlNewTextWriterDoc

Type xmlDtdPtr:

xmlAddAttributeDecl
xmlAddElementDecl
xmlAddNotationDecl
@@ -1582,6 +1584,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNewNsPropEatName
xmlNewProp
xmlNewTextChild
+xmlNewTextWriterTree
xmlNodeAddContent
xmlNodeAddContentLen
xmlNodeBufGetContent
@@ -1815,6 +1818,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNewInputFromFile
xmlNewInputStream
xmlNewStringInputStream
+xmlNewTextWriterPushParser
xmlNextChar
xmlNoNetExternalEntityLoader
xmlParseAttValue
diff --git a/doc/APIsymbols.html b/doc/APIsymbols.html index 4ccd064e..9f838085 100644 --- a/doc/APIsymbols.html +++ b/doc/APIsymbols.html @@ -1767,8 +1767,11 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNewTextReader
xmlNewTextReaderFilename
xmlNewTextWriter
+xmlNewTextWriterDoc
xmlNewTextWriterFilename
xmlNewTextWriterMemory
+xmlNewTextWriterPushParser
+xmlNewTextWriterTree
xmlNewValidCtxt
xmlNextChar
xmlNoNetExternalEntityLoader
diff --git a/doc/examples/.cvsignore b/doc/examples/.cvsignore index f1f8cbf0..bece6eef 100644 --- a/doc/examples/.cvsignore +++ b/doc/examples/.cvsignore @@ -6,3 +6,4 @@ parse1 parse2 tree1 tree2 +testWriter diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index d5e23313..308bfc78 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -19,9 +19,9 @@ install-data-local: $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR) -@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.out $(DESTDIR)$(TARGET_DIR) -EXTRA_DIST=examples.xsl index.py test1.xml examples.xml test2.xml tree1.out tree2.out +EXTRA_DIST=examples.xsl index.py test1.xml examples.xml test2.xml writer.xml tree1.out tree2.out -noinst_PROGRAMS=xpath1 parse1 parse2 tree1 tree2 +noinst_PROGRAMS=xpath1 parse1 parse2 tree1 tree2 testWriter xpath1_SOURCES=xpath1.c xpath1_LDFLAGS= @@ -48,10 +48,16 @@ tree2_LDFLAGS= tree2_DEPENDENCIES= $(DEPS) tree2_LDADD= @RDL_LIBS@ $(LDADDS) +testWriter_SOURCES=testWriter.c +testWriter_LDFLAGS= +testWriter_DEPENDENCIES= $(DEPS) +testWriter_LDADD= @RDL_LIBS@ $(LDADDS) + tests: $(noinst_PROGRAMS) parse1 test1.xml parse2 test2.xml tree1 test2.xml > tree1.tmp ; diff tree1.tmp tree1.out ; rm tree1.tmp tree2 > tree2.tmp ; diff tree2.tmp tree2.out ; rm tree2.tmp + testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.out ; done ; rm writer*.out diff --git a/doc/examples/examples.xml b/doc/examples/examples.xml index 5c5e5edc..4894e675 100644 --- a/doc/examples/examples.xml +++ b/doc/examples/examples.xml @@ -126,6 +126,51 @@ + + use various APIs for the xmlWriter + tests a number of APIs for the xmlWriter, especially the various methods to write to a filename, to a memory buffer, to a new document, or to a subtree. It shows how to do encoding string conversions too. The resulting documents are then serialized. + testWriter + testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.out ; done ; rm writer*.out + Alfred Mickautsch + see Copyright for the status of this software. +

xmlWriter
+ + <libxml/encoding.h> + <libxml/xmlwriter.h> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -134,6 +179,9 @@ + + + @@ -147,6 +195,15 @@ + + + + + + + + + @@ -167,9 +224,17 @@ + + + + + + + + @@ -177,18 +242,29 @@ + + + + + + + + + + + @@ -202,8 +278,21 @@ + + + + + + + + + + + + + @@ -218,6 +307,12 @@ + + + + + + @@ -227,6 +322,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -261,5 +386,8 @@
+
+ +
diff --git a/doc/examples/index.html b/doc/examples/index.html index abf52872..547fe148 100644 --- a/doc/examples/index.html +++ b/doc/examples/index.html @@ -7,5 +7,5 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Libxml2 set of examples
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

Libxml2 set of examples

Examples Menu
Related links

The examples are stored per section depending on the main focus - of the example:

  • XPath :

    • xpath1.c: Evaluate XPath expression and prints result node set.
  • Parsing :

    • parse1.c: Parse an XML file to a tree and free it
    • parse2.c: Parse and validate an XML file to a tree and free the result
  • Tree :

    • tree1.c: Navigates a tree to print element names
    • tree2.c: Creates a tree

Parsing Examples

parse1.c: Parse an XML file to a tree and free it

Demonstrate the use of xmlReadFile() to read an XML file into a tree and and xmlFreeDoc() to free the resulting tree

Includes:

Uses:

Usage:

parse1 test1.xml

Author: Daniel Veillard

parse2.c: Parse and validate an XML file to a tree and free the result

Create a parser context for an XML file, then parse and validate the file, creating a tree, check the validation result and xmlFreeDoc() to free the resulting tree.

Includes:

Uses:

Usage:

parse2 test2.xml

Author: Daniel Veillard

Tree Examples

tree1.c: Navigates a tree to print element names

Parse a file to a tree, use xmlDocGetRootElement() to get the root element, then walk the document and print all the element name in document order.

Includes:

Uses:

Usage:

tree1 filename_or_URL

Author: Dodji Seketeli

tree2.c: Creates a tree

Shows how to create document, nodes and dump it to stdout or file.

Includes:

Uses:

Usage:

tree2 <filename> -Default output: stdout

Author: Lucas Brasilino <brasilino@recife.pe.gov.br>

XPath Examples

xpath1.c: Evaluate XPath expression and prints result node set.

Shows how to evaluate XPath expression and register known namespaces in XPath context.

Includes:

Uses:

Usage:

xpath1 <xml-file> <xpath-expr> [<known-ns-list>]

Author: Aleksey Sanin

Daniel Veillard

+Libxml2 set of examples
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

Libxml2 set of examples

Examples Menu
Related links

The examples are stored per section depending on the main focus + of the example:

Parsing Examples

parse1.c: Parse an XML file to a tree and free it

Demonstrate the use of xmlReadFile() to read an XML file into a tree and and xmlFreeDoc() to free the resulting tree

Includes:

Uses:

Usage:

parse1 test1.xml

Author: Daniel Veillard

parse2.c: Parse and validate an XML file to a tree and free the result

Create a parser context for an XML file, then parse and validate the file, creating a tree, check the validation result and xmlFreeDoc() to free the resulting tree.

Includes:

Uses:

Usage:

parse2 test2.xml

Author: Daniel Veillard

Tree Examples

tree1.c: Navigates a tree to print element names

Parse a file to a tree, use xmlDocGetRootElement() to get the root element, then walk the document and print all the element name in document order.

Includes:

Uses:

Usage:

tree1 filename_or_URL

Author: Dodji Seketeli

tree2.c: Creates a tree

Shows how to create document, nodes and dump it to stdout or file.

Includes:

Uses:

Usage:

tree2 <filename> -Default output: stdout

Author: Lucas Brasilino <brasilino@recife.pe.gov.br>

XPath Examples

xpath1.c: Evaluate XPath expression and prints result node set.

Shows how to evaluate XPath expression and register known namespaces in XPath context.

Includes:

Uses:

Usage:

xpath1 <xml-file> <xpath-expr> [<known-ns-list>]

Author: Aleksey Sanin

xmlWriter Examples

testWriter.c: use various APIs for the xmlWriter

tests a number of APIs for the xmlWriter, especially the various methods to write to a filename, to a memory buffer, to a new document, or to a subtree. It shows how to do encoding string conversions too. The resulting documents are then serialized.

Includes:

Uses:

Usage:

testWriter

Author: Alfred Mickautsch

Daniel Veillard

diff --git a/doc/examples/testWriter.c b/doc/examples/testWriter.c new file mode 100644 index 00000000..71186aa0 --- /dev/null +++ b/doc/examples/testWriter.c @@ -0,0 +1,1155 @@ +/** + * section: xmlWriter + * synopsis: use various APIs for the xmlWriter + * purpose: tests a number of APIs for the xmlWriter, especially + * the various methods to write to a filename, to a memory + * buffer, to a new document, or to a subtree. It shows how to + * do encoding string conversions too. The resulting + * documents are then serialized. + * usage: testWriter + * test: testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.out ; done ; rm writer*.out + * author: Alfred Mickautsch + * copy: see Copyright for the status of this software. + */ +#include +#include +#include +#include + +#define MY_ENCODING "ISO-8859-1" + +void testXmlwriterFilename(const char *uri); +void testXmlwriterMemory(const char *file); +void testXmlwriterDoc(const char *file); +void testXmlwriterTree(const char *file); +xmlChar *ConvertInput(const char *in, const char *encoding); + +int +main(void) +{ + /* first, the file version */ + testXmlwriterFilename("writer1.out"); + + /* next, the memory version */ + testXmlwriterMemory("writer2.out"); + + /* next, the DOM version */ + testXmlwriterDoc("writer3.out"); + + /* next, the tree version */ + testXmlwriterDoc("writer4.out"); + + return 0; +} + +/** + * testXmlwriterFilename: + * @uri: the output URI + * + * test the xmlWriter interface when writing to a new file + */ +void +testXmlwriterFilename(const char *uri) +{ + int rc; + xmlTextWriterPtr writer; + + /* Create a new XmlWriter for uri, with no compression. */ + writer = xmlNewTextWriterFilename(uri, 0); + if (writer == NULL) { + printf("testXmlwriterFilename: Error creating the xml writer\n"); + return; + } + + /* Start the document with the xml default for the version, + * encoding ISO 8858-1 and the default for the standalone + * declaration. */ + rc = xmlTextWriterStartDocument(writer, NULL, MY_ENCODING, NULL); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterStartDocument\n"); + return; + } + + /* Start an element named "EXAMPLE". Since thist is the first + * element, this will be the root element of the document. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "EXAMPLE"); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write a comment as child of EXAMPLE. + * Please observe, that the input to the xmlTextWriter functions + * HAS to be in UTF-8, even if the output XML is encoded + * in iso-8859-1 */ + rc = xmlTextWriterWriteComment(writer, + ConvertInput + ("This is a comment with special chars: <äöü>", + MY_ENCODING)); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterWriteComment\n"); + return; + } + + /* Start an element named "ORDER" as child of EXAMPLE. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "ORDER"); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Add an attribute with name "version" and value "1.0" to ORDER. */ + rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "version", + BAD_CAST "1.0"); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterWriteAttribute\n"); + return; + } + + /* Add an attribute with name "xml:lang" and value "de" to ORDER. */ + rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xml:lang", + BAD_CAST "de"); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterWriteAttribute\n"); + return; + } + + /* Write a comment as child of ORDER */ + rc = xmlTextWriterWriteFormatComment(writer, + "This is another comment with special chars: %s", + ConvertInput("<äöü>", + MY_ENCODING)); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterWriteFormatComment\n"); + return; + } + + /* Start an element named "HEADER" as child of ORDER. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "HEADER"); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write an element named "X_ORDER_ID" as child of HEADER. */ + rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "X_ORDER_ID", + "%010d", 53535L); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterWriteFormatElement\n"); + return; + } + + /* Write an element named "CUSTOMER_ID" as child of HEADER. */ + rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "CUSTOMER_ID", + "%d", 1010); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterWriteFormatElement\n"); + return; + } + + /* Write an element named "NAME_1" as child of HEADER. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1", + ConvertInput("Müller", MY_ENCODING)); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Write an element named "NAME_2" as child of HEADER. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2", + ConvertInput("Jörg", MY_ENCODING)); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Close the element named HEADER. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Start an element named "ENTRIES" as child of ORDER. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "ENTRIES"); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Start an element named "ENTRY" as child of ENTRIES. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "ENTRY"); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write an element named "ARTICLE" as child of ENTRY. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "ARTICLE", + BAD_CAST ""); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Write an element named "ENTRY_NO" as child of ENTRY. */ + rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "ENTRY_NO", "%d", + 10); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterWriteFormatElement\n"); + return; + } + + /* Close the element named ENTRY. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Start an element named "ENTRY" as child of ENTRIES. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "ENTRY"); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write an element named "ARTICLE" as child of ENTRY. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "ARTICLE", + BAD_CAST ""); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Write an element named "ENTRY_NO" as child of ENTRY. */ + rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "ENTRY_NO", "%d", + 20); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterWriteFormatElement\n"); + return; + } + + /* Close the element named ENTRY. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Close the element named ENTRIES. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Start an element named "FOOTER" as child of ORDER. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "FOOTER"); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write an element named "TEXT" as child of FOOTER. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "TEXT", + BAD_CAST "This is a text."); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Close the element named FOOTER. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Here we could close the elements ORDER and EXAMPLE using the + * function xmlTextWriterEndElement, but since we do not want to + * write any other elements, we simply call xmlTextWriterEndDocument, + * which will do all the work. */ + rc = xmlTextWriterEndDocument(writer); + if (rc < 0) { + printf + ("testXmlwriterFilename: Error at xmlTextWriterEndDocument\n"); + return; + } + + xmlFreeTextWriter(writer); +} + +/** + * testXmlwriterMemory: + * @file: the output file + * + * test the xmlWriter interface when writing to memory + */ +void +testXmlwriterMemory(const char *file) +{ + int rc; + xmlTextWriterPtr writer; + xmlBufferPtr buf; + FILE *fp; + + /* Create a new XML buffer, to which the XML document will be + * written */ + buf = xmlBufferCreate(); + if (buf == NULL) { + printf("testXmlwriterMemory: Error creating the xml buffer\n"); + return; + } + + /* Create a new XmlWriter for memory, with no compression. + * Remark: there is no compression for this kind of xmlTextWriter */ + writer = xmlNewTextWriterMemory(buf, 0); + if (writer == NULL) { + printf("testXmlwriterMemory: Error creating the xml writer\n"); + return; + } + + /* Start the document with the xml default for the version, + * encoding ISO 8858-1 and the default for the standalone + * declaration. */ + rc = xmlTextWriterStartDocument(writer, NULL, MY_ENCODING, NULL); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterStartDocument\n"); + return; + } + + /* Start an element named "EXAMPLE". Since thist is the first + * element, this will be the root element of the document. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "EXAMPLE"); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write a comment as child of EXAMPLE. + * Please observe, that the input to the xmlTextWriter functions + * HAS to be in UTF-8, even if the output XML is encoded + * in iso-8859-1 */ + rc = xmlTextWriterWriteComment(writer, + ConvertInput + ("This is a comment with special chars: <äöü>", + MY_ENCODING)); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterWriteComment\n"); + return; + } + + /* Start an element named "ORDER" as child of EXAMPLE. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "ORDER"); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Add an attribute with name "version" and value "1.0" to ORDER. */ + rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "version", + BAD_CAST "1.0"); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterWriteAttribute\n"); + return; + } + + /* Add an attribute with name "xml:lang" and value "de" to ORDER. */ + rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xml:lang", + BAD_CAST "de"); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterWriteAttribute\n"); + return; + } + + /* Write a comment as child of ORDER */ + rc = xmlTextWriterWriteFormatComment(writer, + "This is another comment with special chars: %s", + ConvertInput("<äöü>", + MY_ENCODING)); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterWriteFormatComment\n"); + return; + } + + /* Start an element named "HEADER" as child of ORDER. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "HEADER"); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write an element named "X_ORDER_ID" as child of HEADER. */ + rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "X_ORDER_ID", + "%010d", 53535L); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterWriteFormatElement\n"); + return; + } + + /* Write an element named "CUSTOMER_ID" as child of HEADER. */ + rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "CUSTOMER_ID", + "%d", 1010); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterWriteFormatElement\n"); + return; + } + + /* Write an element named "NAME_1" as child of HEADER. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1", + ConvertInput("Müller", MY_ENCODING)); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Write an element named "NAME_2" as child of HEADER. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2", + ConvertInput("Jörg", MY_ENCODING)); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Close the element named HEADER. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf("testXmlwriterMemory: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Start an element named "ENTRIES" as child of ORDER. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "ENTRIES"); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Start an element named "ENTRY" as child of ENTRIES. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "ENTRY"); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write an element named "ARTICLE" as child of ENTRY. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "ARTICLE", + BAD_CAST ""); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Write an element named "ENTRY_NO" as child of ENTRY. */ + rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "ENTRY_NO", "%d", + 10); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterWriteFormatElement\n"); + return; + } + + /* Close the element named ENTRY. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf("testXmlwriterMemory: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Start an element named "ENTRY" as child of ENTRIES. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "ENTRY"); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write an element named "ARTICLE" as child of ENTRY. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "ARTICLE", + BAD_CAST ""); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Write an element named "ENTRY_NO" as child of ENTRY. */ + rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "ENTRY_NO", "%d", + 20); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterWriteFormatElement\n"); + return; + } + + /* Close the element named ENTRY. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf("testXmlwriterMemory: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Close the element named ENTRIES. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf("testXmlwriterMemory: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Start an element named "FOOTER" as child of ORDER. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "FOOTER"); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write an element named "TEXT" as child of FOOTER. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "TEXT", + BAD_CAST "This is a text."); + if (rc < 0) { + printf + ("testXmlwriterMemory: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Close the element named FOOTER. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf("testXmlwriterMemory: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Here we could close the elements ORDER and EXAMPLE using the + * function xmlTextWriterEndElement, but since we do not want to + * write any other elements, we simply call xmlTextWriterEndDocument, + * which will do all the work. */ + rc = xmlTextWriterEndDocument(writer); + if (rc < 0) { + printf("testXmlwriterMemory: Error at xmlTextWriterEndDocument\n"); + return; + } + + xmlFreeTextWriter(writer); + + fp = fopen(file, "w"); + if (fp == NULL) { + printf("testXmlwriterMemory: Error at fopen\n"); + return; + } + + fprintf(fp, "%s", (const char *) buf->content); + + fclose(fp); +} + +/** + * testXmlwriterDoc: + * @file: the output file + * + * test the xmlWriter interface when creating a new document + */ +void +testXmlwriterDoc(const char *file) +{ + int rc; + xmlTextWriterPtr writer; + xmlDocPtr doc; + + + /* Create a new XmlWriter for DOM, with no compression. */ + writer = xmlNewTextWriterDoc(&doc, 0); + if (writer == NULL) { + printf("testXmlwriterDoc: Error creating the xml writer\n"); + return; + } + + /* Start the document with the xml default for the version, + * encoding ISO 8858-1 and the default for the standalone + * declaration. */ + rc = xmlTextWriterStartDocument(writer, NULL, MY_ENCODING, NULL); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterStartDocument\n"); + return; + } + + /* Start an element named "EXAMPLE". Since thist is the first + * element, this will be the root element of the document. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "EXAMPLE"); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write a comment as child of EXAMPLE. + * Please observe, that the input to the xmlTextWriter functions + * HAS to be in UTF-8, even if the output XML is encoded + * in iso-8859-1 */ + rc = xmlTextWriterWriteComment(writer, + ConvertInput + ("This is a comment with special chars: <äöü>", + MY_ENCODING)); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterWriteComment\n"); + return; + } + + /* Start an element named "ORDER" as child of EXAMPLE. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "ORDER"); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Add an attribute with name "version" and value "1.0" to ORDER. */ + rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "version", + BAD_CAST "1.0"); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterWriteAttribute\n"); + return; + } + + /* Add an attribute with name "xml:lang" and value "de" to ORDER. */ + rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xml:lang", + BAD_CAST "de"); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterWriteAttribute\n"); + return; + } + + /* Write a comment as child of ORDER */ + rc = xmlTextWriterWriteFormatComment(writer, + "This is another comment with special chars: %s", + ConvertInput("<äöü>", + MY_ENCODING)); + if (rc < 0) { + printf + ("testXmlwriterDoc: Error at xmlTextWriterWriteFormatComment\n"); + return; + } + + /* Start an element named "HEADER" as child of ORDER. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "HEADER"); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write an element named "X_ORDER_ID" as child of HEADER. */ + rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "X_ORDER_ID", + "%010d", 53535L); + if (rc < 0) { + printf + ("testXmlwriterDoc: Error at xmlTextWriterWriteFormatElement\n"); + return; + } + + /* Write an element named "CUSTOMER_ID" as child of HEADER. */ + rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "CUSTOMER_ID", + "%d", 1010); + if (rc < 0) { + printf + ("testXmlwriterDoc: Error at xmlTextWriterWriteFormatElement\n"); + return; + } + + /* Write an element named "NAME_1" as child of HEADER. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1", + ConvertInput("Müller", MY_ENCODING)); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Write an element named "NAME_2" as child of HEADER. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2", + ConvertInput("Jörg", MY_ENCODING)); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Close the element named HEADER. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Start an element named "ENTRIES" as child of ORDER. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "ENTRIES"); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Start an element named "ENTRY" as child of ENTRIES. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "ENTRY"); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write an element named "ARTICLE" as child of ENTRY. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "ARTICLE", + BAD_CAST ""); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Write an element named "ENTRY_NO" as child of ENTRY. */ + rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "ENTRY_NO", "%d", + 10); + if (rc < 0) { + printf + ("testXmlwriterDoc: Error at xmlTextWriterWriteFormatElement\n"); + return; + } + + /* Close the element named ENTRY. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Start an element named "ENTRY" as child of ENTRIES. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "ENTRY"); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write an element named "ARTICLE" as child of ENTRY. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "ARTICLE", + BAD_CAST ""); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Write an element named "ENTRY_NO" as child of ENTRY. */ + rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "ENTRY_NO", "%d", + 20); + if (rc < 0) { + printf + ("testXmlwriterDoc: Error at xmlTextWriterWriteFormatElement\n"); + return; + } + + /* Close the element named ENTRY. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Close the element named ENTRIES. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Start an element named "FOOTER" as child of ORDER. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "FOOTER"); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write an element named "TEXT" as child of FOOTER. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "TEXT", + BAD_CAST "This is a text."); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Close the element named FOOTER. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Here we could close the elements ORDER and EXAMPLE using the + * function xmlTextWriterEndElement, but since we do not want to + * write any other elements, we simply call xmlTextWriterEndDocument, + * which will do all the work. */ + rc = xmlTextWriterEndDocument(writer); + if (rc < 0) { + printf("testXmlwriterDoc: Error at xmlTextWriterEndDocument\n"); + return; + } + + xmlFreeTextWriter(writer); + + xmlSaveFileEnc(file, doc, MY_ENCODING); + + xmlFreeDoc(doc); +} + +/** + * testXmlwriterTree: + * @file: the output file + * + * test the xmlWriter interface when writing to a subtree + */ +void +testXmlwriterTree(const char *file) +{ + int rc; + xmlTextWriterPtr writer; + xmlDocPtr doc; + xmlNodePtr node; + + /* Create a new XML DOM tree, to which the XML document will be + * written */ + doc = xmlNewDoc(BAD_CAST XML_DEFAULT_VERSION); + if (doc == NULL) { + printf + ("testXmlwriterTree: Error creating the xml document tree\n"); + return; + } + + /* Create a new XML node, to which the XML document will be + * appended */ + node = xmlNewDocNode(doc, NULL, BAD_CAST "EXAMPLE", NULL); + if (node == NULL) { + printf("testXmlwriterTree: Error creating the xml node\n"); + return; + } + + /* Make ELEMENT the root node of the tree */ + xmlDocSetRootElement(doc, node); + + /* Create a new XmlWriter for DOM tree, with no compression. */ + writer = xmlNewTextWriterTree(doc, node, 0); + if (writer == NULL) { + printf("testXmlwriterTree: Error creating the xml writer\n"); + return; + } + + /* Start the document with the xml default for the version, + * encoding ISO 8858-1 and the default for the standalone + * declaration. */ + rc = xmlTextWriterStartDocument(writer, NULL, MY_ENCODING, NULL); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterStartDocument\n"); + return; + } + + /* Write a comment as child of EXAMPLE. + * Please observe, that the input to the xmlTextWriter functions + * HAS to be in UTF-8, even if the output XML is encoded + * in iso-8859-1 */ + rc = xmlTextWriterWriteComment(writer, + ConvertInput + ("This is a comment with special chars: <äöü>", + MY_ENCODING)); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterWriteComment\n"); + return; + } + + /* Start an element named "ORDER" as child of EXAMPLE. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "ORDER"); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Add an attribute with name "version" and value "1.0" to ORDER. */ + rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "version", + BAD_CAST "1.0"); + if (rc < 0) { + printf + ("testXmlwriterTree: Error at xmlTextWriterWriteAttribute\n"); + return; + } + + /* Add an attribute with name "xml:lang" and value "de" to ORDER. */ + rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xml:lang", + BAD_CAST "de"); + if (rc < 0) { + printf + ("testXmlwriterTree: Error at xmlTextWriterWriteAttribute\n"); + return; + } + + /* Write a comment as child of ORDER */ + rc = xmlTextWriterWriteFormatComment(writer, + "This is another comment with special chars: %s", + ConvertInput("<äöü>", + MY_ENCODING)); + if (rc < 0) { + printf + ("testXmlwriterTree: Error at xmlTextWriterWriteFormatComment\n"); + return; + } + + /* Start an element named "HEADER" as child of ORDER. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "HEADER"); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write an element named "X_ORDER_ID" as child of HEADER. */ + rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "X_ORDER_ID", + "%010d", 53535L); + if (rc < 0) { + printf + ("testXmlwriterTree: Error at xmlTextWriterWriteFormatElement\n"); + return; + } + + /* Write an element named "CUSTOMER_ID" as child of HEADER. */ + rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "CUSTOMER_ID", + "%d", 1010); + if (rc < 0) { + printf + ("testXmlwriterTree: Error at xmlTextWriterWriteFormatElement\n"); + return; + } + + /* Write an element named "NAME_1" as child of HEADER. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1", + ConvertInput("Müller", MY_ENCODING)); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Write an element named "NAME_2" as child of HEADER. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2", + ConvertInput("Jörg", MY_ENCODING)); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Close the element named HEADER. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Start an element named "ENTRIES" as child of ORDER. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "ENTRIES"); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Start an element named "ENTRY" as child of ENTRIES. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "ENTRY"); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write an element named "ARTICLE" as child of ENTRY. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "ARTICLE", + BAD_CAST ""); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Write an element named "ENTRY_NO" as child of ENTRY. */ + rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "ENTRY_NO", "%d", + 10); + if (rc < 0) { + printf + ("testXmlwriterTree: Error at xmlTextWriterWriteFormatElement\n"); + return; + } + + /* Close the element named ENTRY. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Start an element named "ENTRY" as child of ENTRIES. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "ENTRY"); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write an element named "ARTICLE" as child of ENTRY. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "ARTICLE", + BAD_CAST ""); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Write an element named "ENTRY_NO" as child of ENTRY. */ + rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "ENTRY_NO", "%d", + 20); + if (rc < 0) { + printf + ("testXmlwriterTree: Error at xmlTextWriterWriteFormatElement\n"); + return; + } + + /* Close the element named ENTRY. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Close the element named ENTRIES. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Start an element named "FOOTER" as child of ORDER. */ + rc = xmlTextWriterStartElement(writer, BAD_CAST "FOOTER"); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterStartElement\n"); + return; + } + + /* Write an element named "TEXT" as child of FOOTER. */ + rc = xmlTextWriterWriteElement(writer, BAD_CAST "TEXT", + BAD_CAST "This is a text."); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterWriteElement\n"); + return; + } + + /* Close the element named FOOTER. */ + rc = xmlTextWriterEndElement(writer); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterEndElement\n"); + return; + } + + /* Here we could close the elements ORDER and EXAMPLE using the + * function xmlTextWriterEndElement, but since we do not want to + * write any other elements, we simply call xmlTextWriterEndDocument, + * which will do all the work. */ + rc = xmlTextWriterEndDocument(writer); + if (rc < 0) { + printf("testXmlwriterTree: Error at xmlTextWriterEndDocument\n"); + return; + } + + xmlFreeTextWriter(writer); + + xmlSaveFileEnc(file, doc, MY_ENCODING); + + xmlFreeDoc(doc); +} + +/** + * ConvertInput: + * @in: string in a given encoding + * @encoding: the encoding used + * + * Converts @in into UTF-8 for processing with libxml2 APIs + * + * Returns the converted UTF-8 string, or NULL in case of error. + */ +xmlChar * +ConvertInput(const char *in, const char *encoding) +{ + xmlChar *out; + int ret; + int size; + int out_size; + int temp; + xmlCharEncodingHandlerPtr handler; + + if (in == 0) + return 0; + + handler = xmlFindCharEncodingHandler(encoding); + + if (!handler) { + printf("ConvertInput: no encoding handler found for '%s'\n", + encoding ? encoding : ""); + return 0; + } + + size = (int) strlen(in) + 1; + out_size = size * 2 - 1; + out = (unsigned char *) xmlMalloc((size_t) out_size); + + if (out != 0) { + temp = size - 1; + ret = handler->input(out, &out_size, (const xmlChar *) in, &temp); + if (ret || temp - size + 1) { + if (ret) { + printf("ConvertInput: conversion wasn't successful.\n"); + } else { + printf + ("ConvertInput: conversion wasn't successful. converted: %i octets.\n", + temp); + } + + xmlFree(out); + out = 0; + } else { + out = (unsigned char *) xmlRealloc(out, out_size + 1); + out[out_size] = 0; /*null terminating out */ + } + } else { + printf("ConvertInput: no mem\n"); + } + + return out; +} diff --git a/doc/examples/writer.xml b/doc/examples/writer.xml new file mode 100644 index 00000000..6ab05fd8 --- /dev/null +++ b/doc/examples/writer.xml @@ -0,0 +1,2 @@ + +
00000535351010MüllerJörg
<Test>
10
<Test 2>
20
This is a text.
diff --git a/doc/html/libxml-parserInternals.html b/doc/html/libxml-parserInternals.html index 348ef2ab..bcdac4cf 100644 --- a/doc/html/libxml-parserInternals.html +++ b/doc/html/libxml-parserInternals.html @@ -202,7 +202,7 @@ void xmlEntityReferenceFunc (xmlEntityP
ctxt:an XML parser context
tree:the enumeration tree built while parsing
Returns:the attribute type

Function: xmlParseCDSect

void	xmlParseCDSect			(xmlParserCtxtPtr ctxt)

Parse escaped pure raw content. [18] CDSect ::= CDStart CData CDEnd [19] CDStart ::= '<![CDATA[' [20] Data ::= (Char* - (Char* ']]>' Char*)) [21] CDEnd ::= ']]>'

ctxt:an XML parser context

Function: xmlParseCharData

void	xmlParseCharData		(xmlParserCtxtPtr ctxt, 
int cdata)
-

parse a CharData section. if we are within a CDATA section ']]>' marks an end of section. The right angle bracket (>) may be represented using the string "&gt;", and must, for compatibility, be escaped using "&gt;" or a character reference when it appears in the string "]]>" in content, when that string is not marking the end of a CDATA section. [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)

+

parse a CharData section. if we are within a CDATA section ']]>' marks an end of section. The right angle bracket (>) may be represented using the string "&gt;", and must, for compatibility, be escaped using "&gt;" or a character reference when it appears in the string "]]>" in content, when that string is not marking the end of a CDATA section. [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<

ctxt:an XML parser context
cdata:int indicating whether we are within a CDATA section

Function: xmlParseCharRef

int	xmlParseCharRef			(xmlParserCtxtPtr ctxt)

parse Reference declarations [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';' [ WFC: Legal Character ] Characters referred to using character references must match the production for Char.

ctxt:an XML parser context
Returns:the value parsed (as an int), 0 in case of error

Function: xmlParseComment

void	xmlParseComment			(xmlParserCtxtPtr ctxt)
diff --git a/doc/html/libxml-xmlwriter.html b/doc/html/libxml-xmlwriter.html index 888a7039..6b068372 100644 --- a/doc/html/libxml-xmlwriter.html +++ b/doc/html/libxml-xmlwriter.html @@ -15,8 +15,11 @@ The content of this structure is not made public by the API.
Typedef xmlTextWriter * xmlTextWriterPtr
 
void	xmlFreeTextWriter		(xmlTextWriterPtr writer)
xmlTextWriterPtr	xmlNewTextWriter	(xmlOutputBufferPtr out)
+
xmlTextWriterPtr	xmlNewTextWriterDoc	(xmlDocPtr * doc, 
int compression)
xmlTextWriterPtr	xmlNewTextWriterFilename	(const char * uri, 
int compression)
xmlTextWriterPtr	xmlNewTextWriterMemory	(xmlBufferPtr buf, 
int compression)
+
xmlTextWriterPtr	xmlNewTextWriterPushParser	(xmlParserCtxtPtr ctxt, 
int compression)
+
xmlTextWriterPtr	xmlNewTextWriterTree	(xmlDocPtr doc, 
xmlNodePtr node,
int compression)
int	xmlTextWriterEndAttribute	(xmlTextWriterPtr writer)
int	xmlTextWriterEndCDATA		(xmlTextWriterPtr writer)
int	xmlTextWriterEndDTD		(xmlTextWriterPtr writer)
@@ -93,11 +96,17 @@ The content of this structure is not made public by the API.

Deallocate all the resources associated to the writer

writer:the xmlTextWriterPtr

Function: xmlNewTextWriter

xmlTextWriterPtr	xmlNewTextWriter	(xmlOutputBufferPtr out)

Create a new xmlNewTextWriter structure using an xmlOutputBufferPtr

-
out:an xmlOutputBufferPtr
Returns:the new xmlTextWriterPtr or NULL in case of error

Function: xmlNewTextWriterFilename

xmlTextWriterPtr	xmlNewTextWriterFilename	(const char * uri, 
int compression)
+
out:an xmlOutputBufferPtr
Returns:the new xmlTextWriterPtr or NULL in case of error

Function: xmlNewTextWriterDoc

xmlTextWriterPtr	xmlNewTextWriterDoc	(xmlDocPtr * doc, 
int compression)
+

Create a new xmlNewTextWriter structure with @*doc as output

+
doc:address of a xmlDocPtr to hold the new XML document tree
compression:compress the output?
Returns:the new xmlTextWriterPtr or NULL in case of error

Function: xmlNewTextWriterFilename

xmlTextWriterPtr	xmlNewTextWriterFilename	(const char * uri, 
int compression)

Create a new xmlNewTextWriter structure with @uri as output

uri:the URI of the resource for the output
compression:compress the output?
Returns:the new xmlTextWriterPtr or NULL in case of error

Function: xmlNewTextWriterMemory

xmlTextWriterPtr	xmlNewTextWriterMemory	(xmlBufferPtr buf, 
int compression)

Create a new xmlNewTextWriter structure with @buf as output TODO: handle compression

-
buf:xmlBufferPtr
compression:compress the output?
Returns:the new xmlTextWriterPtr or NULL in case of error

Function: xmlTextWriterEndAttribute

int	xmlTextWriterEndAttribute	(xmlTextWriterPtr writer)
+
buf:xmlBufferPtr
compression:compress the output?
Returns:the new xmlTextWriterPtr or NULL in case of error

Function: xmlNewTextWriterPushParser

xmlTextWriterPtr	xmlNewTextWriterPushParser	(xmlParserCtxtPtr ctxt, 
int compression)
+

Create a new xmlNewTextWriter structure with @ctxt as output TODO: handle compression

+
ctxt:xmlParserCtxtPtr to hold the new XML document tree
compression:compress the output?
Returns:the new xmlTextWriterPtr or NULL in case of error

Function: xmlNewTextWriterTree

xmlTextWriterPtr	xmlNewTextWriterTree	(xmlDocPtr doc, 
xmlNodePtr node,
int compression)
+

Create a new xmlNewTextWriter structure with @doc as output starting at @node

+
doc:xmlDocPtr
node:xmlNodePtr or NULL for doc->children
compression:compress the output?
Returns:the new xmlTextWriterPtr or NULL in case of error

Function: xmlTextWriterEndAttribute

int	xmlTextWriterEndAttribute	(xmlTextWriterPtr writer)

End the current xml element.

writer:the xmlTextWriterPtr
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterEndCDATA

int	xmlTextWriterEndCDATA		(xmlTextWriterPtr writer)

End an xml CDATA section.

@@ -122,12 +131,12 @@ The content of this structure is not made public by the API.
writer:the xmlTextWriterPtr
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterStartDTD

int	xmlTextWriterStartDTD		(xmlTextWriterPtr writer, 
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid)

Start an xml DTD.

writer:the xmlTextWriterPtr
name:the name of the DTD
pubid:the public identifier, which is an alternative to the system identifier
sysid:the system identifier, which is the URI of the DTD
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterStartDTDAttlist

int	xmlTextWriterStartDTDAttlist	(xmlTextWriterPtr writer, 
const xmlChar * name)
-

-
writer:
name:
Returns:

Function: xmlTextWriterStartDTDElement

int	xmlTextWriterStartDTDElement	(xmlTextWriterPtr writer, 
const xmlChar * name)
-

-
writer:
name:
Returns:

Function: xmlTextWriterStartDTDEntity

int	xmlTextWriterStartDTDEntity	(xmlTextWriterPtr writer, 
int pe,
const xmlChar * name)
-

-
writer:
pe:
name:
Returns:

Function: xmlTextWriterStartDocument

int	xmlTextWriterStartDocument	(xmlTextWriterPtr writer, 
const char * version,
const char * encoding,
const char * standalone)
+

Start an xml DTD ATTLIST.

+
writer:the xmlTextWriterPtr
name:the name of the DTD ATTLIST
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterStartDTDElement

int	xmlTextWriterStartDTDElement	(xmlTextWriterPtr writer, 
const xmlChar * name)
+

Start an xml DTD element.

+
writer:the xmlTextWriterPtr
name:the name of the DTD element
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterStartDTDEntity

int	xmlTextWriterStartDTDEntity	(xmlTextWriterPtr writer, 
int pe,
const xmlChar * name)
+

Start an xml DTD ATTLIST.

+
writer:the xmlTextWriterPtr
pe:TRUE if this is a parameter entity, FALSE if not
name:the name of the DTD ATTLIST
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterStartDocument

int	xmlTextWriterStartDocument	(xmlTextWriterPtr writer, 
const char * version,
const char * encoding,
const char * standalone)

Start a new xml document

writer:the xmlTextWriterPtr
version:the xml version ("1.0") or NULL for default ("1.0")
encoding:the encoding or NULL for default
standalone:"yes" or "no" or NULL for default
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterStartElement

int	xmlTextWriterStartElement	(xmlTextWriterPtr writer, 
const xmlChar * name)

Start an xml element.

@@ -150,18 +159,18 @@ The content of this structure is not made public by the API.
writer:the xmlTextWriterPtr
content:comment string
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteDTD

int	xmlTextWriterWriteDTD		(xmlTextWriterPtr writer, 
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const xmlChar * subset)

Write a DTD.

writer:the xmlTextWriterPtr
name:the name of the DTD
pubid:the public identifier, which is an alternative to the system identifier
sysid:the system identifier, which is the URI of the DTD
subset:string content of the DTD
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteDTDAttlist

int	xmlTextWriterWriteDTDAttlist	(xmlTextWriterPtr writer, 
const xmlChar * name,
const xmlChar * content)
-

-
writer:
name:
content:
Returns:

Function: xmlTextWriterWriteDTDElement

int	xmlTextWriterWriteDTDElement	(xmlTextWriterPtr writer, 
const xmlChar * name,
const xmlChar * content)
-

-
writer:
name:
content:
Returns:

Function: xmlTextWriterWriteDTDEntity

int	xmlTextWriterWriteDTDEntity	(xmlTextWriterPtr writer, 
int pe,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const xmlChar * ndataid,
const xmlChar * content)
-

-
writer:
pe:
name:
pubid:
sysid:
ndataid:
content:
Returns:

Function: xmlTextWriterWriteDTDExternalEntity

int	xmlTextWriterWriteDTDExternalEntity	(xmlTextWriterPtr writer, 
int pe,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const xmlChar * ndataid)
-

-
writer:
pe:
name:
pubid:
sysid:
ndataid:
Returns:

Function: xmlTextWriterWriteDTDInternalEntity

int	xmlTextWriterWriteDTDInternalEntity	(xmlTextWriterPtr writer, 
int pe,
const xmlChar * name,
const xmlChar * content)
-

-
writer:
pe:
name:
content:
Returns:

Function: xmlTextWriterWriteDTDNotation

int	xmlTextWriterWriteDTDNotation	(xmlTextWriterPtr writer, 
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid)
-

-
writer:
name:
pubid:
sysid:
Returns:

Function: xmlTextWriterWriteElement

int	xmlTextWriterWriteElement	(xmlTextWriterPtr writer, 
const xmlChar * name,
const xmlChar * content)
+

Write a DTD ATTLIST.

+
writer:the xmlTextWriterPtr
name:the name of the DTD ATTLIST
content:content of the ATTLIST
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteDTDElement

int	xmlTextWriterWriteDTDElement	(xmlTextWriterPtr writer, 
const xmlChar * name,
const xmlChar * content)
+

Write a DTD element.

+
writer:the xmlTextWriterPtr
name:the name of the DTD element
content:content of the element
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteDTDEntity

int	xmlTextWriterWriteDTDEntity	(xmlTextWriterPtr writer, 
int pe,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const xmlChar * ndataid,
const xmlChar * content)
+

Write a DTD entity.

+
writer:the xmlTextWriterPtr
pe:TRUE if this is a parameter entity, FALSE if not
name:the name of the DTD entity
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.
content:content of the entity
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteDTDExternalEntity

int	xmlTextWriterWriteDTDExternalEntity	(xmlTextWriterPtr writer, 
int pe,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const xmlChar * ndataid)
+

Write a DTD internal entity.

+
writer:the xmlTextWriterPtr
pe:TRUE if this is a parameter entity, FALSE if not
name:the name of the DTD entity
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.
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteDTDInternalEntity

int	xmlTextWriterWriteDTDInternalEntity	(xmlTextWriterPtr writer, 
int pe,
const xmlChar * name,
const xmlChar * content)
+

Write a DTD internal entity.

+
writer:the xmlTextWriterPtr
pe:TRUE if this is a parameter entity, FALSE if not
name:the name of the DTD entity
content:content of the entity
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteDTDNotation

int	xmlTextWriterWriteDTDNotation	(xmlTextWriterPtr writer, 
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid)
+

Write a DTD entity.

+
writer:the xmlTextWriterPtr
name:the name of the xml notation
pubid:the public identifier, which is an alternative to the system identifier
sysid:the system identifier, which is the URI of the DTD
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteElement

int	xmlTextWriterWriteElement	(xmlTextWriterPtr writer, 
const xmlChar * name,
const xmlChar * content)

Write an xml element.

writer:the xmlTextWriterPtr
name:element name
content:element content
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteElementNS

int	xmlTextWriterWriteElementNS	(xmlTextWriterPtr writer, 
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const xmlChar * content)

Write an xml element with namespace support.

@@ -176,12 +185,12 @@ The content of this structure is not made public by the API.
writer:the xmlTextWriterPtr
format:format string (see printf)
...:
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteFormatDTD

int	xmlTextWriterWriteFormatDTD	(xmlTextWriterPtr writer, 
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const char * format,
... ...)

Write a DTD with a formatted markup declarations part.

writer:the xmlTextWriterPtr
name:the name of the DTD
pubid:the public identifier, which is an alternative to the system identifier
sysid:the system identifier, which is the URI of the DTD
format:format string (see printf)
...:
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteFormatDTDAttlist

int	xmlTextWriterWriteFormatDTDAttlist	(xmlTextWriterPtr writer, 
const xmlChar * name,
const char * format,
... ...)
-

-
writer:
name:
format:
...:
Returns:

Function: xmlTextWriterWriteFormatDTDElement

int	xmlTextWriterWriteFormatDTDElement	(xmlTextWriterPtr writer, 
const xmlChar * name,
const char * format,
... ...)
-

-
writer:
name:
format:
...:
Returns:

Function: xmlTextWriterWriteFormatDTDInternalEntity

int	xmlTextWriterWriteFormatDTDInternalEntity	(xmlTextWriterPtr writer, 
int pe,
const xmlChar * name,
const char * format,
... ...)
-

-
writer:
pe:
name:
format:
...:
Returns:

Function: xmlTextWriterWriteFormatElement

int	xmlTextWriterWriteFormatElement	(xmlTextWriterPtr writer, 
const xmlChar * name,
const char * format,
... ...)
+

Write a formatted DTD ATTLIST.

+
writer:the xmlTextWriterPtr
name:the name of the DTD ATTLIST
format:format string (see printf)
...:
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteFormatDTDElement

int	xmlTextWriterWriteFormatDTDElement	(xmlTextWriterPtr writer, 
const xmlChar * name,
const char * format,
... ...)
+

Write a formatted DTD element.

+
writer:the xmlTextWriterPtr
name:the name of the DTD element
format:format string (see printf)
...:
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteFormatDTDInternalEntity

int	xmlTextWriterWriteFormatDTDInternalEntity	(xmlTextWriterPtr writer, 
int pe,
const xmlChar * name,
const char * format,
... ...)
+

Write a formatted DTD internal entity.

+
writer:the xmlTextWriterPtr
pe:TRUE if this is a parameter entity, FALSE if not
name:the name of the DTD entity
format:format string (see printf)
...:
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteFormatElement

int	xmlTextWriterWriteFormatElement	(xmlTextWriterPtr writer, 
const xmlChar * name,
const char * format,
... ...)

Write a formatted xml element.

writer:the xmlTextWriterPtr
name:element name
format:format string (see printf)
...:
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteFormatElementNS

int	xmlTextWriterWriteFormatElementNS	(xmlTextWriterPtr writer, 
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const char * format,
... ...)

Write a formatted xml element with namespace support.

@@ -205,23 +214,23 @@ The content of this structure is not made public by the API.

Write a formatted xml attribute.with namespace support

writer:the xmlTextWriterPtr
prefix:namespace prefix
name:attribute local name
namespaceURI:namespace URI
format:format string (see printf)
argptr:pointer to the first member of the variable argument list.
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteVFormatCDATA

int	xmlTextWriterWriteVFormatCDATA	(xmlTextWriterPtr writer, 
const char * format,
va_list argptr)

Write a formatted xml CDATA.

-
writer:the xmlTextWriterPtr
format:format string (see printf)
argptr:
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteVFormatComment

int	xmlTextWriterWriteVFormatComment	(xmlTextWriterPtr writer, 
const char * format,
va_list argptr)
+
writer:the xmlTextWriterPtr
format:format string (see printf)
argptr:pointer to the first member of the variable argument list.
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteVFormatComment

int	xmlTextWriterWriteVFormatComment	(xmlTextWriterPtr writer, 
const char * format,
va_list argptr)

Write an xml comment.

writer:the xmlTextWriterPtr
format:format string (see printf)
argptr:pointer to the first member of the variable argument list.
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteVFormatDTD

int	xmlTextWriterWriteVFormatDTD	(xmlTextWriterPtr writer, 
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const char * format,
va_list argptr)

Write a DTD with a formatted markup declarations part.

-
writer:the xmlTextWriterPtr
name:the name of the DTD
pubid:the public identifier, which is an alternative to the system identifier
sysid:the system identifier, which is the URI of the DTD
format:format string (see printf)
argptr:
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteVFormatDTDAttlist

int	xmlTextWriterWriteVFormatDTDAttlist	(xmlTextWriterPtr writer, 
const xmlChar * name,
const char * format,
va_list argptr)
-

-
writer:
name:
format:
argptr:
Returns:

Function: xmlTextWriterWriteVFormatDTDElement

int	xmlTextWriterWriteVFormatDTDElement	(xmlTextWriterPtr writer, 
const xmlChar * name,
const char * format,
va_list argptr)
-

-
writer:
name:
format:
argptr:
Returns:

Function: xmlTextWriterWriteVFormatDTDInternalEntity

int	xmlTextWriterWriteVFormatDTDInternalEntity	(xmlTextWriterPtr writer, 
int pe,
const xmlChar * name,
const char * format,
va_list argptr)
-

-
writer:
pe:
name:
format:
argptr:
Returns:

Function: xmlTextWriterWriteVFormatElement

int	xmlTextWriterWriteVFormatElement	(xmlTextWriterPtr writer, 
const xmlChar * name,
const char * format,
va_list argptr)
+
writer:the xmlTextWriterPtr
name:the name of the DTD
pubid:the public identifier, which is an alternative to the system identifier
sysid:the system identifier, which is the URI of the DTD
format:format string (see printf)
argptr:pointer to the first member of the variable argument list.
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteVFormatDTDAttlist

int	xmlTextWriterWriteVFormatDTDAttlist	(xmlTextWriterPtr writer, 
const xmlChar * name,
const char * format,
va_list argptr)
+

Write a formatted DTD ATTLIST.

+
writer:the xmlTextWriterPtr
name:the name of the DTD ATTLIST
format:format string (see printf)
argptr:pointer to the first member of the variable argument list.
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteVFormatDTDElement

int	xmlTextWriterWriteVFormatDTDElement	(xmlTextWriterPtr writer, 
const xmlChar * name,
const char * format,
va_list argptr)
+

Write a formatted DTD element.

+
writer:the xmlTextWriterPtr
name:the name of the DTD element
format:format string (see printf)
argptr:pointer to the first member of the variable argument list.
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteVFormatDTDInternalEntity

int	xmlTextWriterWriteVFormatDTDInternalEntity	(xmlTextWriterPtr writer, 
int pe,
const xmlChar * name,
const char * format,
va_list argptr)
+

Write a formatted DTD internal entity.

+
writer:the xmlTextWriterPtr
pe:TRUE if this is a parameter entity, FALSE if not
name:the name of the DTD entity
format:format string (see printf)
argptr:pointer to the first member of the variable argument list.
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteVFormatElement

int	xmlTextWriterWriteVFormatElement	(xmlTextWriterPtr writer, 
const xmlChar * name,
const char * format,
va_list argptr)

Write a formatted xml element.

writer:the xmlTextWriterPtr
name:element name
format:format string (see printf)
argptr:pointer to the first member of the variable argument list.
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteVFormatElementNS

int	xmlTextWriterWriteVFormatElementNS	(xmlTextWriterPtr writer, 
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const char * format,
va_list argptr)

Write a formatted xml element with namespace support.

writer:the xmlTextWriterPtr
prefix:namespace prefix
name:element local name
namespaceURI:namespace URI
format:format string (see printf)
argptr:pointer to the first member of the variable argument list.
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteVFormatPI

int	xmlTextWriterWriteVFormatPI	(xmlTextWriterPtr writer, 
const xmlChar * target,
const char * format,
va_list argptr)

Write a formatted xml PI.

-
writer:the xmlTextWriterPtr
target:PI target
format:format string (see printf)
argptr:
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteVFormatRaw

int	xmlTextWriterWriteVFormatRaw	(xmlTextWriterPtr writer, 
const char * format,
va_list argptr)
+
writer:the xmlTextWriterPtr
target:PI target
format:format string (see printf)
argptr:pointer to the first member of the variable argument list.
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteVFormatRaw

int	xmlTextWriterWriteVFormatRaw	(xmlTextWriterPtr writer, 
const char * format,
va_list argptr)

Write a formatted raw xml text.

writer:the xmlTextWriterPtr
format:format string (see printf)
argptr:pointer to the first member of the variable argument list.
Returns:the bytes written (may be 0 because of buffering) or -1 in case of error

Function: xmlTextWriterWriteVFormatString

int	xmlTextWriterWriteVFormatString	(xmlTextWriterPtr writer, 
const char * format,
va_list argptr)

Write a formatted xml text.

diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml index eb13aab5..6631fd88 100644 --- a/doc/libxml2-api.xml +++ b/doc/libxml2-api.xml @@ -2664,6 +2664,7 @@ + @@ -2708,7 +2709,9 @@ + + @@ -9200,6 +9203,12 @@ actually an xmlCharEncoding'/> + + Create a new xmlNewTextWriter structure with @*doc as output + + + + Create a new xmlNewTextWriter structure with @uri as output @@ -9212,6 +9221,19 @@ actually an xmlCharEncoding'/> + + Create a new xmlNewTextWriter structure with @ctxt as output TODO: handle compression + + + + + + Create a new xmlNewTextWriter structure with @doc as output starting at @node + + + + + Allocate a validation context structure. @@ -11795,23 +11817,23 @@ actually an xmlCharEncoding'/> - - - - + Start an xml DTD ATTLIST. + + + - - - - + Start an xml DTD element. + + + - - - - - + Start an xml DTD ATTLIST. + + + + Start a new xml document @@ -11895,55 +11917,55 @@ actually an xmlCharEncoding'/> - - - - - + Write a DTD ATTLIST. + + + + - - - - - + Write a DTD element. + + + + - - - - - - - - - + Write a DTD entity. + + + + + + + + - - - - - - - - + Write a DTD internal entity. + + + + + + + - - - - - - + Write a DTD internal entity. + + + + + - - - - - - + Write a DTD entity. + + + + + Write an xml element. @@ -12004,28 +12026,28 @@ actually an xmlCharEncoding'/> - - - - - + Write a formatted DTD ATTLIST. + + + + - - - - - + Write a formatted DTD element. + + + + - - - - - - + Write a formatted DTD internal entity. + + + + + @@ -12117,7 +12139,7 @@ actually an xmlCharEncoding'/> - + Write an xml comment. @@ -12134,32 +12156,32 @@ actually an xmlCharEncoding'/> - + - - - - - - + Write a formatted DTD ATTLIST. + + + + + - - - - - - + Write a formatted DTD element. + + + + + - - - - - - - + Write a formatted DTD internal entity. + + + + + + Write a formatted xml element. @@ -12185,7 +12207,7 @@ actually an xmlCharEncoding'/> - + Write a formatted raw xml text. diff --git a/doc/libxml2-refs.xml b/doc/libxml2-refs.xml index ab1554fd..c0171fe0 100644 --- a/doc/libxml2-refs.xml +++ b/doc/libxml2-refs.xml @@ -1761,8 +1761,11 @@ + + + @@ -4622,8 +4625,11 @@ + + + @@ -6263,8 +6269,11 @@ + + + @@ -6315,9 +6324,9 @@ - + @@ -7768,6 +7777,7 @@ + @@ -7825,6 +7835,9 @@ + + + @@ -8123,6 +8136,7 @@ + @@ -8378,6 +8392,7 @@ + @@ -11519,6 +11534,7 @@ + @@ -11553,9 +11569,8 @@ - - + @@ -11564,16 +11579,19 @@ + + + - + @@ -11582,7 +11600,7 @@ - + @@ -11931,6 +11949,13 @@ + + + + + + + @@ -13203,6 +13228,14 @@ + + + + + + + + @@ -15124,6 +15157,9 @@ + + + @@ -15215,6 +15251,7 @@ + @@ -15223,6 +15260,14 @@ + + + + + + + + @@ -16025,6 +16070,9 @@ + + + @@ -16213,6 +16261,9 @@ + + + @@ -17131,6 +17182,7 @@ + @@ -17421,8 +17473,11 @@ + + + @@ -17450,6 +17505,7 @@ + @@ -18415,10 +18471,12 @@ + + @@ -19404,6 +19462,9 @@ + + + @@ -19413,6 +19474,9 @@ + + + @@ -19736,6 +19800,7 @@ + @@ -19874,6 +19939,8 @@ + + @@ -19987,20 +20054,6 @@ - - - - - - - - - - - - - - @@ -21273,9 +21326,15 @@ + + + + + + @@ -21774,26 +21833,6 @@ - - - - - - - - - - - - - - - - - - - - @@ -22191,8 +22230,11 @@ + + + @@ -22247,29 +22289,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -22683,32 +22702,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -24421,6 +24414,7 @@ + @@ -25651,23 +25645,6 @@ - - - - - - - - - - - - - - - - - @@ -25697,8 +25674,6 @@ - - @@ -25972,6 +25947,8 @@ + + @@ -26179,6 +26156,8 @@ + + @@ -26420,8 +26399,11 @@ + + + @@ -26431,6 +26413,7 @@ + @@ -26501,6 +26484,7 @@ + @@ -26924,8 +26908,8 @@ - - + + diff --git a/include/libxml/hash.h b/include/libxml/hash.h index 0c52eeb5..039ed5d2 100644 --- a/include/libxml/hash.h +++ b/include/libxml/hash.h @@ -11,9 +11,6 @@ #ifndef __XML_HASH_H__ #define __XML_HASH_H__ -#include -#include - #ifdef __cplusplus extern "C" { #endif @@ -24,6 +21,17 @@ extern "C" { typedef struct _xmlHashTable xmlHashTable; typedef xmlHashTable *xmlHashTablePtr; +#ifdef __cplusplus +} +#endif + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + /* * function types: */ diff --git a/include/libxml/xmlwriter.h b/include/libxml/xmlwriter.h index 23635def..ad9d99f7 100644 --- a/include/libxml/xmlwriter.h +++ b/include/libxml/xmlwriter.h @@ -14,6 +14,7 @@ extern "C" { #endif +#include #include #include @@ -26,13 +27,17 @@ typedef xmlTextWriter *xmlTextWriterPtr; XMLPUBFUN xmlTextWriterPtr XMLCALL xmlNewTextWriter (xmlOutputBufferPtr out); XMLPUBFUN xmlTextWriterPtr XMLCALL - xmlNewTextWriterFilename (const char *uri, - int compression); + xmlNewTextWriterFilename(const char *uri, int compression); XMLPUBFUN xmlTextWriterPtr XMLCALL - xmlNewTextWriterMemory (xmlBufferPtr buf, - int compression); -XMLPUBFUN void XMLCALL - xmlFreeTextWriter (xmlTextWriterPtr writer); + xmlNewTextWriterMemory(xmlBufferPtr buf, int compression); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, int compression); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterDoc(xmlDocPtr * doc, int compression); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterTree(xmlDocPtr doc, + xmlNodePtr node, int compression); + XMLPUBFUN void XMLCALL xmlFreeTextWriter(xmlTextWriterPtr writer); /* * Functions @@ -75,8 +80,7 @@ XMLPUBFUN int XMLCALL const xmlChar * prefix, const xmlChar * name, const xmlChar * namespaceURI); -XMLPUBFUN int XMLCALL - xmlTextWriterEndElement (xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL xmlTextWriterEndElement(xmlTextWriterPtr writer); XMLPUBFUN int XMLCALL xmlTextWriterFullEndElement (xmlTextWriterPtr writer); @@ -124,12 +128,10 @@ XMLPUBFUN int XMLCALL const char *format, ...); XMLPUBFUN int XMLCALL xmlTextWriterWriteVFormatRaw (xmlTextWriterPtr writer, - const char *format, - va_list argptr); + const char *format, va_list argptr); XMLPUBFUN int XMLCALL xmlTextWriterWriteRawLen (xmlTextWriterPtr writer, - const xmlChar * content, - int len); + const xmlChar * content, int len); XMLPUBFUN int XMLCALL xmlTextWriterWriteRaw (xmlTextWriterPtr writer, const xmlChar * content); @@ -145,14 +147,10 @@ XMLPUBFUN int XMLCALL const xmlChar * content); XMLPUBFUN int XMLCALL xmlTextWriterWriteBase64 (xmlTextWriterPtr writer, - const char *data, - int start, - int len); + const char *data, int start, int len); XMLPUBFUN int XMLCALL xmlTextWriterWriteBinHex (xmlTextWriterPtr writer, - const char *data, - int start, - int len); + const char *data, int start, int len); /* * Attributes @@ -210,8 +208,7 @@ XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL xmlTextWriterStartPI (xmlTextWriterPtr writer, const xmlChar * target); -XMLPUBFUN int XMLCALL - xmlTextWriterEndPI (xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL xmlTextWriterEndPI(xmlTextWriterPtr writer); /* * PI conveniency functions @@ -223,8 +220,7 @@ XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL xmlTextWriterWriteVFormatPI (xmlTextWriterPtr writer, const xmlChar * target, - const char *format, - va_list argptr); + const char *format, va_list argptr); XMLPUBFUN int XMLCALL xmlTextWriterWritePI (xmlTextWriterPtr writer, const xmlChar * target, @@ -234,10 +230,8 @@ XMLPUBFUN int XMLCALL /* * CDATA */ -XMLPUBFUN int XMLCALL - xmlTextWriterStartCDATA (xmlTextWriterPtr writer); -XMLPUBFUN int XMLCALL - xmlTextWriterEndCDATA (xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL xmlTextWriterStartCDATA(xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL xmlTextWriterEndCDATA(xmlTextWriterPtr writer); /* * CDATA conveniency functions @@ -247,8 +241,7 @@ XMLPUBFUN int XMLCALL const char *format, ...); XMLPUBFUN int XMLCALL xmlTextWriterWriteVFormatCDATA (xmlTextWriterPtr writer, - const char *format, - va_list argptr); + const char *format, va_list argptr); XMLPUBFUN int XMLCALL xmlTextWriterWriteCDATA (xmlTextWriterPtr writer, const xmlChar * content); @@ -261,8 +254,7 @@ XMLPUBFUN int XMLCALL const xmlChar * name, const xmlChar * pubid, const xmlChar * sysid); -XMLPUBFUN int XMLCALL - xmlTextWriterEndDTD (xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL xmlTextWriterEndDTD(xmlTextWriterPtr writer); /* * DTD conveniency functions @@ -278,8 +270,7 @@ XMLPUBFUN int XMLCALL const xmlChar * name, const xmlChar * pubid, const xmlChar * sysid, - const char *format, - va_list argptr); + const char *format, va_list argptr); XMLPUBFUN int XMLCALL xmlTextWriterWriteDTD (xmlTextWriterPtr writer, const xmlChar * name, @@ -343,8 +334,7 @@ XMLPUBFUN int XMLCALL */ XMLPUBFUN int XMLCALL xmlTextWriterStartDTDEntity (xmlTextWriterPtr writer, - int pe, - const xmlChar * name); + int pe, const xmlChar * name); #define xmlTextWriterEndDTDEntity xmlTextWriterEndDTD /* @@ -394,8 +384,7 @@ XMLPUBFUN int XMLCALL /* * misc */ -XMLPUBFUN int XMLCALL - xmlTextWriterFlush (xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL xmlTextWriterFlush(xmlTextWriterPtr writer); #ifdef __cplusplus } diff --git a/win32/libxml2.def.src b/win32/libxml2.def.src index c688c20b..a6cd721f 100644 --- a/win32/libxml2.def.src +++ b/win32/libxml2.def.src @@ -1134,8 +1134,11 @@ xmlNewTextLen xmlNewTextReader xmlNewTextReaderFilename xmlNewTextWriter +xmlNewTextWriterDoc xmlNewTextWriterFilename xmlNewTextWriterMemory +xmlNewTextWriterPushParser +xmlNewTextWriterTree xmlNewValidCtxt xmlNextChar xmlNoNetExternalEntityLoader diff --git a/xmlwriter.c b/xmlwriter.c index 38ee555e..e81eae0f 100644 --- a/xmlwriter.c +++ b/xmlwriter.c @@ -1,3 +1,4 @@ + /* * xmlwriter.c: XML text writer implementation * @@ -8,11 +9,12 @@ */ #include -#include #include "libxml.h" #include #include +#include +#include #ifdef LIBXML_WRITER_ENABLED @@ -72,9 +74,14 @@ static int xmlCmpTextWriterNsStackEntry(const void *data0, static int xmlTextWriterWriteMemCallback(void *context, const xmlChar * str, int len); static int xmlTextWriterCloseMemCallback(void *context); +static int xmlTextWriterWriteDocCallback(void *context, + const xmlChar * str, int len); +static int xmlTextWriterCloseDocCallback(void *context); + static xmlChar *xmlTextWriterVSprintf(const char *format, va_list argptr); static int xmlOutputBufferWriteBase64(xmlOutputBufferPtr out, int len, const unsigned char *data); +static void xmlTextWriterStartDocumentCallback(void *ctx); /** * xmlNewTextWriter: @@ -199,6 +206,144 @@ xmlNewTextWriterMemory(xmlBufferPtr buf, int compression ATTRIBUTE_UNUSED) return ret; } +/** + * xmlNewTextWriterPushParser: + * @ctxt: xmlParserCtxtPtr to hold the new XML document tree + * @compression: compress the output? + * + * Create a new xmlNewTextWriter structure with @ctxt as output + * TODO: handle compression + * + * Returns the new xmlTextWriterPtr or NULL in case of error + */ +xmlTextWriterPtr +xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, int compression) +{ + xmlTextWriterPtr ret; + xmlOutputBufferPtr out; + + out = xmlOutputBufferCreateIO((xmlOutputWriteCallback) + xmlTextWriterWriteDocCallback, + (xmlOutputCloseCallback) + xmlTextWriterCloseDocCallback, + (void *) ctxt, NULL); + if (out == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlNewTextWriterPushParser : error at xmlOutputBufferCreateIO!\n"); + return NULL; + } + + ret = xmlNewTextWriter(out); + if (ret == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlNewTextWriterPushParser : error at xmlNewTextWriter!\n"); + xmlOutputBufferClose(out); + return NULL; + } + + return ret; +} + +/** + * xmlNewTextWriterDoc: + * @doc: address of a xmlDocPtr to hold the new XML document tree + * @compression: compress the output? + * + * Create a new xmlNewTextWriter structure with @*doc as output + * + * Returns the new xmlTextWriterPtr or NULL in case of error + */ +xmlTextWriterPtr +xmlNewTextWriterDoc(xmlDocPtr * doc, int compression) +{ + xmlTextWriterPtr ret; + xmlSAXHandler saxHandler; + xmlParserCtxtPtr ctxt; + + memset(&saxHandler, '\0', sizeof(saxHandler)); + xmlSAX2InitDefaultSAXHandler(&saxHandler, 1); + saxHandler.startDocument = xmlTextWriterStartDocumentCallback; + saxHandler.startElement = xmlSAX2StartElement; + saxHandler.endElement = xmlSAX2EndElement; + + ctxt = xmlCreatePushParserCtxt(&saxHandler, NULL, NULL, 0, NULL); + if (ctxt == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlNewTextWriterDoc : error at xmlCreatePushParserCtxt!\n"); + return NULL; + } + + ctxt->myDoc = xmlNewDoc(XML_DEFAULT_VERSION); + if (ctxt->myDoc == NULL) { + xmlFreeParserCtxt(ctxt); + xmlGenericError(xmlGenericErrorContext, + "xmlNewTextWriterDoc : error at xmlNewDoc!\n"); + return NULL; + } + + ret = xmlNewTextWriterPushParser(ctxt, compression); + if (ret == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlNewTextWriterDoc : error at xmlNewTextWriterPushParser!\n"); + return NULL; + } + + *doc = ctxt->myDoc; + xmlSetDocCompressMode(*doc, compression); + + return ret; +} + +/** + * xmlNewTextWriterTree: + * @doc: xmlDocPtr + * @node: xmlNodePtr or NULL for doc->children + * @compression: compress the output? + * + * Create a new xmlNewTextWriter structure with @doc as output + * starting at @node + * + * Returns the new xmlTextWriterPtr or NULL in case of error + */ +xmlTextWriterPtr +xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node, int compression) +{ + xmlTextWriterPtr ret; + xmlSAXHandler saxHandler; + xmlParserCtxtPtr ctxt; + + if (doc == NULL) { + return NULL; + } + + memset(&saxHandler, '\0', sizeof(saxHandler)); + xmlSAX2InitDefaultSAXHandler(&saxHandler, 1); + saxHandler.startDocument = xmlTextWriterStartDocumentCallback; + saxHandler.startElement = xmlSAX2StartElement; + saxHandler.endElement = xmlSAX2EndElement; + + ctxt = xmlCreatePushParserCtxt(&saxHandler, NULL, NULL, 0, NULL); + if (ctxt == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlNewTextWriterDoc : error at xmlCreatePushParserCtxt!\n"); + return NULL; + } + + ctxt->myDoc = doc; + ctxt->node = node; + + ret = xmlNewTextWriterPushParser(ctxt, compression); + if (ret == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlNewTextWriterDoc : error at xmlNewTextWriterPushParser!\n"); + return NULL; + } + + xmlSetDocCompressMode(doc, compression); + + return ret; +} + /** * xmlFreeTextWriter: * @writer: the xmlTextWriterPtr @@ -395,6 +540,11 @@ xmlTextWriterEndDocument(xmlTextWriterPtr writer) } } + count = xmlOutputBufferWriteString(writer->out, "\n"); + if(count < 0) + return -1; + sum += count; + return sum; } @@ -468,7 +618,6 @@ xmlTextWriterWriteComment(xmlTextWriterPtr writer, const xmlChar * content) int sum; xmlLinkPtr lk; xmlTextWriterStackEntry *p; - xmlChar *buf; if ((writer == NULL) || (writer->out == NULL)) return -1; @@ -505,12 +654,8 @@ xmlTextWriterWriteComment(xmlTextWriterPtr writer, const xmlChar * content) if (count < 0) return -1; sum += count; - buf = xmlEncodeEntitiesReentrant(NULL, content); - if (buf != 0) { - count = xmlOutputBufferWriteString(writer->out, (const char *)buf); - xmlFree(buf); - } else - count = xmlOutputBufferWriteString(writer->out, (const char *)content); + count = xmlOutputBufferWriteString(writer->out, + (const char *) content); if (count < 0) return -1; sum += count; @@ -589,7 +734,8 @@ xmlTextWriterStartElement(xmlTextWriterPtr writer, const xmlChar * name) if (count < 0) return -1; sum += count; - count = xmlOutputBufferWriteString(writer->out, (const char *)p->name); + count = + xmlOutputBufferWriteString(writer->out, (const char *) p->name); if (count < 0) return -1; sum += count; @@ -1021,7 +1167,7 @@ xmlTextWriterWriteString(xmlTextWriterPtr writer, const xmlChar * content) case XML_TEXTWRITER_TEXT: case XML_TEXTWRITER_ATTRIBUTE: encode: - buf = xmlEncodeEntitiesReentrant(NULL, content); + buf = xmlEncodeSpecialChars(NULL, content); break; case XML_TEXTWRITER_DTD: count = xmlOutputBufferWriteString(writer->out, " ["); @@ -1040,7 +1186,8 @@ xmlTextWriterWriteString(xmlTextWriterPtr writer, const xmlChar * content) } if (buf != 0) { - count = xmlOutputBufferWriteString(writer->out, (const char *) buf); + count = + xmlOutputBufferWriteString(writer->out, (const char *) buf); xmlFree(buf); } else count = -1; @@ -1330,7 +1477,9 @@ xmlTextWriterStartAttribute(xmlTextWriterPtr writer, const xmlChar * name) if (count < 0) return -1; sum += count; - count = xmlOutputBufferWriteString(writer->out, (const char *)name); + count = + xmlOutputBufferWriteString(writer->out, + (const char *) name); if (count < 0) return -1; sum += count; @@ -1986,7 +2135,8 @@ xmlTextWriterStartPI(xmlTextWriterPtr writer, const xmlChar * target) if (count < 0) return -1; sum += count; - count = xmlOutputBufferWriteString(writer->out, (const char *) p->name); + count = + xmlOutputBufferWriteString(writer->out, (const char *) p->name); if (count < 0) return -1; sum += count; @@ -2068,6 +2218,7 @@ xmlTextWriterWriteFormatPI(xmlTextWriterPtr writer, const xmlChar * target, * @writer: the xmlTextWriterPtr * @target: PI target * @format: format string (see printf) + * @argptr: pointer to the first member of the variable argument list. * * Write a formatted xml PI. * @@ -2274,6 +2425,7 @@ xmlTextWriterWriteFormatCDATA(xmlTextWriterPtr writer, const char *format, * xmlTextWriterWriteVFormatCDATA: * @writer: the xmlTextWriterPtr * @format: format string (see printf) + * @argptr: pointer to the first member of the variable argument list. * * Write a formatted xml CDATA. * @@ -2405,7 +2557,8 @@ xmlTextWriterStartDTD(xmlTextWriterPtr writer, return -1; sum += count; - count = xmlOutputBufferWriteString(writer->out, (const char *) pubid); + count = + xmlOutputBufferWriteString(writer->out, (const char *) pubid); if (count < 0) return -1; sum += count; @@ -2429,7 +2582,8 @@ xmlTextWriterStartDTD(xmlTextWriterPtr writer, return -1; sum += count; - count = xmlOutputBufferWriteString(writer->out, (const char *) sysid); + count = + xmlOutputBufferWriteString(writer->out, (const char *) sysid); if (count < 0) return -1; sum += count; @@ -2531,6 +2685,7 @@ xmlTextWriterWriteFormatDTD(xmlTextWriterPtr writer, * @pubid: the public identifier, which is an alternative to the system identifier * @sysid: the system identifier, which is the URI of the DTD * @format: format string (see printf) + * @argptr: pointer to the first member of the variable argument list. * * Write a DTD with a formatted markup declarations part. * @@ -2599,6 +2754,15 @@ xmlTextWriterWriteDTD(xmlTextWriterPtr writer, return sum; } +/** + * xmlTextWriterStartDTDElement: + * @writer: the xmlTextWriterPtr + * @name: the name of the DTD element + * + * Start an xml DTD element. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ int xmlTextWriterStartDTDElement(xmlTextWriterPtr writer, const xmlChar * name) { @@ -2671,6 +2835,16 @@ xmlTextWriterStartDTDElement(xmlTextWriterPtr writer, const xmlChar * name) return sum; } +/** + * xmlTextWriterWriteFormatDTDElement: + * @writer: the xmlTextWriterPtr + * @name: the name of the DTD element + * @format: format string (see printf) + * + * Write a formatted DTD element. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ int xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer, const xmlChar * name, @@ -2687,6 +2861,17 @@ xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer, return rc; } +/** + * xmlTextWriterWriteVFormatDTDElement: + * @writer: the xmlTextWriterPtr + * @name: the name of the DTD element + * @format: format string (see printf) + * @argptr: pointer to the first member of the variable argument list. + * + * Write a formatted DTD element. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ int xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer, const xmlChar * name, @@ -2708,6 +2893,16 @@ xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer, return rc; } +/** + * xmlTextWriterWriteDTDElement: + * @writer: the xmlTextWriterPtr + * @name: the name of the DTD element + * @content: content of the element + * + * Write a DTD element. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ int xmlTextWriterWriteDTDElement(xmlTextWriterPtr writer, const xmlChar * name, const xmlChar * content) @@ -2741,6 +2936,15 @@ xmlTextWriterWriteDTDElement(xmlTextWriterPtr writer, return sum; } +/** + * xmlTextWriterStartDTDAttlist: + * @writer: the xmlTextWriterPtr + * @name: the name of the DTD ATTLIST + * + * Start an xml DTD ATTLIST. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ int xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer, const xmlChar * name) { @@ -2815,6 +3019,16 @@ xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer, const xmlChar * name) return sum; } +/** + * xmlTextWriterWriteFormatDTDAttlist: + * @writer: the xmlTextWriterPtr + * @name: the name of the DTD ATTLIST + * @format: format string (see printf) + * + * Write a formatted DTD ATTLIST. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ int xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer, const xmlChar * name, @@ -2831,6 +3045,17 @@ xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer, return rc; } +/** + * xmlTextWriterWriteVFormatDTDAttlist: + * @writer: the xmlTextWriterPtr + * @name: the name of the DTD ATTLIST + * @format: format string (see printf) + * @argptr: pointer to the first member of the variable argument list. + * + * Write a formatted DTD ATTLIST. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ int xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer, const xmlChar * name, @@ -2852,6 +3077,16 @@ xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer, return rc; } +/** + * xmlTextWriterWriteDTDAttlist: + * @writer: the xmlTextWriterPtr + * @name: the name of the DTD ATTLIST + * @content: content of the ATTLIST + * + * Write a DTD ATTLIST. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ int xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr writer, const xmlChar * name, const xmlChar * content) @@ -2885,6 +3120,16 @@ xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr writer, return sum; } +/** + * xmlTextWriterStartDTDEntity: + * @writer: the xmlTextWriterPtr + * @pe: TRUE if this is a parameter entity, FALSE if not + * @name: the name of the DTD ATTLIST + * + * Start an xml DTD ATTLIST. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ int xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer, int pe, const xmlChar * name) @@ -2968,6 +3213,17 @@ xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer, return sum; } +/** + * xmlTextWriterWriteFormatDTDInternalEntity: + * @writer: the xmlTextWriterPtr + * @pe: TRUE if this is a parameter entity, FALSE if not + * @name: the name of the DTD entity + * @format: format string (see printf) + * + * Write a formatted DTD internal entity. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ int xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer, int pe, @@ -2986,6 +3242,18 @@ xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer, return rc; } +/** + * xmlTextWriterWriteVFormatDTDInternalEntity: + * @writer: the xmlTextWriterPtr + * @pe: TRUE if this is a parameter entity, FALSE if not + * @name: the name of the DTD entity + * @format: format string (see printf) + * @argptr: pointer to the first member of the variable argument list. + * + * Write a formatted DTD internal entity. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ int xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer, int pe, @@ -3009,6 +3277,20 @@ xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer, return rc; } +/** + * xmlTextWriterWriteDTDEntity: + * @writer: the xmlTextWriterPtr + * @pe: TRUE if this is a parameter entity, FALSE if not + * @name: the name of the DTD entity + * @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. + * @content: content of the entity + * + * Write a DTD entity. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ int xmlTextWriterWriteDTDEntity(xmlTextWriterPtr writer, int pe, @@ -3032,6 +3314,17 @@ xmlTextWriterWriteDTDEntity(xmlTextWriterPtr writer, sysid, ndataid); } +/** + * xmlTextWriterWriteDTDInternalEntity: + * @writer: the xmlTextWriterPtr + * @pe: TRUE if this is a parameter entity, FALSE if not + * @name: the name of the DTD entity + * @content: content of the entity + * + * Write a DTD internal entity. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ int xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer, int pe, @@ -3075,6 +3368,19 @@ xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer, return sum; } +/** + * xmlTextWriterWriteDTDExternalEntity: + * @writer: the xmlTextWriterPtr + * @pe: TRUE if this is a parameter entity, FALSE if not + * @name: the name of the DTD entity + * @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 a DTD internal entity. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ int xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer, int pe, @@ -3115,7 +3421,8 @@ xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer, return -1; sum += count; - count = xmlOutputBufferWriteString(writer->out, (const char *) pubid); + count = + xmlOutputBufferWriteString(writer->out, (const char *) pubid); if (count < 0) return -1; sum += count; @@ -3144,7 +3451,8 @@ xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer, return -1; sum += count; - count = xmlOutputBufferWriteString(writer->out, (const char *) sysid); + count = + xmlOutputBufferWriteString(writer->out, (const char *) sysid); if (count < 0) return -1; sum += count; @@ -3161,7 +3469,9 @@ xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer, return -1; sum += count; - count = xmlOutputBufferWriteString(writer->out, (const char *) ndataid); + count = + xmlOutputBufferWriteString(writer->out, + (const char *) ndataid); if (count < 0) return -1; sum += count; @@ -3175,6 +3485,17 @@ xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer, return sum; } +/** + * xmlTextWriterWriteDTDNotation: + * @writer: the xmlTextWriterPtr + * @name: the name of the xml notation + * @pubid: the public identifier, which is an alternative to the system identifier + * @sysid: the system identifier, which is the URI of the DTD + * + * Write a DTD entity. + * + * Returns the bytes written (may be 0 because of buffering) or -1 in case of error + */ int xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer, const xmlChar * name, @@ -3238,7 +3559,8 @@ xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer, if (count < 0) return -1; sum += count; - count = xmlOutputBufferWriteString(writer->out, (const char *) pubid); + count = + xmlOutputBufferWriteString(writer->out, (const char *) pubid); if (count < 0) return -1; sum += count; @@ -3263,7 +3585,8 @@ xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer, if (count < 0) return -1; sum += count; - count = xmlOutputBufferWriteString(writer->out, (const char *) sysid); + count = + xmlOutputBufferWriteString(writer->out, (const char *) sysid); if (count < 0) return -1; sum += count; @@ -3456,6 +3779,56 @@ xmlTextWriterCloseMemCallback(void *context ATTRIBUTE_UNUSED) return 0; } +/** + * xmlTextWriterWriteDocCallback: + * @context: the xmlBufferPtr + * @str: the data to write + * @len: the length of the data + * + * Write callback for the xmlOutputBuffer with target xmlBuffer + * + * Returns -1, 0, 1 + */ +static int +xmlTextWriterWriteDocCallback(void *context, const xmlChar * str, int len) +{ + xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) context; + int rc; + + if ((rc = xmlParseChunk(ctxt, str, len, 0)) != 0) { + xmlGenericError(xmlGenericErrorContext, + "xmlTextWriterWriteDocCallback : XML error %d !\n", + rc); + return -1; + } + + return len; +} + +/** + * xmlTextWriterCloseDocCallback: + * @context: the xmlBufferPtr + * + * Close callback for the xmlOutputBuffer with target xmlBuffer + * + * Returns -1, 0, 1 + */ +static int +xmlTextWriterCloseDocCallback(void *context) +{ + xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) context; + int rc; + + if ((rc = xmlParseChunk(ctxt, NULL, 0, 1)) != 0) { + xmlGenericError(xmlGenericErrorContext, + "xmlTextWriterWriteDocCallback : XML error %d !\n", + rc); + return -1; + } + + return 0; +} + /** * xmlTextWriterVSprintf: * @format: see printf @@ -3495,4 +3868,72 @@ xmlTextWriterVSprintf(const char *format, va_list argptr) return buf; } +/** + * xmlTextWriterStartDocumentCallback: + * @ctx: the user data (XML parser context) + * + * called at the start of document processing. + */ +static void +xmlTextWriterStartDocumentCallback(void *ctx) +{ + xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; + xmlDocPtr doc; + +#ifdef DEBUG_SAX + xmlGenericError(xmlGenericErrorContext, "SAX.startDocument()\n"); +#endif + if (ctxt->html) { +#ifdef LIBXML_HTML_ENABLED + if (ctxt->myDoc == NULL) + ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL); + if (ctxt->myDoc == NULL) { + if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) + ctxt->sax->error(ctxt->userData, + "SAX.startDocument(): out of memory\n"); + ctxt->errNo = XML_ERR_NO_MEMORY; + ctxt->instate = XML_PARSER_EOF; + ctxt->disableSAX = 1; + return; + } +#else + xmlGenericError(xmlGenericErrorContext, + "libxml2 built without HTML support\n"); + ctxt->errNo = XML_ERR_INTERNAL_ERROR; + ctxt->instate = XML_PARSER_EOF; + ctxt->disableSAX = 1; + return; +#endif + } else { + doc = ctxt->myDoc; + if (doc == NULL) + doc = ctxt->myDoc = xmlNewDoc(ctxt->version); + if (doc != NULL) { + if (doc->children == NULL) { + if (ctxt->encoding != NULL) + doc->encoding = xmlStrdup(ctxt->encoding); + else + doc->encoding = NULL; + doc->standalone = ctxt->standalone; + } + } else { + if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) + ctxt->sax->error(ctxt->userData, + "SAX.startDocument(): out of memory\n"); + ctxt->errNo = XML_ERR_NO_MEMORY; + ctxt->instate = XML_PARSER_EOF; + ctxt->disableSAX = 1; + return; + } + } + if ((ctxt->myDoc != NULL) && (ctxt->myDoc->URL == NULL) && + (ctxt->input != NULL) && (ctxt->input->filename != NULL)) { + ctxt->myDoc->URL = + xmlCanonicPath((const xmlChar *) ctxt->input->filename); + if (ctxt->myDoc->URL == NULL) + ctxt->myDoc->URL = + xmlStrdup((const xmlChar *) ctxt->input->filename); + } +} + #endif