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

change a list of attribute name

Subject: change a list of attribute name
From: Xiaocun Xu <xiaocunxu@xxxxxxxxx>
Date: Thu, 2 Aug 2001 18:21:31 -0700 (PDT)
xslt change attribute name
Hi,

  I have a header which consisted of normal names such
as "Last Name".  For each of these, I would like to
replace it with a valid XML attribute name such as
LastName.  What would be the best way to do it?  Use
<xsl:when> as follow would be the most
straight-forward:
<xsl:when test="$header/cell[1] = 'Last Name'">
  <xsl:attribute name="LastName">
    <!-- etc. -->
  </xsl:attribute>
</xsl:when>

Another possibility is to create a node-set of proper
XML attribute names in $XMLHeader that matchs up with
the header, and do something like following:
<xsl:for-each select="$header/cell">
  <xsl:attribute
name="$XMLHeader/cell[@column=current()/@column]">
    <!-- etc. -->
  </xsl:attribute>
</xsl:when>

Would this be a feasible plan?  My biggest concern is
that the support for xsl:node-set is not standardize
across the XSLT processors, so the code is not
portable across XSLT processors.  Any other side
effects?

Much thanks for any advice on this topic,

Xiaocun  

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

 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.