jj.
jj.

Reputation: 51

xsl:for each select command help

<xsl:for-each select="ComputerStoreProducts/List2/Pc">

for this code i need it to show the data for Pc,mouse,keyboard but it only shows Pc how can i make it do that as i have to write the code three times and the xsl:sort code doesnt work on all of the prices for each element as it only does Pc the mouse and then keyboard i want them together so the show properly in accending format

Upvotes: 1

Views: 218

Answers (1)

Pavel Minaev
Pavel Minaev

Reputation: 101615

Assuming that only Pc, Mouse and Keyboard are children of List2 (i.e. there are no other children), you could write:

 <xsl:for-each select="ComputerStoreProducts/List2/*">

If there are other children, and you only want those three:

 <xsl:for-each select="ComputerStoreProducts/List2/*[self::Pc | self::Mouse | self::Keyboard]">

Upvotes: 2

Related Questions