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

Re: XSL QUERY

Subject: Re: XSL QUERY
From: Eric Vitiello <xsl-list@xxxxxxxxxxxx>
Date: Fri, 7 Dec 2001 11:41:40 -0500
Re:  XSL QUERY
-- Jeff Kenton [Fri, 7 Dec 2001 11:17:59 -0500]:
>... From: "Tarun Saheja" <tarun.saheja@xxxxxxxxx>
>... Date: Fri, 7 Dec 2001 21:05:40 +0530
>...
>... I have an XML Structure ?that looks something like this:
>
>This is your problem. ?Your <BookName ... >?elements don't have an
>Author attribute, which would make the solution trivial. ?With what
>you have, you will need to guarantee that your books are all grouped
>by author and do some ugly stuff to check when a new Author is seen.
>
>If you can change your <BookName>?elements to contain an author, I
>would
>recommend that. ?Especially since the name attribute seems to have
>the
>author embedded in it right now.

as an example:

<Books>
 <Book name="Book1" author="Author1" Type="Fiction" />
 <Book name="Book2" author="Author1" Type="General"/>
 <Book name="Book3" author="Author1" Type="Biography"/>
 <Book name="Book4" author="Author1" Type="Fiction"/>
 <Book name="Book1" author="Author2" Type="Fiction"/>
 <Book name="Book2" author="Author2" Type="Fiction"/>
 <Book name="Book3" author="Author2" Type="Biography"/>
 <Book name="Book4" author="Author2" Type="General"/>
</Books>


and you could:

<xsl:stylesheet>
	<xsl:foreach select="//Book[@Type='Fiction'][@author='Author1']">
		<xsl:value-of select="@name"/>

	</xsl:for-each>
</xsl:stylesheet>


Eric Vitiello
Perceive Designs
Web Design and Consulting
<www.perceive.net>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • XSL QUERY
    • Tarun Saheja - Fri, 7 Dec 2001 09:57:22 -0500 (EST)
      • <Possible follow-ups>
      • Jeff Kenton - Fri, 7 Dec 2001 11:17:56 -0500 (EST)
        • Eric Vitiello - Fri, 7 Dec 2001 11:42:20 -0500 (EST) <=
      • Beck, Brad - Fri, 7 Dec 2001 11:26:37 -0500 (EST)

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.