xsl-list
[Top] [All Lists]

RE: [xsl] Understanding XPath contains function

2006-07-30 14:26:18
In XPath 1.0:

(A = 'B') is true if *any* A is equal to 'B' 

contains(A, 'B') is true if *the first* A contains 'B' as a substring.

So if it's the second item in the set A that is equal to 'B', A='B' will be
true but contains(A, 'B') will be false.

XPath 2.0 makes it an error for the first argument of contains to be a
sequence of several items.

Michael Kay
http://www.saxonica.com/

-----Original Message-----
From: Ferdinand Soethe [mailto:xsl-list(_at_)soethe(_dot_)net] 
Sent: 30 July 2006 13:07
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Understanding XPath contains function

I'm confused by the difference in results when running the 
following xpath expressions against the same document:

/common/Oberbereich[6][.//@Kursart='Bildungsurlaub']

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

While
/common/Oberbereich[6][contains(.//@Kursart,'Bildungsurlaub')]
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?

Any hints much appreciated.

--
Ferdinand Soethe


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>