You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by dl...@locus.apache.org on 2000/10/16 20:57:29 UTC
cvs commit: xml-xalan/java/src/org/apache/xalan/lib NodeSetOperations.java package.html
dleslie 00/10/16 11:57:28
Modified: java/src/org/apache/xalan/lib NodeSetOperations.java
package.html
Log:
Revised Javadoc comment (per Dave Marston).
Revision Changes Path
1.2 +29 -3 xml-xalan/java/src/org/apache/xalan/lib/NodeSetOperations.java
Index: NodeSetOperations.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/lib/NodeSetOperations.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- NodeSetOperations.java 2000/09/28 17:03:20 1.1
+++ NodeSetOperations.java 2000/10/16 18:57:20 1.2
@@ -57,12 +57,19 @@
package org.apache.xalan.lib;
import org.w3c.dom.Node;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.NodeList;
import org.w3c.dom.traversal.NodeIterator;
import org.apache.xpath.NodeSet;
import java.util.Hashtable;
import org.xml.sax.SAXException;
-
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import org.apache.xpath.objects.XRTreeFrag;
+
/**
* <meta name="usage" content="general"/>
* Extension functions that perform set operations
@@ -118,7 +125,7 @@
}
/**
- * Returns NodeIterator for a node-set containing distinct string values.
+ * Returns node-set containing distinct string values.
* @param ni NodeIterator for node-set
* @return a NodeSet with nodes from ni containing distinct string values.
* In other words, if more than one node in ni contains the same string value,
@@ -162,5 +169,24 @@
return false;
}
return true;
- }
+ }
+
+ public static NodeSet nodeset(Node rtf)
+ throws ParserConfigurationException
+ {
+ if(rtf instanceof DocumentFragment)
+ { System.out.println("input is DocumentFragment");
+ XRTreeFrag xr = new XRTreeFrag((DocumentFragment)rtf);
+ NodeIterator ni = xr.nodeset();
+ NodeSet ns = new NodeSet(ni);
+ for (int i = 0; i < ns.getLength();i++)
+ {
+ Node n = ns.item(i);
+ System.out.println("Contains " + n.getNodeName());
+ System.out.println("HasChildNodes = " + n.hasChildNodes());
+ }
+ return ns;
+ }
+ return null;
+ }
}
1.2 +4 -3 xml-xalan/java/src/org/apache/xalan/lib/package.html
Index: package.html
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/lib/package.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- package.html 2000/07/06 02:28:05 1.1
+++ package.html 2000/10/16 18:57:22 1.2
@@ -1,12 +1,13 @@
<html>
<title>Xalan Extensions.</title>
<body>
- <p>Implementation of Xalan-specific extensions
- [I want to add lots more extensions to this package!].<p>
+ <p>Extension elements and functions shipped with &xslt4j;</p>
+ <p>We are adding extensions to this package.<p>
<dl>
<dt><b>Version: </b></dt><dd>Alpha, 2.0.0, July 05, 2000</dd>
<dt><b>Author: </b></dt><dd><a href="mailto:scott_boag@lotus.com">Scott Boag</a></dd>
- </dl>
</body>
+ </dl>
+ </body>
</html>