0

So I probably didn't word the title well. But, what I want to do is given the following xml excerpt:

<id name="tim" number="5555665" />

I would like to pull out the actual name and number of id. I have tried:

<xsl:value-of select="id.name"/>
AND
<xsl:value-of select="id/name"/>

Neither of which have done the trick. How can I access these data values?

2 Answers 2

3

To select attribute values with XPath, use the @ selector:

<xsl:value-of select="id/@name" />
<xsl:value-of select="id/@number" />
Sign up to request clarification or add additional context in comments.

Comments

1
<xsl:value-of select="id/@name"/>

<xsl:value-of select="id/@number"/>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.