You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by tm...@apache.org on 2002/06/10 20:59:00 UTC
cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/trax SAX2DOM.java
tmiller 2002/06/10 11:59:00
Modified: java/src/org/apache/xalan/xsltc/trax SAX2DOM.java
Log:
fixed processing instruction call
Revision Changes Path
1.13 +11 -5 xml-xalan/java/src/org/apache/xalan/xsltc/trax/SAX2DOM.java
Index: SAX2DOM.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/SAX2DOM.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- SAX2DOM.java 28 May 2002 19:35:26 -0000 1.12
+++ SAX2DOM.java 10 Jun 2002 18:59:00 -0000 1.13
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: SAX2DOM.java,v 1.12 2002/05/28 19:35:26 santiagopg Exp $
+ * @(#)$Id: SAX2DOM.java,v 1.13 2002/06/10 18:59:00 tmiller Exp $
*
* The Apache Software License, Version 1.1
*
@@ -73,6 +73,7 @@
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
+import org.w3c.dom.ProcessingInstruction;
import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
import org.w3c.dom.Text;
@@ -87,7 +88,8 @@
private Vector _namespaceDecls = null;
public SAX2DOM() throws ParserConfigurationException {
- final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ final DocumentBuilderFactory factory =
+ DocumentBuilderFactory.newInstance();
_root = factory.newDocumentBuilder().newDocument();
}
@@ -96,7 +98,8 @@
_root = (Document) root; // TODO: add support for frags and elems
}
else {
- final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ final DocumentBuilderFactory factory =
+ DocumentBuilderFactory.newInstance();
_root = factory.newDocumentBuilder().newDocument();
}
}
@@ -189,10 +192,13 @@
}
/**
- * This class is only used internally so this method should never
- * be called.
+ * adds processing instruction node to DOM.
*/
public void processingInstruction(String target, String data) {
+ final Node last = (Node)_nodeStk.peek();
+ ProcessingInstruction pi = _root.createProcessingInstruction(
+ target, data);
+ if (pi != null) last.appendChild(pi);
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org