tags:

views:

43

answers:

1

<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

+2  A: 

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]">
Pavel Minaev
Just curious, are those "self::" bits necessary? Is (Pc | Mouse | Keyboard) valid?
Eric Wendelin
ive tried it and it works but with xsl:sort command doesnt work its put them in order by price
jj
figured it out thanks alot pavel
jj