Subject: RE: XSL QUERY
From: "Oleg Tkachenko" <olegt@xxxxxxxxxxxxx>
Date: Fri, 7 Dec 2001 18:46:00 +0200
|
Hello Tarun!
> I have an XML Structure that looks something like this:
>
> <Books>
> <Author name="Author1" Specialist="Fiction" />
> <BookName name="Author1Book1" Type="Fiction" />
> <BookName name="Author1Book2" Type="General"/>
> <BookName name="Author1Book3" Type="Biography"/>
> <BookName name="Author1Book4" Type="Fiction"/>
> <Author name="Author2" Specialist="General" />
> <BookName name="Author2Book1" Type="Fiction"/>
> <BookName name="Author2Book2" Type="Fiction"/>
> <BookName name="Author2Book3" Type="Biography"/>
> <BookName name="Author2Book4" Type="General"/>
> </Books>
>
> Now if I have to display the XSL by categorizing from the 'Type' attribute
> of <BookName>, for example I want to display all the books that belong to
> the 'Fiction' Category of Author1, inspite of Author1 having
> other types of
> books, then how will I achieve it?
Not too handy book name, but perhaps starts-with can help you. Try something like
<xsl:apply-templates select="/Books/BookName[starts-with(@name, $author)][@Type=$genre]"/>
---
Oleg Tkachenko,
Multiconn International, Israel
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)
- Jeni Tennison - Fri, 7 Dec 2001 11:25:28 -0500 (EST)
- Oleg Tkachenko - Fri, 7 Dec 2001 11:44:09 -0500 (EST) <=
- <Possible follow-ups>
- Jeff Kenton - Fri, 7 Dec 2001 11:17:56 -0500 (EST)
- Beck, Brad - Fri, 7 Dec 2001 11:26:37 -0500 (EST)
|
|