[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Accessing a node name from within
Accessing a node name from within
Subject: Accessing a node name from within <xsl:attribute> From: Kate Olding <kolding@xxxxxxxxxxxxxxx> Date: Thu, 6 Jul 2000 14:02:01 +0100 |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: Quantifying MSXML3 support for , Kay Michael | Thread | Re: Accessing a node name from with, Nick Browne |
RE: Passing thru numerical characte, Sebastian Rahtz | Date | Re: Passing thru numerical characte, Lars Marius Garshol |
Month |