This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > May 2005 > (newbie) How 2 make <xsl:for-each select="parent/child[element='value']"&g





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author (newbie) How 2 make <xsl:for-each select="parent/child[element='value']"&g
emailchas@gmail.com

2005-05-28, 4:25 am

I have one XML file containing repeated elements
<database><title>Database one </title><subject>Accounting</subject>
<subject>Business</subject></database>

I can apply one stylesheet "Accountingfilter.xsl" that does this :

<xsl:for-each select="databases/database[subject='Accounting']"

And get output for all records where 'accounting' is listed in subject
elements


But I want to also apply, for another link, a second stylesheet
"businessfilter.xsl" that does
<xsl:for-each select="databases/database[subject='Business']"

Accountingfilter.xsl works, subject elements containing Accounting
being listed first in the xml

Here, Businessfilter doesn't work as intended - empty display- unless I
switch the order in master.xml to : <subject>Business</subject>
<subject>BAccounting </subject></database>

... then in this case the Accountingfilter.xsl sheet wont work as
intended.
Any advice on getting both stylesheets to work on the same XML file
with repeatable elements containinng different values, regardless of
the order listed in the xml?

Thanks

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews