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开发者_JAVA百科 the show properly in accending format
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]">
精彩评论