Subject:finding a list of values Author:Marc Feickert Date:06 Aug 2010 03:12 PM
I need to pull back multiple elements based on an @id attribute which is different for eahc of them. Essentially, given docs numbered 1-10, I want to extract only 3,6,7.
I could grab each by setting my loop in the following way:
<xsl:for-each select="Documents/Document[@id='3' or @id='6' or @id='7']">
<xsl:copy-of select="."/>
</xsl:for-each>
Is ther a more concise way to write the XPath here to where all I need list are the values themselves? Like in SQL where you can say:
Subject:finding a list of values Author:Page Basheer Date:08 Dec 2010 03:44 PM
Can this approach be adapted to a use case where a list of unique values must be determined from a document content, eg, find and use a list of distinct values from //SOMELEMENT/@SOMEATTRIBUTE, and then used to process all nodes within the set for a given one of the values?
Subject:finding a list of values Author:Marc Feickert Date:09 Dec 2010 05:23 PM
>Can this approach be adapted
>to a use case where a list of
>unique values must be
>determined from a document
>content, eg, find and use a
>list of distinct values from
>//SOMELEMENT/@SOMEATTRIBUTE,
>and then used to process all
>nodes within the set for a
>given one of the values?