[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: how to "print" xsl:element result from inside a f

Subject: RE: how to "print" xsl:element result from inside a function?
From: "Mtekel" <thx@xxxxxxxxx>
Date: Sun, 10 May 2009 08:16:49 +0200
RE:  how to "print" xsl:element result from inside a  f
...Changed all xsl:value-of to xsl:sequence (also in the how I call the
function) and also as="element()*" and it WORKS!

Thanks, you have helped me a lot. I had hard times trying to figure out this
myself, do you know any good web page/site with guides on XML and
information alike (I mean st. like this list, mulberrytech.com,
dpawson.co.uk, etc. )?

-----Original Message-----
From: Mukul Gandhi [mailto:gandhi.mukul@xxxxxxxxx]
Sent: 10. maja 2009 8:01
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  how to "print" xsl:element result from inside a function?

On Sun, May 10, 2009 at 9:04 AM, Mtekel <thx@xxxxxxxxx> wrote:
> <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
> by xsl:element.

xsl:value-of prints the 'text nodes' and not elements as you want.

I think, you must declare the function to return element()* and then
do, xsl:sequence select="" instead of xs:value-of.

Mukul Gandhi

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.