473,326 Members | 2,175 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Filtering the output using select attribute from XML file in XSLT

Hi,

Below is the XSL syntax to filter output from XML file based on single
value:-

<xsl:for-each select="catalog/cd[artist='Bob']">

so, above code displays the text of the CD elements whose artist is
'Bob'.

But, whats the correct syntax to displays CD elements whose
artist='Bob' And 'Alice' And 'Tom'.

is it:-
1. <xsl:for-each select="catalog/cd[artist='Bob'] And
[artist='Alice']">

Or
2. <xsl:for-each select="catalog/cd[artist='Bob'] &&
[artist='Alice']">
OR
3. <xsl:for-each select="catalog/cd[artist='Bob' && 'Alice']">

anything else. Please guide me

Thanks,

Nov 5 '07 #1
1 3180
But, whats the correct syntax to displays CD elements whose
artist='Bob' And 'Alice' And 'Tom'.
First hint: That isn't going to be an "and" operation. The artist can
never be all three values at once. You probably want the elements whose
artist attribute is Bob OR Alice OR Tom.

I suspect that'll be enough for you to solve it by yourself; if you're
still hung up after trying it, let us know.

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Nov 5 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Taare | last post by:
Hi, I got <xsl:output method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD HTML 4.01//EN" doctype-system=" http://www.w3.org/TR/html4/strict.dtd"/> in my XSLT file. This should remove...
4
by: elora_c | last post by:
I'm trying to write XSLT that will filter out an XML based on an attribute's value. XML looks like: <postings> <channel name="A"> <posting Connected="True" name="Posting1" /> <posting...
2
by: Buddy Ackerman | last post by:
Apparently .NET strips these white space characters (MSXML doesn't) regardless of what the output method is set to. I'm using <xsl:text> </xsl:text> to output a tab character and...
2
by: sp | last post by:
hai i am new to this XSTL and i am trying to write xslt that will filter out the xml value based on Attribute Value. my xml looks like this <catalog> <cd> <title year="1990">Empire...
3
by: 张韡武 | last post by:
Hello. I am a newbie trying to get my first XLST script working. I already know how to do this: Source XML: <category id="a0104"> <name>Oil and Gas</name> </category> XSLT: <xsl:for-each...
2
by: trash.muell | last post by:
Hi, I am struggling with an XSLT task and need a hint: I have a complex XML file but want to only output some sub-trees of the XML structure. My XSLT script is always printing the information of...
3
by: super.raddish | last post by:
Greetings, I am relatively new to, what I would call, advanced XSLT/XPath and I am after some advice from those in the know. I am attempting to figure out a mechanism within XSLT to compare the...
6
by: John Larson | last post by:
Hi All, I am some information from INSPEC database records in XML to build a relational database of my own. I am currently trying to extract information by doing an XSLT transform of the XML...
1
by: boetke | last post by:
Hi all, I am attempting to create an xslt transformation which I am having trouble with. I am fairly new to xslt and am having a hard time getting my head around it. The original xml file looks...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.