sboag 00/02/25 16:14:44
Modified: src/org/apache/xalan/xslt ElemCopyOf.java
Log:
Fixed xsl:copy-of for attributes.
Revision Changes Path
1.10 +7 -2 xml-xalan/src/org/apache/xalan/xslt/ElemCopyOf.java
Index: ElemCopyOf.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemCopyOf.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ElemCopyOf.java 2000/02/24 21:10:59 1.9
+++ ElemCopyOf.java 2000/02/26 00:14:44 1.10
@@ -155,15 +155,20 @@
for(int i = 0; i < nChildren; i++)
{
Node pos = (Node)nl.item(i);
-
+ int t = pos.getNodeType();
// If we just copy the whole document, a startDoc and endDoc get
// generated, so we need to only walk the child nodes.
- if(pos.getNodeType() == Node.DOCUMENT_NODE)
+ if(t == Node.DOCUMENT_NODE)
{
for(Node child = pos.getFirstChild(); child != null; child =
child.getNextSibling())
{
tw.traverse(child);
}
+ }
+ else if(t == Node.ATTRIBUTE_NODE)
+ {
+ Attr attr = (Attr)pos;
+ processor.m_pendingAttributes.addAttribute(attr.getName(),
"CDATA", attr.getValue());
}
else
{