Ryall
Ryall

Reputation: 12281

Combining Conditions in XPath and XSLT

I am trying to build an XPath select just the 'Phone' number from the following:

<element identifier="ContactPoint" version="Local">
    <qualifier name="Phone" type="refining"/>
    01234 567890
</element>
<element identifier="ContactPoint" version="Local">
    <qualifier name="Email" type="refining"/>
    [email protected]
</element>

In my XSLT, I have the following:

<TelNumber>
    <xsl:value-of select="./element[@identifier='ContactPoint']"/>
</TelNumber>

But obviously this will just select the first instance. How would I combine conditions into one select to ensure I am only selecting the value of "element" with a "Phone" qualifier child?

Thanks!

Upvotes: 5

Views: 7535

Answers (1)

AakashM
AakashM

Reputation: 63378

.\element[@identifier='ContactPoint' and qualifier/@name='Phone']

Upvotes: 12

Related Questions