[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Is this possible in XSLT
"Nicholas Waltham" <info@xxxxxxxxxxxx> wrote: > I would like to be able to check a series items in a list against items in > another. Selecting the parent item of the second list if it contains all the > items in the list (but it may contain more) for example If you want to check whether all the elements in a node set $list1 have similar companions in another node set $list2 you can try something like this <xsl:if test="$list/item[not($list2/item/@id=@id)]"> <xsl:message>Check failed</xsl:message> </xsl:if> If position is relevant too, or element names are variable, or the structure if the elements may be more complicated, it gets more difficult. > I immagine being able to create a dom xml fragment containing the first list > to be able to do this - I don't know if this really a good idea or not. If you mean you'll resort to a script embedded in the style sheet: This depends on what you exactly mean by "check against". Some, but not all problems are easier solved in a script. HTH J.Pietschmann XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|