Re: Extracting element names for output

Subject: Re: Extracting element names for output
From: "Steve Muench" <SMUENCH@xxxxxxxxxxxxx>
Date: 18 Jun 1999 18:59:49 -0700
Using the April 20 XSL WD: 
 
  <xsl:value-of select="local-part(.)"/> 
 
will give the local part (i.e. w/o namespace qualification) 
of the current element. In layman's terms, "the tagname". 
 
_________________________________________________________ 
Steve Muench, Consulting Product Manager & XML Evangelist 
Business Components for Java Dev't Team 
http://www.oracle.com/xml
--- Begin Message ---
Subject: Extracting element names for output
From: Vernon_Imrich@xxxxxxxxxxxxxx
Date: 18 Jun 1999 17:04:54
Is there any support in XSL for extracting the NAME of the XML element (or node)
as the generated text rather than the value of the node? (For that matter, how
about extracting the names of all the element attributes; again, rather than the
value of the element attributes?) Hopefully, it would be something like
<xsl:name-of  select="." />

I want to create a stylesheet that shows formatted element names in the final
output, no matter what those element names are in the input XML.  This is for
output where only the node context (node structure) of the element matters, not
the name.

For example applying the stylesheet to:

<Person>
      <Firstname>Joe</First>
      <Lastname>Blow</Last>
</Person>

would produce:

<P><B>Person</B></P>
<table>
<tr><td>Firstname</td><td>Lastname</td></tr>
<tr><td>Joe</td><td>Blow</td></tr>
</table>

But using the SAME stylesheet applied to:

<Employee>
      <Surname>Joe</Surname>
      <Familyname>Blow</Familyname>
</Employee>

would produce:

<P><B>Employee</B></P>
<table>
<tr><td>Surname</td><td>Familyname</td></tr>
<tr><td>Joe</td><td>Blow</td></tr>
</table>

I can successfully create the various match and select expressions for the
stylesheet based only on node context.  But I can't seem to actually output or
format the nodes and element names themselves.



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

--- End Message ---
Current Thread