You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mm...@apache.org on 2001/08/17 21:21:20 UTC
cvs commit: xml-xalan/java/src/org/apache/xalan/templates FuncDocument.java
mmidy 01/08/17 12:21:20
Modified: java/src/org/apache/xalan/templates FuncDocument.java
Log:
Fix document function so that if only one argument is passed and it is a nodetest, the base to be used to resolve relative URIs is the base of the each node in the nodeset.
Revision Changes Path
1.24 +14 -0 xml-xalan/java/src/org/apache/xalan/templates/FuncDocument.java
Index: FuncDocument.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/FuncDocument.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- FuncDocument.java 2001/07/28 00:25:58 1.23
+++ FuncDocument.java 2001/08/17 19:21:20 1.24
@@ -192,6 +192,20 @@
{
XMLString ref = (null != iterator)
? xctxt.getDTM(pos).getStringValue(pos) : arg.xstr();
+
+ // The first and only argument was a nodeset, the base in that
+ // case is the base URI of the node from the first argument nodeset.
+ // Remember, when the document function has exactly one argument and
+ // the argument is a node-set, then the result is the union, for each
+ // node in the argument node-set, of the result of calling the document
+ // function with the first argument being the string-value of the node,
+ // and the second argument being a node-set with the node as its only
+ // member.
+ if (null == arg1Expr && DTM.NULL != pos)
+ {
+ DTM baseDTM = xctxt.getDTM(pos);
+ base = baseDTM.getDocumentBaseURI();
+ }
if (null == ref)
continue;
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org