Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
As in my previous post im using an extenal xml file as a data source.
Im trying to get nodes below an "arrs" node with a specific "genre" attribute. Eg. "Music"
Im trying to do it like this (not full source, just the essentials):
<xsl:template match="/">
<xsl:apply-templates select="$kalender//arrs[@genre=Music]"/>
</xsl:template>
<xsl:template match="arr">
<xsl:value-of select="kunstner"/>
My xml is as follows:
<arrlist>
<arrs genre="Music">
<arr ArrNr="4640717">
<kunstner>something something </kunstner>
</arr>
<arr ArrNr="4743104">
<kunstner>something2 something2</kunstner>
</arrs>
<arrs genre="Theatre">
<arr ArrNr="2342342">
<arr ArrNr="234234234">
</arrlist>
But this doesnt really return anything... What am i missing?
<xsl:apply-templates select="$kalender//arrs"/>
returns all "arr" nodes correctly, so that works so far...
Hi Claus,
Could it be as simple as forgetting the apostrophes around Music? You should do this:
<xsl:apply-templates select="$kalender//arrs[@genre = 'Music']" />
Assuming it's not a typo, the one you wrote will try to find an element named Music and take the string value of that as the genre...
/Chriztian
Yep, that was exactly what was missing. Thanks a lot
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
selecting nodes based on parents attribute
As in my previous post im using an extenal xml file as a data source.
Im trying to get nodes below an "arrs" node with a specific "genre" attribute. Eg. "Music"
Im trying to do it like this (not full source, just the essentials):
My xml is as follows:
But this doesnt really return anything... What am i missing?
returns all "arr" nodes correctly, so that works so far...
Hi Claus,
Could it be as simple as forgetting the apostrophes around Music? You should do this:
Assuming it's not a typo, the one you wrote will try to find an element named Music and take the string value of that as the genre...
/Chriztian
Yep, that was exactly what was missing. Thanks a lot
is working on a reply...