| | |
Predicates Usage
Please support our XML, XSLT and XPATH advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2009
Posts: 5
Reputation:
Solved Threads: 0
Hi Folks,
Can anyone explain me whether we can use multiple predicates in the path expression.
In the below path, // indicates searching for the node in XML document irrespective of its position, but I didn't understand why 'starts-with' function is placed in [] brackets. Even though it's working fine, can anyone explain how it works?
Here is the path for your reference.
<code>
path="//*[starts-with(name(), 'FSA')][position()=//count/text()]/@SCIObjectID"
</code>
Thanks in Advance......
Can anyone explain me whether we can use multiple predicates in the path expression.
In the below path, // indicates searching for the node in XML document irrespective of its position, but I didn't understand why 'starts-with' function is placed in [] brackets. Even though it's working fine, can anyone explain how it works?
Here is the path for your reference.
<code>
path="//*[starts-with(name(), 'FSA')][position()=//count/text()]/@SCIObjectID"
</code>
Thanks in Advance......
•
•
Join Date: Apr 2009
Posts: 44
Reputation:
Solved Threads: 2
path="//*[starts-with(name(), 'FSA')][position()=//count/text()]/@SCIObjectID"
[] a Predicates content a false true
starts-with(name(), 'FSA') when the current tagname
a FSA****
* are any sign of the alpabeth
then second predicate
compare positionnummer with current Tagnode child count value
then alle predicate are true the parser found the arttirbut
@SCIObjectID
[] a Predicates content a false true
starts-with(name(), 'FSA') when the current tagname
a FSA****
* are any sign of the alpabeth
then second predicate
compare positionnummer with current Tagnode child count value
then alle predicate are true the parser found the arttirbut
@SCIObjectID
•
•
Join Date: Oct 2008
Posts: 95
Reputation:
Solved Threads: 5
Yes, multiple precidates are permitted in a step. In your example you have two adjacant predicates.
From XPath 2.0 3.2.1
A step is a part of a path expression that generates a sequence of items and then filters the sequence by zero or more predicates. The value of the step consists of those items that satisfy the predicates, working from left to right. A step may be either an axis step or a filter expression.
[starts-with(name(), 'FSA')] is a predicate as indicated by the square brackets.
From XPath 2.0 3.2.2
A predicate consists of an expression, called a predicate expression, enclosed in square brackets. A predicate serves to filter a sequence, retaining some items and discarding others. In the case of multiple adjacent predicates, the predicates are applied from left to right, and the result of applying each predicate serves as the input sequence for the following predicate.
From XPath 2.0 3.2.1
A step is a part of a path expression that generates a sequence of items and then filters the sequence by zero or more predicates. The value of the step consists of those items that satisfy the predicates, working from left to right. A step may be either an axis step or a filter expression.
[starts-with(name(), 'FSA')] is a predicate as indicated by the square brackets.
From XPath 2.0 3.2.2
A predicate consists of an expression, called a predicate expression, enclosed in square brackets. A predicate serves to filter a sequence, retaining some items and discarding others. In the case of multiple adjacent predicates, the predicates are applied from left to right, and the result of applying each predicate serves as the input sequence for the following predicate.
![]() |
Similar Threads
- svchost.exe 100% cpu usage pissing me off :( (Windows NT / 2000 / XP)
- 100% CPU USAGE on and off! ;/ (Windows NT / 2000 / XP)
- CPU Usage at 100% with Nero 6 (Windows NT / 2000 / XP)
- 100% cpu usage when transcoding movie in nero 6 (Windows NT / 2000 / XP)
- 100% CPU Usage - No Virus, No gaming (Windows NT / 2000 / XP)
- cpu usage meter (Windows NT / 2000 / XP)
Other Threads in the XML, XSLT and XPATH Forum
- Previous Thread: Please help
- Next Thread: XML query
| Thread Tools | Search this Thread |
api blogger blogging code delete development dynamiccreationofnvariablesinxslt error firstthreecharacterofastringrequired flipbook gdata google html include java link linspire linux microsoft news node openoffice overwrite precedence programming rss standards swf template transform variable w3c web xml xmlnotloading xmlonserver xsl xslt





