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 2004/04/20 15:37:02 UTC
cvs commit: cocoon-lenya/src/java/org/apache/lenya/xml XPSAssembler.java
michi 2004/04/20 06:37:02
Modified: src/java/org/apache/lenya/xml XPSAssembler.java
Log:
replace, embed and enclose bug fixed
Revision Changes Path
1.23 +18 -9 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.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- XPSAssembler.java 24 Mar 2004 22:11:41 -0000 1.22
+++ XPSAssembler.java 20 Apr 2004 13:37:02 -0000 1.23
@@ -439,7 +439,7 @@
}
/**
- * DOCUMENT ME!
+ * Process XLink
*
* @param xlink DOCUMENT ME!
* @param orgChild DOCUMENT ME!
@@ -450,7 +450,9 @@
public NodeList processXLink(XLink xlink, Element orgChild, XPSSourceInformation currentInfo) {
NodeList nl = null;
- if (!xlink.show.equals("embed")) {
+ // NOTE: if no show attribute is specified, then the value will be set to "undefined"
+ if (!(xlink.show.equals("embed") || xlink.show.equals("enclose") || xlink.show.equals("replace"))) {
+ log.warn("No such value of attribute \"show\" implemented: " + xlink.show);
nl = noNodesReturnedFromXLink(xlink);
} else {
Vector args = new Vector();
@@ -483,24 +485,31 @@
Document xlinkedDocument = firstChild.getOwnerDocument();
Element dummyRoot = dpf.newElementNode(xlinkedDocument, "DummyRoot");
- if (conf.INCLUDE.equals("replace")) {
+ if (xlink.show.equals("embed")) {
+ //if (conf.INCLUDE.equals("embed")) {
+ // WARNING: embed was actually meant to also include the actual xlink, but
+ // it was never really implemented and hence led to the misinterpretation of replace
+ // Therefore we treat it the same as replace
+ //dummyRoot.appendChild(xlink.getXLink(xlinkedDocument, dpf));
+
for (int i = 0; i < newChildren.size(); i++) {
dummyRoot.appendChild((Node) newChildren.elementAt(i));
}
- } else if (conf.INCLUDE.equals("embed")) {
- dummyRoot.appendChild(xlink.getXLink(xlinkedDocument, dpf));
-
+ } else if (xlink.show.equals("replace")) {
+ //} else if (conf.INCLUDE.equals("replace")) {
for (int i = 0; i < newChildren.size(); i++) {
dummyRoot.appendChild((Node) newChildren.elementAt(i));
}
- } else if (conf.INCLUDE.equals("enclose")) {
+ } else if (xlink.show.equals("enclose")) {
+ //} else if (conf.INCLUDE.equals("enclose")) {
Element xlinkCopy = xlink.getXLink(xlinkedDocument, dpf);
for (int i = 0; i < newChildren.size(); i++) {
xlinkCopy.appendChild((Node) newChildren.elementAt(i));
}
-
dummyRoot.appendChild(xlinkCopy);
+ } else {
+ log.warn("No such attribute \"show\" or such value of attribute \"show\" implemented");
}
nl = dummyRoot.getChildNodes();
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org