Use xpath to locate a complex element with attributes and children -


given xml

<well bulkshift="0.000000" diameter="5.000000" hidden="false" name="67-1-tpx-10" filename="67-1-tpx-10.well">     <metadata/>     <unit>ftus</unit>     <colour blue="1.000000" green="1.000000" hue="" red="1.000000"/>     <tvd clip="false"/>     <associatedcheckshot>25-1-x-14</associatedcheckshot>     <associatedwelllog>hdra_67-1-tpx-10</associatedwelllog>     <associatedwelllog>nphi_67-1-tpx-10</associatedwelllog> </well> 

i can select element xpath

//well[@bulkshift=0 , @diameter=5 , @hidden='false' , @name='67-1-tpx-10' , @filename='67-1-tpx-10.well'] 

however need more specific in need find element these specific child nodes given child elements (metadata,unit,colour, etc) can appear in order inside element.

ideally i'd able select node single xpath query.

can help?

this template match childs , attributed on childs

<xsl:template match="well[@hidden='false'][./unit='ftus' or ./tvd/@clip='false']">     found! </xsl:template> 

or in 1 go:

<xsl:template match="well[@hidden='false' , (./unit='ftus' or ./tvd/@clip='false')]">     found! </xsl:template> 

Comments