01: // Func - Xalann extension function test
02:
03: package com.nwalsh.xalan;
04:
05: import org.xml.sax.SAXException;
06: import org.xml.sax.ContentHandler;
07:
08: import org.w3c.dom.DocumentFragment;
09: import org.w3c.dom.Element;
10: import org.w3c.dom.traversal.NodeIterator;
11:
12: import org.apache.xpath.objects.XObject;
13: import org.apache.xpath.objects.XRTreeFrag;
14: import org.apache.xpath.XPath;
15: import org.apache.xpath.NodeSet;
16: import org.apache.xalan.extensions.XSLProcessorContext;
17: import org.apache.xalan.extensions.ExpressionContext;
18: import org.apache.xalan.transformer.TransformerImpl;
19: import org.apache.xalan.templates.StylesheetRoot;
20: import org.apache.xalan.templates.ElemExtensionCall;
21: import org.apache.xalan.templates.OutputProperties;
22: import org.apache.xalan.res.XSLTErrorResources;
23:
24: import javax.xml.transform.stream.StreamResult;
25: import javax.xml.transform.TransformerException;
26:
27: public class Func {
28: public Func() {
29: }
30:
31: public DocumentFragment doSomething(NodeIterator rtf) {
32: System.out.println("Got here 2: " + rtf);
33:
34: DocumentFragment df = (DocumentFragment) rtf.nextNode();
35: Element node = (Element) df.getFirstChild();
36:
37: System.out.println("node=" + node);
38: System.out.println("namesp uri: " + node.getNamespaceURI());
39: System.out.println("local name: " + node.getLocalName());
40:
41: return df;
42: }
43:
44: public DocumentFragment doSomething(DocumentFragment rtf) {
45: System.out.println("Got here: " + rtf);
46:
47: return rtf;
48: /*
49: Element node = (Element) rtf.getFirstChild();
50:
51: System.out.println("node=" + node);
52: System.out.println("namesp uri: " + node.getNamespaceURI());
53: System.out.println("local name: " + node.getLocalName());
54:
55: return rtf;
56: */
57: }
58: }
|