Hi,
I'm relatively new to XML and XPath programming. I am working on a program for my record collection with XML and C# .NET. The XPath search for album nodes is the problem.
XML example:
Now I want to write an XPathExpression that selects the following:
1) Search independent of lower/upper case
2) "pearl" search returns both Ten and After The Gold Rush
3) Search title as well
4) Return distinct albums (unique ID)
I have the following C# code that does some of this...
It does return all Neil Young albums with criteria like "You", but it does not locate the Pearl Jam collaboration on Mirrorball. Pearl Jam-search only returns the Ten album. Some XPath gurus willing to help me out?
![[peace] [peace] [peace]](/data/assets/smilies/peace.gif)
graabein
I'm relatively new to XML and XPath programming. I am working on a program for my record collection with XML and C# .NET. The XPath search for album nodes is the problem.
XML example:
Code:
<Albums>
<Album ID="10">
<Artist>Young, Neil</Artist>
<Artist>Pearl Jam</Artist>
<Title>Mirrorball</Title>
<Year>1995</Year>
</Album>
<Album ID="14">
<Artist>Young, Neil</Artist>
<Title>After The Gold Rush</Title>
<Label>Reprise</Label>
<Year>1970</Year>
</Album>
<Album ID="142">
<Artist>Pearl Jam</Artist>
<Title>Ten</Title>
</Album>
</Albums>
Now I want to write an XPathExpression that selects the following:
1) Search independent of lower/upper case
2) "pearl" search returns both Ten and After The Gold Rush
3) Search title as well
4) Return distinct albums (unique ID)
I have the following C# code that does some of this...
Code:
expr = nav.Compile("/Albums/Album[contains(Artist, '" + criteria + "')]";
It does return all Neil Young albums with criteria like "You", but it does not locate the Pearl Jam collaboration on Mirrorball. Pearl Jam-search only returns the Ten album. Some XPath gurus willing to help me out?
![[peace] [peace] [peace]](/data/assets/smilies/peace.gif)
graabein