|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Accessing a node name from within <xsl:attribute>
Hello I am new to XSL. I am looking into transforming XML into HTML using XSL for displaying in Internet Explorer 5. To create the meta tags I want to copy the element name used to be the value of the name attribute and then use the element content as the value of the content attribute. My source is: <metainfo> <description>A UK based Business & IT services company specialising in information management consulting to businesses worldwide.</description> <keywords>keyword1, keyword 2 etc</keywords> </metainfo> and I would like this to be <META name="description" content="A UK based Business & IT services company specialising in information management consulting to businesses worldwide.> in the output (and the same for the keywords) but I don't want to process the elements specifically so that authors can then add their own meta information, for instance if they wanted to add the author they could just put: <author>J. Smith</author> and this information would be processed by the stylesheet without a template for metainfo/author being added. So far I have got: <xsl:template match="metainfo"> <xsl:apply-templates/> </xsl:template> <xsl:template match="metainfo/*"> <META> <xsl:attribute name=[node-name here]> <xsl:value-of/> </xsl:attribute> </META> </xsl:template> but I don't know how to access the node name from within an xsl attribute. Can anyone help with this question please and/or point me in the direction of some good beginners guides to XSL? Thanks for your help. Kate Olding Consultant OpenMIND Consulting http://www.open-mind.co.uk Office: +44 01869 238080 Mobile: +44 07730 064358 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








