[4suite-checkins] In 4Suite/Ft/Xml/Xslt, files DomWriter.py

Jeremy Kloth jkloth at 4suite.org
Wed Dec 20 23:13:35 MST 2006


Modified Files:
    DomWriter.py

Log Message:
- Domlette nodes no longer require an ownerDocument. This means now that
ownerDocument may be None for any or all Nodes if they have yet to be
appended to a tree rooted at a Document.
- Also in these changes, DocumentFragments have been removed as the Document
node type supports the same types of children that DocumentFragments did.
- Saxlette now fully supports the EntityResolver interface, and defaults
to the previous behavior of using the InputSource if no resolver has been
registered.

ViewCVS diff:
  http://cvs.4suite.org/viewcvs/4Suite/Ft/Xml/Xslt/DomWriter.py.diff?r1=1.15&r2=1.16
ViewCVS view:
  http://cvs.4suite.org/viewcvs/4Suite/Ft/Xml/Xslt/DomWriter.py?rev=1.16&content-type=text/vnd.viewcvs-markup

Index: DomWriter.py
===================================================================
RCS file: /var/local/cvsroot/4Suite/Ft/Xml/Xslt/DomWriter.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -U2 -r1.15 -r1.16
--- DomWriter.py	28 Mar 2005 09:04:20 -0000	1.15
+++ DomWriter.py	21 Dec 2006 06:13:35 -0000	1.16
@@ -22,5 +22,5 @@
 
 from Ft.Xml import XMLNS_NAMESPACE, EMPTY_NAMESPACE
-from Ft.Xml.Domlette import implementation
+from Ft.Xml.Domlette import Document
 from Ft.Xml.Lib.XmlString import SplitQName
 from Ft.Xml.Xslt import NullWriter
@@ -28,5 +28,5 @@
 
 class DomWriter(NullWriter.NullWriter):
-    def __init__(self, ownerDoc=None, implementation=implementation, outputParams=None):
+    def __init__(self, ownerDoc=None, outputParams=None):
         """
         Note: if no ownerDoc, there is no way to set the document's base URI.
@@ -34,5 +34,5 @@
         NullWriter.NullWriter.__init__(self)
         if not ownerDoc:
-            ownerDoc = implementation.createDocument(None, None, None)
+            ownerDoc = Document()
             self._root = ownerDoc
         else:
@@ -45,5 +45,5 @@
 
     def _completeTextNode(self):
-        if self._currText and len(self._nodeStack) and self._nodeStack[-1].nodeType != Node.DOCUMENT_NODE:
+        if self._currText and len(self._nodeStack):
             new_text = self._ownerDoc.createTextNode(self._currText)
             self._nodeStack[-1].appendChild(new_text)


More information about the 4suite-checkins mailing list