You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by mi...@apache.org on 2003/10/02 05:55:20 UTC
cvs commit: cocoon-lenya/src/java/org/apache/lenya/xml XPSAssembler.java DOMParserFactory.java
michi 2003/10/01 20:55:20
Modified: src/java/org/apache/lenya/xml XPSAssembler.java
DOMParserFactory.java
Log:
Attribute Namespace problem fixed
Revision Changes Path
1.16 +3 -5 cocoon-lenya/src/java/org/apache/lenya/xml/XPSAssembler.java
Index: XPSAssembler.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/xml/XPSAssembler.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- XPSAssembler.java 13 Aug 2003 16:24:12 -0000 1.15
+++ XPSAssembler.java 2 Oct 2003 03:55:19 -0000 1.16
@@ -203,8 +203,7 @@
assembledDocument.appendChild(assembledRoot);
File workingDirectory = new File(System.getProperty("user.dir"));
- XPSSourceInformation sourceInfo = new XPSSourceInformation("file:" + workingDirectory +
- "/dummy.xml", cocoon);
+ XPSSourceInformation sourceInfo = new XPSSourceInformation("file:" + workingDirectory + "/dummy.xml", cocoon);
XPSSourceInformation currentInfo = new XPSSourceInformation(reference, sourceInfo, cocoon);
NodeList nl = root.getChildNodes();
@@ -423,8 +422,7 @@
XLink xlink = new XLink((Element) orgChild);
if (xlink.href == null) {
- Element newElement = (Element) dpf.cloneNode(newParent.getOwnerDocument(),
- orgChild, false);
+ Element newElement = (Element) dpf.cloneNode(newParent.getOwnerDocument(), orgChild, false);
newChildren.addElement(newElement);
} else {
noXLink = false;
1.16 +9 -7 cocoon-lenya/src/java/org/apache/lenya/xml/DOMParserFactory.java
Index: DOMParserFactory.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/xml/DOMParserFactory.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- DOMParserFactory.java 13 Aug 2003 16:24:12 -0000 1.15
+++ DOMParserFactory.java 2 Oct 2003 03:55:19 -0000 1.16
@@ -242,13 +242,13 @@
}
/**
- * DOCUMENT ME!
+ * Clone node, which means copy a node into another document
*
- * @param document DOCUMENT ME!
- * @param original DOCUMENT ME!
- * @param deep DOCUMENT ME!
+ * @param document New document where original nodes shall be attached to
+ * @param original Original node from original document
+ * @param deep true means clone also all children
*
- * @return DOCUMENT ME!
+ * @return New node, which is clone of original node
*/
public Node cloneNode(Document document, Node original, boolean deep) {
Node node = null;
@@ -257,11 +257,13 @@
switch (nodeType) {
case Node.ELEMENT_NODE: {
Element element = newElementNode(document, original.getNodeName());
+ log.debug(".cloneNode(): Clone element: " + original.getNodeName());
NamedNodeMap attributes = original.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node attribute = attributes.item(i);
- element.setAttribute(attribute.getNodeName(), attribute.getNodeValue());
+ log.debug(".cloneNode(): LocalName: " + attribute.getLocalName() + ", Prefix: " + attribute.getPrefix() + ", NamespaceURI: " + attribute.getNamespaceURI());
+ element.setAttributeNS(attribute.getNamespaceURI(), attribute.getNodeName(), attribute.getNodeValue());
}
node = element;
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org