|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: constructing the Node Sets
"Joerg Heinicke" <joerg.heinicke@xxxxxx> wrote in message news:3E35E0F1.1030305@xxxxxxxxx > XML: > > <root> > <a> > <node>1</node> > <node>2</node> > <node>3</node> > <node>4</node> > <node>5</node> > </a> > <b> > <node>3</node> > <node>4</node> > <node>5</node> > <node>6</node> > <node>7</node> > <node>8</node> > </b> > </root> > > XSL: > > <xsl:template match="/root"> > <root> > <xsl:variable name="a" select="a/node"/> > <xsl:variable name="b" select="b/node"/> > <c> > <xsl:copy-of select="$a[. = $b]"/> > </c> > </root> > </xsl:template> The question was for an XPath expression that returns the intersection of two node-sets. The above obviously will not work like that. E.G. for nodes that do not have text children, or generally for non-element nodes, for multiple nodes having the same string string value, for nodes having more than one text child, etc. Node-set intersection of a node-set $a and node-set $b is given by the following XPath expression (Kaysian method): $a[count(. | $b ) = 1] ===== Cheers, Dimitre Novatchev. http://fxsl.sourceforge.net/ -- the home of FXSL __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com 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
|

Cart








