Fix ChangeLog merge conflict
diff --git a/ChangeLog b/ChangeLog
index b5c0a8b..9a1666d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Thu Jul 9 08:52:35 CEST 2009 Daniel Veillard <daniel@veillard.com>
+
+ * config.h.in: update of libtool seems to have modified it
+ * python/libxml2class.txt: python update modified the order
+ of classes apparently
+
+Thu Jul 9 08:43:06 CEST 2009 Daniel Veillard <daniel@veillard.com>
+
+ * tree.c: avoid calling xmlAddID with NULL values
+ * parser.c: add a few xmlInitParser in some entry points
+
Fri Jun 19 19:51:08 CEST 2009 Rob Richards <rrichards@cdatazone.org>
* parser.c: use options from current parser context when creating
@@ -8,7 +19,7 @@
* c14n.c debugXML.c doc/examples/io2.c parser.c schematron.c
valid.c xmlschemas.c xmlwriter.c xpath.c: use %s to printf string
- patch by Christian Persch
+ patch by Christian Persch, fixes #581612
Thu Jun 4 11:06:07 CEST 2009 Daniel Veillard <daniel@veillard.com>
diff --git a/config.h.in b/config.h.in
index 1285789..736c491 100644
--- a/config.h.in
+++ b/config.h.in
@@ -252,6 +252,10 @@
/* Define as const if the declaration of iconv() needs const. */
#undef ICONV_CONST
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
/* Name of package */
#undef PACKAGE
diff --git a/parser.c b/parser.c
index f02aa1c..4ee9b43 100644
--- a/parser.c
+++ b/parser.c
@@ -13552,6 +13552,8 @@
xmlDocPtr ret;
xmlParserCtxtPtr ctxt;
+ xmlInitParser();
+
ctxt = xmlCreateMemoryParserCtxt(buffer, size);
if (ctxt == NULL) return(NULL);
if (sax != NULL) {
@@ -13577,7 +13579,7 @@
if (sax != NULL)
ctxt->sax = NULL;
xmlFreeParserCtxt(ctxt);
-
+
return(ret);
}
@@ -13640,14 +13642,16 @@
*
* A better SAX parsing routine.
* parse an XML in-memory buffer and call the given SAX handler routines.
- *
+ *
* Returns 0 in case of success or a error number otherwise
*/
int xmlSAXUserParseMemory(xmlSAXHandlerPtr sax, void *user_data,
const char *buffer, int size) {
int ret = 0;
xmlParserCtxtPtr ctxt;
-
+
+ xmlInitParser();
+
ctxt = xmlCreateMemoryParserCtxt(buffer, size);
if (ctxt == NULL) return -1;
if (ctxt->sax != (xmlSAXHandlerPtr) &xmlDefaultSAXHandler)
@@ -13657,7 +13661,7 @@
if (user_data != NULL)
ctxt->userData = user_data;
-
+
xmlParseDocument(ctxt);
if (ctxt->wellFormed)
diff --git a/python/libxml2class.txt b/python/libxml2class.txt
index 1b8db59..1e747ed 100644
--- a/python/libxml2class.txt
+++ b/python/libxml2class.txt
@@ -678,6 +678,64 @@
# functions from module xpointer
xpointerNewContext()
+Class xpathContext()
+ # accessors
+ contextDoc()
+ contextNode()
+ contextPosition()
+ contextSize()
+ function()
+ functionURI()
+ setContextDoc()
+ setContextNode()
+
+ # functions from module python
+ registerXPathFunction()
+
+ # functions from module xpath
+ xpathContextSetCache()
+ xpathEval()
+ xpathEvalExpression()
+ xpathFreeContext()
+
+ # functions from module xpathInternals
+ xpathNewParserContext()
+ xpathNsLookup()
+ xpathRegisterAllFunctions()
+ xpathRegisterNs()
+ xpathRegisteredFuncsCleanup()
+ xpathRegisteredNsCleanup()
+ xpathRegisteredVariablesCleanup()
+ xpathVariableLookup()
+ xpathVariableLookupNS()
+
+ # functions from module xpointer
+ xpointerEval()
+
+
+Class xmlAttribute(xmlNode)
+
+
+Class ValidCtxt(ValidCtxtCore)
+
+ # functions from module valid
+ validCtxtNormalizeAttributeValue()
+ validateDocument()
+ validateDocumentFinal()
+ validateDtd()
+ validateDtdFinal()
+ validateElement()
+ validateNotationUse()
+ validateOneAttribute()
+ validateOneElement()
+ validateOneNamespace()
+ validatePopElement()
+ validatePushCData()
+ validatePushElement()
+ validateRoot()
+
+
+Class xmlElement(xmlNode)
Class xmlAttr(xmlNode)
@@ -696,12 +754,126 @@
# functions from module valid
removeID()
removeRef()
+
+
+Class xmlTextReader(xmlTextReaderCore)
+
+ # functions from module xmlreader
+ AttributeCount()
+ BaseUri()
+ ByteConsumed()
+ Close()
+ CurrentDoc()
+ CurrentNode()
+ Depth()
+ Encoding()
+ Expand()
+ GetAttribute()
+ GetAttributeNo()
+ GetAttributeNs()
+ GetParserColumnNumber()
+ GetParserLineNumber()
+ GetParserProp()
+ GetRemainder()
+ HasAttributes()
+ HasValue()
+ IsDefault()
+ IsEmptyElement()
+ IsNamespaceDecl()
+ IsValid()
+ LocalName()
+ LookupNamespace()
+ MoveToAttribute()
+ MoveToAttributeNo()
+ MoveToAttributeNs()
+ MoveToElement()
+ MoveToFirstAttribute()
+ MoveToNextAttribute()
+ Name()
+ NamespaceUri()
+ NewDoc()
+ NewFd()
+ NewFile()
+ NewMemory()
+ NewWalker()
+ Next()
+ NextSibling()
+ NodeType()
+ Normalization()
+ Prefix()
+ Preserve()
+ QuoteChar()
+ Read()
+ ReadAttributeValue()
+ ReadInnerXml()
+ ReadOuterXml()
+ ReadState()
+ ReadString()
+ RelaxNGSetSchema()
+ RelaxNGValidate()
+ SchemaValidate()
+ SchemaValidateCtxt()
+ SetParserProp()
+ SetSchema()
+ Setup()
+ Standalone()
+ String()
+ Value()
+ XmlLang()
+ XmlVersion()
Class xmlReg()
# functions from module xmlregexp
regexpExec()
regexpIsDeterminist()
regexpPrint()
+Class catalog()
+
+ # functions from module catalog
+ add()
+ catalogIsEmpty()
+ convertSGMLCatalog()
+ dump()
+ remove()
+ resolve()
+ resolvePublic()
+ resolveSystem()
+ resolveURI()
+
+
+Class xmlEntity(xmlNode)
+
+ # functions from module parserInternals
+ handleEntity()
+Class relaxNgSchema()
+
+ # functions from module relaxng
+ relaxNGDump()
+ relaxNGDumpTree()
+ relaxNGNewValidCtxt()
+
+ # functions from module xmlreader
+ RelaxNGSetSchema()
+Class Schema()
+
+ # functions from module xmlreader
+ SetSchema()
+
+ # functions from module xmlschemas
+ schemaDump()
+ schemaNewValidCtxt()
+Class Error()
+ # accessors
+ code()
+ domain()
+ file()
+ level()
+ line()
+ message()
+
+ # functions from module xmlerror
+ copyError()
+ resetError()
Class relaxNgValidCtxt(relaxNgValidCtxtCore)
@@ -712,6 +884,73 @@
relaxNGValidatePopElement()
relaxNGValidatePushCData()
relaxNGValidatePushElement()
+Class xpathParserContext()
+ # accessors
+ context()
+
+ # functions from module xpathInternals
+ xpathAddValues()
+ xpathBooleanFunction()
+ xpathCeilingFunction()
+ xpathCompareValues()
+ xpathConcatFunction()
+ xpathContainsFunction()
+ xpathCountFunction()
+ xpathDivValues()
+ xpathEqualValues()
+ xpathErr()
+ xpathEvalExpr()
+ xpathFalseFunction()
+ xpathFloorFunction()
+ xpathFreeParserContext()
+ xpathIdFunction()
+ xpathLangFunction()
+ xpathLastFunction()
+ xpathLocalNameFunction()
+ xpathModValues()
+ xpathMultValues()
+ xpathNamespaceURIFunction()
+ xpathNextAncestor()
+ xpathNextAncestorOrSelf()
+ xpathNextAttribute()
+ xpathNextChild()
+ xpathNextDescendant()
+ xpathNextDescendantOrSelf()
+ xpathNextFollowing()
+ xpathNextFollowingSibling()
+ xpathNextNamespace()
+ xpathNextParent()
+ xpathNextPreceding()
+ xpathNextPrecedingSibling()
+ xpathNextSelf()
+ xpathNormalizeFunction()
+ xpathNotEqualValues()
+ xpathNotFunction()
+ xpathNumberFunction()
+ xpathParseNCName()
+ xpathParseName()
+ xpathPopBoolean()
+ xpathPopNumber()
+ xpathPopString()
+ xpathPositionFunction()
+ xpathRoot()
+ xpathRoundFunction()
+ xpathStartsWithFunction()
+ xpathStringFunction()
+ xpathStringLengthFunction()
+ xpathSubValues()
+ xpathSubstringAfterFunction()
+ xpathSubstringBeforeFunction()
+ xpathSubstringFunction()
+ xpathSumFunction()
+ xpathTranslateFunction()
+ xpathTrueFunction()
+ xpathValueFlipSign()
+ xpatherror()
+
+ # functions from module xpointer
+ xpointerEvalRangePredicate()
+ xpointerRangeToFunction()
Class parserCtxt(parserCtxtCore)
@@ -819,101 +1058,6 @@
dtdElementDesc()
dtdQAttrDesc()
dtdQElementDesc()
-Class relaxNgParserCtxt()
-
- # functions from module relaxng
- relaxNGParse()
- relaxParserSetFlag()
-Class xpathParserContext()
- # accessors
- context()
-
- # functions from module xpathInternals
- xpathAddValues()
- xpathBooleanFunction()
- xpathCeilingFunction()
- xpathCompareValues()
- xpathConcatFunction()
- xpathContainsFunction()
- xpathCountFunction()
- xpathDivValues()
- xpathEqualValues()
- xpathErr()
- xpathEvalExpr()
- xpathFalseFunction()
- xpathFloorFunction()
- xpathFreeParserContext()
- xpathIdFunction()
- xpathLangFunction()
- xpathLastFunction()
- xpathLocalNameFunction()
- xpathModValues()
- xpathMultValues()
- xpathNamespaceURIFunction()
- xpathNextAncestor()
- xpathNextAncestorOrSelf()
- xpathNextAttribute()
- xpathNextChild()
- xpathNextDescendant()
- xpathNextDescendantOrSelf()
- xpathNextFollowing()
- xpathNextFollowingSibling()
- xpathNextNamespace()
- xpathNextParent()
- xpathNextPreceding()
- xpathNextPrecedingSibling()
- xpathNextSelf()
- xpathNormalizeFunction()
- xpathNotEqualValues()
- xpathNotFunction()
- xpathNumberFunction()
- xpathParseNCName()
- xpathParseName()
- xpathPopBoolean()
- xpathPopNumber()
- xpathPopString()
- xpathPositionFunction()
- xpathRoot()
- xpathRoundFunction()
- xpathStartsWithFunction()
- xpathStringFunction()
- xpathStringLengthFunction()
- xpathSubValues()
- xpathSubstringAfterFunction()
- xpathSubstringBeforeFunction()
- xpathSubstringFunction()
- xpathSumFunction()
- xpathTranslateFunction()
- xpathTrueFunction()
- xpathValueFlipSign()
- xpatherror()
-
- # functions from module xpointer
- xpointerEvalRangePredicate()
- xpointerRangeToFunction()
-Class SchemaParserCtxt()
-
- # functions from module xmlschemas
- schemaParse()
-
-
-Class ValidCtxt(ValidCtxtCore)
-
- # functions from module valid
- validCtxtNormalizeAttributeValue()
- validateDocument()
- validateDocumentFinal()
- validateDtd()
- validateDtdFinal()
- validateElement()
- validateNotationUse()
- validateOneAttribute()
- validateOneElement()
- validateOneNamespace()
- validatePopElement()
- validatePushCData()
- validatePushElement()
- validateRoot()
Class xmlNs(xmlNode)
@@ -937,6 +1081,60 @@
# functions from module xpathInternals
xpathNodeSetFreeNs()
+
+
+Class inputBuffer(ioReadWrapper)
+
+ # functions from module xmlIO
+ grow()
+ push()
+ read()
+
+ # functions from module xmlreader
+ Setup()
+ newTextReader()
+Class relaxNgParserCtxt()
+
+ # functions from module relaxng
+ relaxNGParse()
+ relaxParserSetFlag()
+
+
+Class outputBuffer(ioWriteWrapper)
+
+ # functions from module HTMLtree
+ htmlDocContentDumpFormatOutput()
+ htmlDocContentDumpOutput()
+ htmlNodeDumpFormatOutput()
+ htmlNodeDumpOutput()
+
+ # functions from module tree
+ nodeDumpOutput()
+ saveFileTo()
+ saveFormatFileTo()
+
+ # functions from module xmlIO
+ write()
+ writeString()
+Class SchemaParserCtxt()
+
+ # functions from module xmlschemas
+ schemaParse()
+
+
+Class SchemaValidCtxt(SchemaValidCtxtCore)
+
+ # functions from module xmlreader
+ SchemaValidateCtxt()
+
+ # functions from module xmlschemas
+ schemaIsValid()
+ schemaSetValidOptions()
+ schemaValidCtxtGetOptions()
+ schemaValidCtxtGetParserCtxt()
+ schemaValidateDoc()
+ schemaValidateFile()
+ schemaValidateOneElement()
Class xmlTextReaderLocator()
# functions from module xmlreader
@@ -969,201 +1167,3 @@
parseURIReference()
printURI()
saveUri()
-
-
-Class xmlAttribute(xmlNode)
-Class catalog()
-
- # functions from module catalog
- add()
- catalogIsEmpty()
- convertSGMLCatalog()
- dump()
- remove()
- resolve()
- resolvePublic()
- resolveSystem()
- resolveURI()
-Class xpathContext()
- # accessors
- contextDoc()
- contextNode()
- contextPosition()
- contextSize()
- function()
- functionURI()
- setContextDoc()
- setContextNode()
-
- # functions from module python
- registerXPathFunction()
-
- # functions from module xpath
- xpathContextSetCache()
- xpathEval()
- xpathEvalExpression()
- xpathFreeContext()
-
- # functions from module xpathInternals
- xpathNewParserContext()
- xpathNsLookup()
- xpathRegisterAllFunctions()
- xpathRegisterNs()
- xpathRegisteredFuncsCleanup()
- xpathRegisteredNsCleanup()
- xpathRegisteredVariablesCleanup()
- xpathVariableLookup()
- xpathVariableLookupNS()
-
- # functions from module xpointer
- xpointerEval()
-
-
-Class xmlElement(xmlNode)
-
-
-Class xmlTextReader(xmlTextReaderCore)
-
- # functions from module xmlreader
- AttributeCount()
- BaseUri()
- ByteConsumed()
- Close()
- CurrentDoc()
- CurrentNode()
- Depth()
- Encoding()
- Expand()
- GetAttribute()
- GetAttributeNo()
- GetAttributeNs()
- GetParserColumnNumber()
- GetParserLineNumber()
- GetParserProp()
- GetRemainder()
- HasAttributes()
- HasValue()
- IsDefault()
- IsEmptyElement()
- IsNamespaceDecl()
- IsValid()
- LocalName()
- LookupNamespace()
- MoveToAttribute()
- MoveToAttributeNo()
- MoveToAttributeNs()
- MoveToElement()
- MoveToFirstAttribute()
- MoveToNextAttribute()
- Name()
- NamespaceUri()
- NewDoc()
- NewFd()
- NewFile()
- NewMemory()
- NewWalker()
- Next()
- NextSibling()
- NodeType()
- Normalization()
- Prefix()
- Preserve()
- QuoteChar()
- Read()
- ReadAttributeValue()
- ReadInnerXml()
- ReadOuterXml()
- ReadState()
- ReadString()
- RelaxNGSetSchema()
- RelaxNGValidate()
- SchemaValidate()
- SchemaValidateCtxt()
- SetParserProp()
- SetSchema()
- Setup()
- Standalone()
- String()
- Value()
- XmlLang()
- XmlVersion()
-
-
-Class xmlEntity(xmlNode)
-
- # functions from module parserInternals
- handleEntity()
-Class Schema()
-
- # functions from module xmlreader
- SetSchema()
-
- # functions from module xmlschemas
- schemaDump()
- schemaNewValidCtxt()
-Class Error()
- # accessors
- code()
- domain()
- file()
- level()
- line()
- message()
-
- # functions from module xmlerror
- copyError()
- resetError()
-Class relaxNgSchema()
-
- # functions from module relaxng
- relaxNGDump()
- relaxNGDumpTree()
- relaxNGNewValidCtxt()
-
- # functions from module xmlreader
- RelaxNGSetSchema()
-
-
-Class inputBuffer(ioReadWrapper)
-
- # functions from module xmlIO
- grow()
- push()
- read()
-
- # functions from module xmlreader
- Setup()
- newTextReader()
-
-
-Class SchemaValidCtxt(SchemaValidCtxtCore)
-
- # functions from module xmlreader
- SchemaValidateCtxt()
-
- # functions from module xmlschemas
- schemaIsValid()
- schemaSetValidOptions()
- schemaValidCtxtGetOptions()
- schemaValidCtxtGetParserCtxt()
- schemaValidateDoc()
- schemaValidateFile()
- schemaValidateOneElement()
-
-
-Class outputBuffer(ioWriteWrapper)
-
- # functions from module HTMLtree
- htmlDocContentDumpFormatOutput()
- htmlDocContentDumpOutput()
- htmlNodeDumpFormatOutput()
- htmlNodeDumpOutput()
-
- # functions from module tree
- nodeDumpOutput()
- saveFileTo()
- saveFormatFileTo()
-
- # functions from module xmlIO
- write()
- writeString()
diff --git a/tree.c b/tree.c
index be5c6b9..6d0e95b 100644
--- a/tree.c
+++ b/tree.c
@@ -1860,7 +1860,8 @@
}
}
- if (xmlIsID((node == NULL) ? NULL : node->doc, node, cur) == 1)
+ if ((value != NULL) &&
+ (xmlIsID((node == NULL) ? NULL : node->doc, node, cur) == 1))
xmlAddID(NULL, node->doc, value, cur);
if ((__xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))