jkesselm 2002/08/20 07:45:28
Modified: java/src/org/apache/xpath Tag: xslt20 XPathContext.java
java/src/org/apache/xpath/parser Tag: xslt20 SimpleNode.java
Added: java/src/org/apache/xpath/functions Tag: xslt20
FuncCompare.java
Log:
Add support for xf:compare.
KNOWN LIMITATION: We don't yet support collations other than default
set into the Static Context. (And even that doesn't know how to map from
collation names to collators.)
KNOWN ISSUE: The spec is fruzzy about whether the collation name
is a URI, a relative URI, or a literal string. They show "deutch" as an
example, which suggests relative would be accepted -- but that's an
*extremely* fragile example, for obvious reasons. Awaiting comment
from them about whether it's a bad illustration or has exposed a hole
in their design.
Revision Changes Path
No revision
No revision
1.40.2.1.2.1 +28 -1 xml-xalan/java/src/org/apache/xpath/XPathContext.java
Index: XPathContext.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/XPathContext.java,v
retrieving revision 1.40.2.1
retrieving revision 1.40.2.1.2.1
diff -u -r1.40.2.1 -r1.40.2.1.2.1
--- XPathContext.java 14 Aug 2002 20:06:57 -0000 1.40.2.1
+++ XPathContext.java 20 Aug 2002 14:45:28 -0000 1.40.2.1.2.1
@@ -1726,4 +1726,31 @@
}
}
-}
+
+ /** XPATH2: Default collation. If not set, should be taken as
+ * standard Unicode codepoint collation
+ * (http://www.w3.org/2002/08/query-operators/collation/codepoint).
+ *
+ * NOTE: We should probably instantiate the collator here.
+ *
+ * NOTE: Mapping these URIs to Java collators is an open question.
+ */
+ private String m2_defaultCollation=null;
+ private java.text.Collator m2_defaultCollator=null;
+
+ public void setDefaultCollation(String collationURI)
+ {
+ m2_defaultCollation=collationURI;
+ // m2_defaultCollator= ...
+ }
+
+ public String getDefaultCollation()
+ {
+ return m2_defaultCollation;
+ }
+
+ public java.text.Collator getDefaultCollator()
+ {
+ return m2_defaultCollator;
+ }
+ }
No revision
No revision
1.1.2.1 +166 -0
xml-xalan/java/src/org/apache/xpath/functions/Attic/FuncCompare.java
No revision
No revision
1.1.2.1.2.5 +3 -0
xml-xalan/java/src/org/apache/xpath/parser/Attic/SimpleNode.java
Index: SimpleNode.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/parser/Attic/SimpleNode.java,v
retrieving revision 1.1.2.1.2.4
retrieving revision 1.1.2.1.2.5
diff -u -r1.1.2.1.2.4 -r1.1.2.1.2.5
--- SimpleNode.java 19 Aug 2002 20:11:53 -0000 1.1.2.1.2.4
+++ SimpleNode.java 20 Aug 2002 14:45:28 -0000 1.1.2.1.2.5
@@ -327,6 +327,9 @@
new QName("unique-ID"),
new FuncUniqueID());
m_builtInFunctions.put(
+ new QName("compare"),
+ new FuncCompare());
+m_builtInFunctions.put(
new QName("matches"),
new FuncMatches());
m_builtInFunctions.put(
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]