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

RE: help on attribute name

Subject: RE: help on attribute name
From: Raman Kannan <rk2153@xxxxxxxxx>
Date: Wed, 25 May 2005 18:01:51 -0400
raman kannan
Wendell wrote
According to the XSLT Spec [7.1.3] you should be able to use an AVT.

The processor might have a bug, or perhaps (more likely) $id resolves
to something that doesn't follow the rules for legal names. Raman,
what will $id actually be?
Thank you all very much for trying to resolve my quandry.

Here are some more details...answering Wendell's q.

Short: id is parameter passed in a call-template.
id will be set to string literals as shown below.

this is what I wish to generate
<?xml version="1.0" encoding="UTF-8"?>
<fmcpfixxml fixversion="4.2">
<ft T35="D"/>
<ft T11="6462"/>
<ft T1="75265"/>
<!-- lot more tuples like the above -->

I am currently generating them as
<xsl:element name="ft">
<xsl:attribute name="T35">
<xsl:value-of select="$msgtype"/></xsl:attribute>
<xsl:element name="ft">
<xsl:attribute name="T11">
<xsl:value-of select="concat(@id,'X')"/>

This ugly and code bloat. I would like to have
generated this as follows

<xsl:call-template name="taggen" >
<xsl:with-param name="id" select='T35' />
<xsl:with-param name="value" select='D' />

with a corresponding template defined as follows:

<xsl:template name="taggen">
<xsl:param name="id" />
<xsl:param name="value" />
<xsl:element name="ft">
<xsl:attribute name="{$id}"><xsl:value-of select="$value"/></xsl:attribute>

Ultimately I would generate the call-template segment
using a loop and key mechanism.

The attribute name I really want is 35 and NOT T35.
When I attempted that I got a lot
of errors and I simply stuck a T in front which I will
strip in a downstream process.

as a beginner all this hacking is being tolerated.

I hope I have provided the background.


Current Thread


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.
First Name
Last Name
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.