Hi Luca,

That was it!  I changed the line which did the insert to:
<xsl:variable name="result" select="myClass:addGML($gmlAdder,xalan:nodeset($gml)/gml:Polygon)"/>
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 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]


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

Reply via email to