1.1 --- a/libxml2dom/macrolib/__init__.py Thu Dec 01 01:59:06 2005 +0000
1.2 +++ b/libxml2dom/macrolib/__init__.py Thu Dec 01 01:59:42 2005 +0000
1.3 @@ -2,7 +2,7 @@
1.4
1.5 "DOM macro library for libxml2."
1.6
1.7 -__version__ = "0.2.4"
1.8 +__version__ = "0.2.5"
1.9
1.10 # Expose all functions here.
1.11
2.1 --- a/libxml2dom/macrolib/macrolib.py Thu Dec 01 01:59:06 2005 +0000
2.2 +++ b/libxml2dom/macrolib/macrolib.py Thu Dec 01 01:59:42 2005 +0000
2.3 @@ -62,7 +62,9 @@
2.4 child_nodes = []
2.5 node = libxml2mod.children(node)
2.6 while node is not None:
2.7 - child_nodes.append(node)
2.8 + # Remove doctypes.
2.9 + if Node_nodeType(node) != xml.dom.Node.DOCUMENT_TYPE_NODE:
2.10 + child_nodes.append(node)
2.11 node = libxml2mod.next(node)
2.12 return child_nodes
2.13
2.14 @@ -140,6 +142,9 @@
2.15 else:
2.16 return None
2.17
2.18 +def Node_doctype(node):
2.19 + return libxml2mod.xmlGetIntSubset(node)
2.20 +
2.21 def Node_hasAttributeNS(node, ns, localName):
2.22 return Node_getAttributeNS(node, ns, localName) is not None
2.23
2.24 @@ -331,15 +336,14 @@
2.25
2.26 # Utility functions.
2.27
2.28 -def createDocumentType(localName, publicId, systemId):
2.29 - return None
2.30 -
2.31 def createDocument(namespaceURI, localName, doctype):
2.32 # NOTE: Fixed to use version 1.0 only.
2.33 d = libxml2mod.xmlNewDoc("1.0")
2.34 if localName is not None:
2.35 root = Node_createElementNS(d, namespaceURI, localName)
2.36 Node_appendChild(d, root)
2.37 + if doctype is not None:
2.38 + libxml2mod.xmlCreateIntSubset(d, doctype.localName, doctype.publicId, doctype.systemId)
2.39 return d
2.40
2.41 def parse(stream_or_string, html=0):