Guest_imported
New member
- Jan 1, 1970
- 0
My XML code is like this:
<row>
<name>hans</name>
<age>43</age>
<pr_id>1</pr_id>
</row>
<row>
<selected>1</selected>
<name>jason</name>
<age>22</age>
<pr_id>2</pr_id>
</row>
<row>
<name>timmy</name>
<age>30</age>
<pr_id>2</pr_id>
</row>
With my XSL page i only want to output the <row> tags who
has the same <pr_id> tags like the row tage who has also the <Selected>1</selected> tag.
So in this case, I only want to output
jason
22
2
timmy
30
2
I was planning to do it this way:
<!--## Find out the value of the selected row ##-->
<xsl:for-each select="row[selected=1]">
<xsl:variable name="Luc" select="pr_id"/>
</xsl:for-each>
<!--## Find those who has equal pr_id's ##-->
<xsl:for-each select="row[contractid={$Luc}]">
<!-- here's the output -->
</xsl:for-each>
* But as you'll problably will understand, this doesn't work. Could somebody help me?
<row>
<name>hans</name>
<age>43</age>
<pr_id>1</pr_id>
</row>
<row>
<selected>1</selected>
<name>jason</name>
<age>22</age>
<pr_id>2</pr_id>
</row>
<row>
<name>timmy</name>
<age>30</age>
<pr_id>2</pr_id>
</row>
With my XSL page i only want to output the <row> tags who
has the same <pr_id> tags like the row tage who has also the <Selected>1</selected> tag.
So in this case, I only want to output
jason
22
2
timmy
30
2
I was planning to do it this way:
<!--## Find out the value of the selected row ##-->
<xsl:for-each select="row[selected=1]">
<xsl:variable name="Luc" select="pr_id"/>
</xsl:for-each>
<!--## Find those who has equal pr_id's ##-->
<xsl:for-each select="row[contractid={$Luc}]">
<!-- here's the output -->
</xsl:for-each>
* But as you'll problably will understand, this doesn't work. Could somebody help me?