Subject: [xsl] Complex XPath question From: dvint@xxxxxxxxx Date: Fri, 1 Mar 2013 14:38:38 -0800 |
I have the following XML: <wrapper> <object class="Page" package="com.atlassian.confluence.pages"> <id name="id">37716253</id> <property name="title"> <![CDATA[COMPARE]]> </property> ... <property name="version">3</property> <property name="creatorName"> <![CDATA[wbenica]]> </property> <property name="creationDate">2012-11-16 14:00:35.000</property> </object> <object class="Page" package="com.atlassian.confluence.pages"> <id name="id">37716529</id> <property name="title"> <![CDATA[COMPARE]]> </property> ... <property name="version">1</property> <property name="creatorName"> <![CDATA[wbenica]]> </property> <property name="creationDate">2012-11-16 14:00:35.000</property> </object> <object class="Page" package="com.atlassian.confluence.pages"> <id name="id">37716528</id> <property name="title"> <![CDATA[COMPARE]]> </property> ... <property name="version">2</property> <property name="creatorName"> <![CDATA[wbenica]]> </property> </object> <object class="Page" package="com.atlassian.confluence.pages"> <id name="id">37716253</id> <property name="title"> <![CDATA[SOME OTHER TITLE]]> </property> ... <property name="version">3</property> <property name="creatorName"> <![CDATA[wbenica]]> </property> <property name="creationDate">2012-11-16 14:00:35.000</property> </object> </wrapper> I want to find the <id> element value for the <object> element that has the highest version <property> (of those matching the title) and matches the title <property> element for 'COMPARE'. The following matchs all <object> elements that have a title and version: //object[property[@name='title'] and property[@name='version']] How do I look for a specific title and find the highest version? Is it possible in one XPath statement?
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Support for lookaround re, Hermann Stamm-Wilbra | Thread | Re: [xsl] Complex XPath question, David Carlisle |
Re: [xsl] Support for lookaround re, James Fuller | Date | Re: [xsl] Support for lookaround re, Hermann Stamm-Wilbra |
Month |