Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] how to "print" xsl:element result from inside a function?

From: "Mtekel" <thx@------.-->
To: <xsl-list@-----.------------.--->
Date: 5/10/2009 6:16:00 AM
...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@g...] 
Sent: 10. mája 2009 8:01
To: xsl-list@l...
Subject: Re: [xsl] how to "print" xsl:element result from inside a function?

On Sun, May 10, 2009 at 9:04 AM, Mtekel <thx@t...> 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
generated
> 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.


-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
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...>
--~--



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent