I am applying xpath expression(s) into an XSLT stylesheet mainly in the for each and value-of sections of anXSLT stylesheet using javascript embedded in an HTML form. I am wanting to filter my table data (multiple XML elements data that is being displayed as an HTML table in an area of the HTML form). If i had dvd title and price elements what would be an XPATH expression including predicate to let me display all the DVD title and price information (both elements) in a table showing only those with price > 2.00? At the moment I am having a lot of problems with regards to handling predicates to filter my table data and showing all the rows data for the 2 elements. I have an xpath expression that lets me filter and show ONLY one of the elements but NOT the two. I would like to know how to show 2 elements in a row (elements at the same level in the DOM) where one is filtering the other?
Grateful for any help.
I have update with the xml file
<?xml version="1.0"?>
<catalog>
<dvd>
<title>Gone with the wind</title><price>2.00</price>
</dvd>
<dvd>
<title>Independence Day</title><price>3.00</price>
</award>
</catalog>
As mentioned above I would like to have output in my HTML table the title AND price output where the row(s) output is those that satisfy price > 2.00
The content of the XML is simplified and there would be much more DVD elements in it. I am passing XPATH expressions as strings into the XSLT template in the for each and the value of select parts of the XSLT stylesheet.
The XSLT snippet is below. In javascript I am replacing the "*" in for each with XPATH expression string "price[.>2.00]" which shows the price > 2.00. I want to be able to show the title as well for that price as a row in my HTML table
<xsl:template match="/*/*">
<tr>
<xsl:for-each select="*">
<td><xsl:value-of select="."/></td>
</xsl:for-each>
</tr>
</xsl:template>