[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

transformation: element tag-name to attribute value

Subject: transformation: element tag-name to attribute value
From: Ed Nixon <ed.nixon@xxxxxxxxxxxxxxxxx>
Date: Mon, 26 Oct 1998 14:24:22 -0500
element tag
Let's say I have a rule:

<xsl:template match="section1|section2|section3|section4|section5|section6">
  <div class="section1"><xsl:process-children/></div>
</xsl:template>

Now. Rather than creating an output document that contains div with every class 
equal to "section1", I want to create div with class "section?" dependant on 
the particular match alternative that is activated while running through the 
source document.

1. Is there a syntax, such as section? that acts as a single character 
'wild-card' in the match statement?
2. What is the syntax for the right-hand side of the class= statement such that 
the matched element type name is inserted?

I *have* looked at the draft but it doesn't pop out at me.

I realize there are probably alternative and better design solutions for this 
specific instance of the problem, e.g., relying on source attribute values to 
carry the numeric (ordering) information, etc., but the more general problem of 
getting the tag name into the output document's attribute set is what I'm 
trying to understand.

Thanks for your help.			...edN


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.