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 all XML fragments are nodesets in XSLT 1.0 (XSLT 2.0 is way better in this respect), hence you could try using the node extension of Xalan.

I haven't tried passing nodeset() to Java, but I presume this example may help you:

Pass this expression: xalan:nodeset($y-vector)

Where y-vector comes from an ordinary XML fragment like this:
  <xsl:template name="get-y-vector">
    <xsl:param name="geom"/>
    <vector>
      <xsl:for-each select="str:tokenize($geom, ' ')">
      <xsl:if test="string-length(substring-before(., ','))!=0">
        <y><xsl:value-of select="substring-before(., ',')"/></y>
        </xsl:if>
      </xsl:for-each>
    </vector>
  </xsl:template>

Regards,

--------------------
   Luca Morandini
www.lucamorandini.it
--------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to