[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: How do I reference the name of a tag?
Subject: Re: How do I reference the name of a tag? From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 31 May 2000 16:25:02 +0100 |
James, Not too hard: <xsl:template match="*"> <attribute name="{name()}"> <value> <xsl:apply-templates/> </value> </attribute> </xsl:template> (Not tested, but not hard. The magic dust is in the 'name()' function.) Cheers, Wendell At 10:45 AM 5/31/00 -0700, you wrote: > >If I have a source like this: > ><sometag>blah</sometag> ><someothertag>blah blah</someothertag> > >that I want to transform to: > ><attribute name="sometag"> > <value>blah</value> ></attribute> ><attribute name="someothertag"> > <value>blah blah</value> ></attribute> > >how can I get at the expanded-name of sometag and someothertag? ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ====================================================================== XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: Its urgent ......., DuCharme, Robert | Thread | How do I reference the name of a ta, jhbooth |
Re: disabling output escaping with, Mike Brown | Date | RE: === Identifying a unique node i, Jonathan Asbell |
Month |
Keywords