Subject: Re: Obtaining the element name From: Bernd.Loepmeier@xxxxxx Date: Tue, 3 Nov 1998 13:22:17 +0100 |
Hi Nigel, I think if you are using Microsofts msxml you can get at the element type by appending "type" at the <elementtag>. For example: if (elementtag.type == 0) return "Element" 0 - ELEMENT 1 - TEXT 2 - COMMENT 3 - DOCUMENT 4 - DTD For further information visit Microsofts Site: http://www.microsoft.com/xml/articles/xmlmodel.asp Regards Bernd Löpmeier Nigel Hutchison <nwoh@xxxxxxxxxxxxxx> on 02.11.98 19:20:12 Please respond to xsl-list@xxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxx cc: (bcc: Bernd Löpmeier/MLC Systeme GmbH) Subject: Obtaining the element name Content-type: text/plain; charset=us-ascii I am trying to translate the Microsoft XSL style sheet listed below into XSL1.0 How do I get at the element type? Is there a functional equivalent to "tagname" that I can use within a template like this to pick out the element type within a template that matches as follows: <xsl:template match="*|/"> </xsl:template> *************************************************************************** * *******************++ <xsl> <!-- Generic stylesheet for viewing XML --> <!-- Note that this stylesheet does not display attributes. --> <rule> <root/> <DIV font-family="Courier" font-size="10pt"> <SPAN color="gray"><<eval>tagName</eval>></SPAN> <children/> <SPAN color="gray"></<eval>tagName</eval>></SPAN> </DIV> </rule> <!-- Default Rule - matches any element --> <rule> <target-element/> <DIV margin-left="1em"> <SPAN color="gray"><<eval>tagName</eval>></SPAN><children/><SPAN color="gray"></<eval>tagName</eval>></SPAN> </DIV> </rule> </xsl> Nigel W. O. Hutchison Technical Consultant Software AG Germany mailto:nwoh@xxxxxxxxxxxxxx Tel +49 (0)6151 92 1207 * XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Obtaining the element name, Nigel Hutchison | Thread | Re: Obtaining the element name, Amit Rekhi |
Obtaining the element name, Nigel Hutchison | Date | Msxsl... table... colspan.., Ana Heitor |
Month |