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