Subject: Re: [xsl] Pure XPath Question From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Sun, 24 Jul 2011 19:40:53 +0200 |
I have a xpath expression that searches a xml file for the word 'faa'. Using pure xpath 1.0, I want to be able to search each section element that has the word 'faa' in the name attribute. I want to return the @name of the ancestor chapter/@name for each section.
This expression only returns a count of 1
/data/volume/chapter/section/@name[contains(translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'), 'faa')]/ancestor::chapter/@name
while this returns a count of 2.
/data/volume/chapter/section/@name[contains(translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'), 'faa')]
I understand why I am not getting the desired result, but not sure how to get it.
Desired result:
Chapter 1. Handbook Organization, Use, and Revision Chapter 1. Handbook Organization, Use, and Revision
Is this possible with using a single xpath expression?
Martin Honnen --- MVP Data Platform Development http://msmvps.com/blogs/martin_honnen/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Pure XPath Question, Philip Vallone | Thread | Re: [xsl] Pure XPath Question, David Carlisle |
[xsl] Pure XPath Question, Philip Vallone | Date | Re: [xsl] Pure XPath Question, David Carlisle |
Month |