[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Need to find element name of corresponding attribu
charlieo0@xxxxxxxxxxx wrote:
I need help finding a method for getting the name of an element based on the corresponding ID and IDREF attributes. I cannot use the id() function because the project I'm working is converting well-formed XML to DTD compliant XML. The id() function doesn't work because there is no DTD that defines ANY attribute types. So basically assume the ID attribute is defined as CDATA and not ID. Define <xsl:key name="el-by-id" match="*" use="@id"/> (you might want to change the match attribute to a pattern listing those elements you are interested in, instead of matching on any elements with "*"). Then use <xsl:template match="xref"> <xsl:value-of select="key('el-by-id', @taskid)/title"/> </xsl:template> -- Martin Honnen --- MVP Data Platform Development http://msmvps.com/blogs/martin_honnen/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|