Altova Mailing List Archives>Archive Index >xsl-list Archive Home >Recent entries >Thread Prev - [xsl] how to "print" xsl:element result from inside a function? [Thread Next] RE: [xsl] how to "print" xsl:element result from inside a function?To: <xsl-list@-----.------------.---> Date: 5/10/2009 8:14:00 AM xsl:value-of creates a text node. You want xsl:copy-of or xsl:sequence (in
most cases, either will do).
Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay
> -----Original Message-----
> From: Mtekel [mailto:thx@t...]
> Sent: 10 May 2009 04:35
> To: XSL-List@l...
> Subject: [xsl] how to "print" xsl:element result from inside
> a function?
> Importance: High
>
> Hello,
>
> I have a question concerning getting the output from the
> recursively called functions.
>
> In short, I have code:
>
> <xsl:function name="F:TagIT" as="xs:string">
> <xsl:param name="TAG"/>
> <xsl:element name="{$TAG}">MISSING!</xsl:element>
> </xsl:function>
>
> <xsl:function name="F:AddMissing" >
> <xsl:param name="List" />
> <xsl:if test="not(empty($List))">
> <xsl:variable name="TAG"
> select="subsequence($List,1,1)"/>
>
> <xsl:value-of select="F:TagIT($TAG)"/>
>
> <xsl:value-of select="F:AddMissing(remove($List,1))"/>
> </xsl:if>
> </xsl:function>
>
> And then later I call the function by:
>
> <xsl:value-of select="F:AddMissing(('Test1','t2','tst3'))"/>
>
> It will print MISSING!MISSING!MISSING! - but without the XML
> tags generated by xsl:element.
>
> When I debug the program in Altova XML spy and go step by
> step, I can see that the correct tag is generated in F:TagIT,
> but then as the recursion goes on, it is lost - it seems to
> me like if the output of the function was lost... however the
> word MISSING is printed without problems...
>
> Do you know how to solve this?
>
> Any advice appreciaded.
>
> Thx in advance.
>
>
> --~------------------------------------------------------------------
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
> To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail: <mailto:xsl-list-unsubscribe@l...>
> --~--
>
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@l...>
--~--
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
