jkesselm 2002/08/27 13:51:19
Modified: java/src/org/apache/xml/dtm/ref/xni2dtm Tag: xslt20
XPath2Type.java
java/src/org/apache/xpath/functions Tag: xslt20
FuncNodeKind.java FuncNodeName.java
java/src/org/apache/xpath/objects Tag: xslt20
XExpandedQName.java XObjectFactory.java
java/src/org/apache/xpath/parser Tag: xslt20 SimpleNode.java
Added: java/src/org/apache/xpath/functions Tag: xslt20
FuncExpandedQName.java
FuncGetLocalNameFromQName.java
FuncGetNamespaceFromQName.java
Log:
QName-related operations:
xf:node-name() xf:expanded-QName(), and xf:data() now return
XExpandedQName objects. These have no lexical value (ie,
can not be converted to strings), but can be compared for equality
or examined via the xf:get-*-from-QName() functions.
We're having to do a low-level conversion from XNI QName to
Xalan QName. Xalan and Xerces really need to get together and
move a bunch of these datatypes into the XML-COMMONS
project so we can share them without explicitly depending on each
other.
Revision Changes Path
No revision
No revision
1.1.2.1.2.4 +9 -2
xml-xalan/java/src/org/apache/xml/dtm/ref/xni2dtm/Attic/XPath2Type.java
Index: XPath2Type.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/xni2dtm/Attic/XPath2Type.java,v
retrieving revision 1.1.2.1.2.3
retrieving revision 1.1.2.1.2.4
diff -u -r1.1.2.1.2.3 -r1.1.2.1.2.4
--- XPath2Type.java 16 Aug 2002 21:11:18 -0000 1.1.2.1.2.3
+++ XPath2Type.java 27 Aug 2002 20:51:18 -0000 1.1.2.1.2.4
@@ -266,13 +266,20 @@
//The normalized value of a string type
// (Should we check for stings and return this instead?)
- String normalizedValue = validatedInfo.normalizedValue ;
-
+ //String normalizedValue = validatedInfo.normalizedValue ;
+
// If the type is a union type, then the member type which
// actually validated the string value will be:
// XSSimpleType memberType = validatedInfo.memberType ;
// %REVIEW% I presume this handles lists by returning arrays...?
+
+ // Some types may want to be converted from XNI-native to Xalan-native
+ if(value instanceof org.apache.xerces.xni.QName)
+ {
+ org.apache.xerces.xni.QName xniq=(org.apache.xerces.xni.QName)value;
+ value=new org.apache.xml.utils.QName(xniq.uri,xniq.localpart);
+ }
seq=new DTM_XSequence(value,this);
}
No revision
No revision
1.1.2.3 +3 -0
xml-xalan/java/src/org/apache/xpath/functions/Attic/FuncNodeKind.java
Index: FuncNodeKind.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/functions/Attic/FuncNodeKind.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- FuncNodeKind.java 15 Aug 2002 21:07:44 -0000 1.1.2.2
+++ FuncNodeKind.java 27 Aug 2002 20:51:18 -0000 1.1.2.3
@@ -79,6 +79,9 @@
* each of the possible XStrings? More resources burned during
* initialization, fewer during execution... but this is a rarely
* used function.
+ *
+ * @author Joe Kesselman
+ * @since Aug 27, 2002
*/
public class FuncNodeKind extends FunctionDef1Arg
{
1.1.2.3 +3 -0
xml-xalan/java/src/org/apache/xpath/functions/Attic/FuncNodeName.java
Index: FuncNodeName.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/functions/Attic/FuncNodeName.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- FuncNodeName.java 26 Aug 2002 20:33:33 -0000 1.1.2.2
+++ FuncNodeName.java 27 Aug 2002 20:51:18 -0000 1.1.2.3
@@ -75,6 +75,9 @@
/**
* <meta name="usage" content="advanced"/>
* Execute the xf:node-name function, returning a QName.
+ *
+ * @author Joe Kesselman
+ * @since Aug 27, 2002
*/
public class FuncNodeName extends FunctionDef1Arg
{
No revision
No revision
1.1.2.1 +104 -0
xml-xalan/java/src/org/apache/xpath/functions/Attic/FuncExpandedQName.java
1.1.2.1 +112 -0
xml-xalan/java/src/org/apache/xpath/functions/Attic/FuncGetLocalNameFromQName.java
1.1.2.1 +118 -0
xml-xalan/java/src/org/apache/xpath/functions/Attic/FuncGetNamespaceFromQName.java
No revision
No revision
1.1.2.2 +5 -1
xml-xalan/java/src/org/apache/xpath/objects/Attic/XExpandedQName.java
Index: XExpandedQName.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/objects/Attic/XExpandedQName.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- XExpandedQName.java 26 Aug 2002 20:33:34 -0000 1.1.2.1
+++ XExpandedQName.java 27 Aug 2002 20:51:18 -0000 1.1.2.2
@@ -73,7 +73,11 @@
* have their values retreived via xf:get-*-from-QName(), but
* no other XPath/XSLT 2.0 operations are valid.
*
- * @author keshlam
+ * NOTE: It is currently undefined whether an attempt is made to normalize
+ * relative namespaces before comparing them for equality. We have
+ * delegated that issue to the QName object...
+ *
+ * @author Joe Kesselman
* @since Aug 26, 2002
*/
public class XExpandedQName extends XObject
1.2.14.1.2.1 +5 -1
xml-xalan/java/src/org/apache/xpath/objects/XObjectFactory.java
Index: XObjectFactory.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/objects/XObjectFactory.java,v
retrieving revision 1.2.14.1
retrieving revision 1.2.14.1.2.1
diff -u -r1.2.14.1 -r1.2.14.1.2.1
--- XObjectFactory.java 14 Aug 2002 20:07:03 -0000 1.2.14.1
+++ XObjectFactory.java 27 Aug 2002 20:51:18 -0000 1.2.14.1.2.1
@@ -6,7 +6,7 @@
import org.apache.xpath.XPathContext;
import org.apache.xpath.NodeSetDTM;
import org.apache.xpath.axes.OneStepIterator;
-
+import org.apache.xml.utils.QName;
public class XObjectFactory
{
@@ -44,6 +44,10 @@
else if (val instanceof Integer)
{
result = new XInteger(((Integer) val));
+ }
+ else if (val instanceof QName)
+ {
+ result=new XExpandedQName((QName)val);
}
else
{
No revision
No revision
1.1.2.1.2.6 +9 -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.5
retrieving revision 1.1.2.1.2.6
diff -u -r1.1.2.1.2.5 -r1.1.2.1.2.6
--- SimpleNode.java 20 Aug 2002 14:45:28 -0000 1.1.2.1.2.5
+++ SimpleNode.java 27 Aug 2002 20:51:18 -0000 1.1.2.1.2.6
@@ -321,6 +321,15 @@
new QName("node-name"),
new FuncNodeName());
m_builtInFunctions.put(
+ new QName("expanded-QName"),
+ new FuncExpandedQName());
+m_builtInFunctions.put(
+ new QName("get-local-name-from-QName"),
+ new FuncGetLocalNameFromQName());
+m_builtInFunctions.put(
+ new QName("get-namespace-from-QName"),
+ new FuncGetNamespaceFromQName());
+m_builtInFunctions.put(
new QName("base-uri"),
new FuncBaseURI());
m_builtInFunctions.put(
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]