Passing a node-set from XSLT to Java

2008-07-01 Thread Andrew Chamberlain
Hi All, I'm trying to pass a tree fragment from XSLT to Java in the following way, and I'm not sure if the node-set is getting through correctly. The XML is: ... and the XSLT is: ... ... where the addGML method is: public String addGML(org.w3c.dom

Re: Passing a node-set from XSLT to Java

2008-07-01 Thread Luca Morandini
Andrew Chamberlain wrote: Hi All, I'm trying to pass a tree fragment from XSLT to Java in the following way, and I'm not sure if the node-set is getting through correctly. The XML is: ... This gives the 'result' variable the value of "#text", but when I was expecting "gml:Polygon". Not

Re: Passing a node-set from XSLT to Java

2008-07-02 Thread Andrew Chamberlain
Hi Luca, That was it!  I changed the line which did the insert to: Many thanks for your help! Andy Luca Morandini wrote: Andrew Chamberlain wrote: Hi All, I'm trying to pass a tree fragment from XSLT to Java in the following way, and I'm not sure if the node-set is getting t

Re: Passing a node-set from XSLT to Java

2008-07-03 Thread Andrew Chamberlain
Hi Luca/All, Sorry. On further testing, we're still not getting through the full tree fragment to Java. I've adapted the java method to give details of what it receives: public String addGML(org.w3c.dom.Node myNode) { System.out.println("Class = "+node.getClass().getName()); Sy

Re: Passing a node-set from XSLT to Java

2008-07-03 Thread Jason Johnston
Andrew Chamberlain wrote: Hi Luca/All, Sorry. On further testing, we're still not getting through the full tree fragment to Java. I've adapted the java method to give details of what it receives: public String addGML(org.w3c.dom.Node myNode) { System.out.println("Class = "+node.getC

Re: Passing a node-set from XSLT to Java

2008-07-03 Thread Luca Morandini
Andrew Chamberlain wrote: The last line (which uses the getTextContent() method) throws the following exception: javax.xml.transform.TransformerException: java.lang.AbstractMethodError: org.apache.xml.dtm.ref.DTMNodeProxy.getTextContent()Ljava/lang/String; at org.apache.xalan.extensi

Re: Passing a node-set from XSLT to Java

2008-07-04 Thread Andrew Chamberlain
Hi Luca, Jascon, Thanks very much - you've set me straight.  I hadn't imagined that the blank space would constitute a seperate node. And yes, I should have read the API a bit closer - of course org.w3c.dom.Node is only an interface. Thanks again - it all makes more sense now. Andy Jason J

Re: Passing a node-set from XSLT to Java

2008-07-04 Thread Derek Hohls
Andy I think you stumbled across one of the "gotchas" of XML; what looks simple and obvious is not always - at least, not to a machine. For more in-depth understanding of XML, I can recommend Ken Sall to explain it. There is a sample chapter from his book on-line: http://wdvl.internet.com/Autho