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

Retrieving values

Subject: Retrieving values
From: "peter verhaar" <peter.verhaar1@xxxxxxxxx>
Date: Thu, 8 Jan 2009 15:39:00 +0100
 Retrieving values
Hello,

I have 2 beginner questions:

QUESTION 1:

Assume:


<books>
	<book><code>1</code><title>TitleA</title></book>
</books>

And:

<xsl:template match="books">
 <xsl:for-each-group select="book" group-by="code">
 <xsl:message select="current-grouping-key()"/>
 <xsl:message select="current-group()/title"/>
<xsl:message select="count(current-group()/title)"/>
 </xsl:for-each-group>
</xsl:template>

Output:

1
<title>TitleA</title>
1

Question: How to get a Sequence of values  so ('TitleA',......)?

I modified the selection to the following but this doesn't work:

 <xsl:message select="current-group()/@title"/>
<xsl:message select="count(current-group()/@title)"/>
Output

1
<empty>
0

QUESTION 2:

How to run a XPath selection on a Sequence. E.g.:

 <xsl:variable name="titles" select="('titleA','titleB')"/>
 <xsl:variable name="selectedBooks" select="/books/book[@title
ISINSEQUENCE $titles]"/>

Is this possible to check a attribute does exist in a sequence?

Thanks Peter

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-2013 All Rights Reserved.