This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
change a list of attribute name
- To: xsl-list at lists dot mulberrytech dot com
- Subject: [xsl] change a list of attribute name
- From: Xiaocun Xu <xiaocunxu at yahoo dot com>
- Date: Thu, 2 Aug 2001 18:21:31 -0700 (PDT)
- Reply-To: xsl-list at lists dot mulberrytech dot com
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