[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Understanding XPath contains function
On 7/30/06, Ferdinand Soethe <xsl-list@xxxxxxxxxx> wrote:
I'm confused by the difference in results when running the following xpath expressions against the same document: In the second case the first argument to the function contains() is a node-set. In XPath 1.0 when a function expects a single argument and a node-set of two or more nodes is passed, (only) the first node is taken as the argument. In your concrete case the first node passed is (.//@Kursart)[1] and it happens so, that it doesn't contain the string 'Bildungsurlaub' Therefore, the reference to the contains() function returns false() and the XPath expression /common/Oberbereich[6][contains(.//@Kursart,'Bildungsurlaub')] does not select any node. Hope this helped. -- Cheers, Dimitre Novatchev --------------------------------------- Truly great madness cannot be achieved without significant intelligence.
|
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
|