Bug in XT? was [RE: Change Attribute Value: Search-n-replace is better?]

Subject: Bug in XT? was [RE: Change Attribute Value: Search-n-replace is better?]
From: John Robert Gardner <jrgardn@xxxxxxxxx>
Date: Tue, 21 Dec 1999 19:00:14 -0500 (EST)
On Tue, 21 Dec 1999 sara.mitchell@xxxxxxxxx wrote:

> <div2>
> <xsl:attribute name="meter">gayatri</xsl:attibute>
>  <xsl:apply-templates select="*|@*[not(name()='meter')]"/>
> </div2>
> 

Thanks Sara, but I think this is still in the "canon-to-swat a fly"
category here-- or, in the case of what you've suggested, at least a 9mm
handgun. I'm needing to work with the syntax below b/c the examples have
to be as light on esoteric syntax as possible (it's for folks even more
technically disinclined than I repeatedly appear to be) and, quoting the
XSL/T spec:

<snip from="http://www.w3.org/TR/xslt#creating-attributes";>
Adding an attribute to an element replaces any existing attribute of that
element with the same expanded-name.
</snip>

Thus, the following _should_ replace hte existing "meter="tristubh""
attribute with "meter="gayatri"" (unless "expanded-name" is some level of 
non-apparent subtlety of meaning):

> > <xsl:template match="div2[@id='1.2']">
> > 			<div2>
> > 			<xsl:attribute name="meter">
> > 			<xsl:text>gayatri</xsl:text>
> > 			</xsl:attribute>
> > 		<xsl:apply-templates select="*|@*" />
> > 			</div2>
> > 		</xsl:template>
> > 



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


Current Thread