[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Dependency Sorting, first of kind
Francis Norton wrote: > The general answer is that that you can do all the basic set operations > in XSLT. Use them and strip out your buggy iterative code. I can't > answer for the performance effects, however! > > I'll write up the following in a note tonight - I have tested them, and > they all work sweetly: > > set union (any node in a or in b): > <xsl:variable name="x" select="$a | $b" /> > > set intersection (any node in a and in b): > <xsl:variable name="x" select="$a[. = $b]" /> > > set difference (any node in a but not in b): > <xsl:variable name="x" select="$a[not(. = $b)]" /> $a | $b returns the set of nodes that are members of $a or $b. If this is what you mean by set union, then the set intersection of $a and $b should be the set of nodes that are members of both $a and $b. But $a[. = $b] does not return this; it returns the nodes in $a for which there is a node in $b with the same value. James 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
|