zongaro 2003/10/16 13:17:52
Modified: java/src/org/apache/xalan/transformer
TransformerIdentityImpl.java
Log:
Patch from Christine Li ([EMAIL PROTECTED]) for Bugzilla bug report 22880.
When input comes from DOMSource, a TreeWalker object walks the DOM input and
fires events to the ContentHandler for the result object, unless the DOM
consists of only an Attribute node. In the case of an Attribute, the
TreeWalker
is not utilized, and just the character data is copied to the result.
As part of the traversal of the DOM, the TreeWalker always fires startDocument
and endDocument events. The code in the transform(Source,Result) method was
redundantly firing those same events if the Node specified by the DOMSource
was not a Document node. Instead, that should be left to the TreeWalker. The
startDocument and endDocument events should only be fired in the transform
method itself to complete the entirely local processing of Attribute nodes.
Revision Changes Path
1.25 +2 -2
xml-xalan/java/src/org/apache/xalan/transformer/TransformerIdentityImpl.java
Index: TransformerIdentityImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TransformerIdentityImpl.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- TransformerIdentityImpl.java 1 Apr 2003 20:26:39 -0000 1.24
+++ TransformerIdentityImpl.java 16 Oct 2003 20:17:52 -0000 1.25
@@ -327,7 +327,7 @@
{
try
{
- if(dNode.getNodeType() != Node.DOCUMENT_NODE)
+ if(dNode.getNodeType() == Node.ATTRIBUTE_NODE)
this.startDocument();
try
{
@@ -345,7 +345,7 @@
}
finally
{
- if(dNode.getNodeType() != Node.DOCUMENT_NODE)
+ if(dNode.getNodeType() == Node.ATTRIBUTE_NODE)
this.endDocument();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]