[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Understanding XPath contains function

Subject: Re: Understanding XPath contains function
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Sun, 30 Jul 2006 06:22:56 -0700
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:


will give me Oberbereich[6] as a result as expected (because it has
child elements that have a Kursart-Attribute of that value.

will not give me any results where it should at least give me the same
or more results that the previous expression, should it not?

In the second case the first argument to the function
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

In your concrete case the first node passed is

and it happens so, that it doesn't contain the string

Therefore, the reference to the contains() function returns false()
and the XPath expression

does not select any node.

Hope this helped.

Dimitre Novatchev
Truly great madness cannot be achieved without significant intelligence.

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.