Jump to content

Getting attribute out of XML


ldodgen
 Share

Recommended Posts

An XML document has an element with an attribute and i'm trying to assign that attribute to a variable in XSLT. Can't remember how to do that. HELP!!XML:<1stElement> <2ndElement type="leaf"> <3rdElement></3rdElement>XSL:<xsl:variable name="type" select="1stElement/2ndElement **What goes here, to link to the attribute of 2nd Element** " />

Link to comment
Share on other sites

<xsl:variable name="type" select="1stElement/2ndElement/@type " />

I think this should do it. Use the XPath tutorial next time.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...