ilene 2003/03/25 11:45:16
Modified: java/src/org/apache/xalan/res XSLTErrorResources.java
XSLTErrorResources.properties
java/src/org/apache/xalan/templates FuncDocument.java
Log:
Committing Christine Li's ([EMAIL PROTECTED]) patch for bugzilla #18210.
Revision Changes Path
1.37 +1 -1
xml-xalan/java/src/org/apache/xalan/res/XSLTErrorResources.java
Index: XSLTErrorResources.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/res/XSLTErrorResources.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- XSLTErrorResources.java 30 Jan 2003 18:45:46 -0000 1.36
+++ XSLTErrorResources.java 25 Mar 2003 19:45:16 -0000 1.37
@@ -2277,7 +2277,7 @@
// public static final int WG_EMPTY_SECOND_ARG = 26;
{ WG_EMPTY_SECOND_ARG,
- "Resulting nodeset from second argument of document function is empty.
The first agument will be used."},
+ "Resulting nodeset from second argument of document function is empty.
Return an empty node-set."},
//Following are the new WARNING keys added in XALAN code base after Jdk
1.4 (Xalan 2.2-D11)
1.16 +1 -1
xml-xalan/java/src/org/apache/xalan/res/XSLTErrorResources.properties
Index: XSLTErrorResources.properties
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/res/XSLTErrorResources.properties,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- XSLTErrorResources.properties 1 Oct 2002 16:01:28 -0000 1.15
+++ XSLTErrorResources.properties 25 Mar 2003 19:45:16 -0000 1.16
@@ -655,7 +655,7 @@
# WG_ILLEGAL_ATTRIBUTE_VALUE
WR0025=Illegal value used for attribute {0}\u003a {1}
# WG_EMPTY_SECOND_ARG
-WR0026=Resulting nodeset from second argument of document function is empty.
The first agument will be used.
+WR0026=Resulting nodeset from second argument of document function is empty.
Return an empty node-set.
# Note to translators: "name" and "xsl:processing-instruction" are keywords
# and must not be translated.
1.31 +11 -5
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.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- FuncDocument.java 30 Jan 2003 18:45:51 -0000 1.30
+++ FuncDocument.java 25 Mar 2003 19:45:16 -0000 1.31
@@ -130,11 +130,17 @@
int baseNode = arg2.iter().nextNode();
if (baseNode == DTM.NULL)
- warn(xctxt, XSLTErrorResources.WG_EMPTY_SECOND_ARG, null);
-
- DTM baseDTM = xctxt.getDTM(baseNode);
- base = baseDTM.getDocumentBaseURI();
-
+ {
+ // See http://www.w3.org/1999/11/REC-xslt-19991116-errata#E14.
+ // If the second argument is an empty nodeset, this is an error.
+ // The processor can recover by returning an empty nodeset.
+ warn(xctxt, XSLTErrorResources.WG_EMPTY_SECOND_ARG, null);
+ XNodeSet nodes = new XNodeSet(xctxt.getDTMManager());
+ return nodes;
+ } else{
+ DTM baseDTM = xctxt.getDTM(baseNode);
+ base = baseDTM.getDocumentBaseURI();
+ }
// %REVIEW% This doesn't seem to be a problem with the conformance
// suite, but maybe it's just not doing a good test?
// int baseDoc = baseDTM.getDocument();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]