[Lxml-checkins] r42775 - lxml/trunk/src/lxml
scoder at codespeak.net
scoder at codespeak.net
Mon May 7 11:02:49 CEST 2007
Author: scoder
Date: Mon May 7 11:02:48 2007
New Revision: 42775
Modified:
lxml/trunk/src/lxml/relaxng.pxi
lxml/trunk/src/lxml/xmlschema.pxi
Log:
make clear when libxml2 bug was fixed
Modified: lxml/trunk/src/lxml/relaxng.pxi
==============================================================================
--- lxml/trunk/src/lxml/relaxng.pxi (original)
+++ lxml/trunk/src/lxml/relaxng.pxi Mon May 7 11:02:48 2007
@@ -32,11 +32,12 @@
root_node = _rootNodeOrRaise(etree)
c_node = root_node._c_node
# work around for libxml2 bug if document is not RNG at all
- c_href = _getNs(c_node)
- if c_href is NULL or \
- cstd.strcmp(c_href,
- 'http://relaxng.org/ns/structure/1.0') != 0:
- raise RelaxNGParseError, "Document is not Relax NG"
+ if _LIBXML_VERSION_INT < 20624:
+ c_href = _getNs(c_node)
+ if c_href is NULL or \
+ cstd.strcmp(c_href,
+ 'http://relaxng.org/ns/structure/1.0') != 0:
+ raise RelaxNGParseError, "Document is not Relax NG"
fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(fake_c_doc)
elif file is not None:
Modified: lxml/trunk/src/lxml/xmlschema.pxi
==============================================================================
--- lxml/trunk/src/lxml/xmlschema.pxi (original)
+++ lxml/trunk/src/lxml/xmlschema.pxi Mon May 7 11:02:48 2007
@@ -30,11 +30,12 @@
root_node = _rootNodeOrRaise(etree)
# work around for libxml2 bug if document is not XML schema at all
- c_node = root_node._c_node
- c_href = _getNs(c_node)
- if c_href is NULL or \
- cstd.strcmp(c_href, 'http://www.w3.org/2001/XMLSchema') != 0:
- raise XMLSchemaParseError, "Document is not XML Schema"
+ if _LIBXML_VERSION_INT < 20624:
+ c_node = root_node._c_node
+ c_href = _getNs(c_node)
+ if c_href is NULL or \
+ cstd.strcmp(c_href, 'http://www.w3.org/2001/XMLSchema') != 0:
+ raise XMLSchemaParseError, "Document is not XML Schema"
fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
parser_ctxt = xmlschema.xmlSchemaNewDocParserCtxt(fake_c_doc)
More information about the lxml-checkins
mailing list