Change Attribute Value: Search-n-replace is better?

Subject: Change Attribute Value: Search-n-replace is better?
From: John Robert Gardner <jrgardn@xxxxxxxxx>
Date: Tue, 21 Dec 1999 14:23:45 -0500 (EST)
Herein I cast myself upon the altar of public shame with what should be
obvious, I'm sure.

Suppose I have an xml file with a bunch of TEI div tags, and I know that I
want to change an attribute value for one of those tags, but I don't know
the existing value for the attribute "type."

If I do this:

<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>

I'm still not changing the value of "meter."  You see, folks can
transliterate Sanskrit and make typo's zillions of ways.  WHen many cooks
stir this vichy soisse, untangling how they do things is a zoo.  So, I can
select teh hymn I want to make be meter "gayatri", but I can't seem to
make gayatri replace _whatever_ value is currently assigned to "meter."

I mean, I can guess some sort of choose/when or if test, but is that the
only way?  It seems like using a canon to swat a fly . . . . hence,
search-n-replace is better?

Somewhere {} must figure in this, but I'm fully penitent and confessional
of not knowing how. . . . 

=-=-=-=-=-=-=-=-=-==-=-=-=
John Robert Gardner
ATLA-CERTR
Emory University
------------------------------------------------------------
http://vedavid.org/diss/
"If there is something you're thinking of doing, or wish you could do,
begin it.  In boldness there is mystery and power . . . . "  -Goethe




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


Current Thread