Jump to content

starts-with assistance needed


John Smart

Recommended Posts

Hi,I'm currently trying to filter my list of trades alphabetically. Thanks to boen_robot and aalbretski, managed to filter when an element exactly equals a string, but I'd now like to use 'starts-with' to create an alphabetical list.To display all my trades, the line I have is this, which works fine.<xsl:for-each select="/trades/trade">ie, my XML is a list of Trades, (Abatoir, Art Gallery, Welder).Despite my best efforts, i can't seem to get it to filter by letter, and the following line is what I thought was correct (have tried MANY variations!)<xsl:for-each select="/trades/trade[starts-with(trade_description, 'A']">Can anyone point out where I am going wrong?Here's a sample from my xml file:

<trades>  <trade>	<trade_description>Abattoir</trade_description>	<rag>Ineligible</rag>	<trade_group>Food and Drink</trade_group>	<trade_code>7</trade_code>	<url>/prod/kite/TechContainer.nsf/FreePagesByUNID/8894C713A72F0D59802570E7003F6A2F?OpenDocument</url>  </trade></trades>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...