Jørn,
I have the following test XML and XSLT documents:
*<xml>*
<root>
<node id="1">text 1</node>
<node id="2">text 2</node>
<node id="3">text 3</node>
</root>
*</xml>*
*<xslt>*
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:template match="/root">
<xsl:for-each select="node">
-<xsl:value-of select="@id" />-<br/>
<xsl:if test="@id = '1' or @id = '2'">
###<xsl:value-of select="." />###<br/><br/>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
*</xslt>*
When transformed, it produces the following results:
*<results>*
-1-
###text 1###
-2-
###text 2###
-3-
*</results>*
Is this what you're looking for?
- Larry
Jørn Tommy Kinderås wrote:
I need to get nodes in a xml file that match one out of two
parameters...bu t how can I create a or statemement with <xsl:if>?
E.G
---xml--
..
<movie>
<title>T2</title>
</movie>
<movie>
<title>Bone Collector</title>
</movie>
..
---xslt---
<xsl:paramete r name="myPar1"/>
<xsl:paramete r name="myPar2"/>
....
<xsl:for-each select="topnode/movie">
<xsl:if test="(title = $myPar1) OR (title = $myPar2)"> <---------
--do something
</xsl:if>
</xsl:for-each>
------------------------------
I want something like the above, but it has to check ALL of the
parameters for every title in the xml file.
Any ideas?
Jørn T