cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Chamberlain <an...@comsine.co.uk>
Subject Passing a node-set from XSLT to Java
Date Tue, 01 Jul 2008 15:02:53 GMT
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:

  <gml:Polygon>
   ...
  </gml:Polygon>

and the XSLT is:

  <xsl:stylesheet ... myClass="xalan://my.package.name.MyClass">
    ...
    <xsl:variable name="gmlAdder" select="myClass:new()"/>

    <xsl:variable name="gml">
      <xsl:copy-of select="@* | node()"/>
    </xsl:variable>

    <xsl:variable name="result" select="myClass:addGML($gmlAdder,$gml)"/>
    ...
  </xsl:stylesheet>

where the addGML method is:

  public String addGML(org.w3c.dom.Node myNode)
  {
     ...
     return (myNode.getNodeName());
  }


This gives the 'result' variable the value of "#text", but when I was 
expecting "gml:Polygon".

Has anyone else managed to transfer a node-set to Java?  If so, did you 
use xalan?

Any tips would be greatly appreciated.

Thanks,

Andy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message