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

Re: sequence of strings

Subject: Re: sequence of strings
From: Ruud Grosmann <r.grosmann@xxxxxx>
Date: Tue, 02 Dec 2008 15:20:04 +0100
Re:  sequence of strings
Michael Kay wrote:

I would tend to write that as


<xsl:function name="get-attributes" as="xs:string*">
  <xsl:param name="string" as="xs:string"/>
  <xsl:sequence select="'BLD'[contains($string, 'bold')],
'ITA'[contains($string, 'italic')]"/>
</xsl:function>

Thank you for your answer. This I was looking for all the time: a way to create a sequence of string in the select of xsl:sequence. However, I don't understand completely what is going on in that select. I have your programmers reference. If you could tell me what section I should read to understand it, I would be grateful...



or if it were a longer list of names then


<xsl:variable name="styles" as="element(style)">
  <style name="BLD" code="bold"/>
  <style name="ITA" code="italic"/>
</xsl:variable>

<xsl:function name="get-attributes" as="xs:string*">
<xsl:param name="string" as="xs:string"/>
<xsl:sequence select="$styles[contains($string, @code)]/@name"/>
</xsl:function>

I am going to use this one. Obviously the two missing links were the xsl:function element and the xsl:sequence use. I suspect I only use a subset of the xslt2 features...


Thanks for helping!

regards, Ruud

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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-2011 All Rights Reserved.