[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XSLT - update attribute with new value
Perhaps you aren't supplying a value for the two stylesheet parameters? Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: Ann Marie Rubin [mailto:Annmarie.Rubin@xxxxxxx] > Sent: 05 November 2004 14:37 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: XSLT - update attribute with new value > > Hello David, > > Thanks very much for your help. At least I now know that > this is possible. > > My stylesheet outputs the xml file unchanged. It does not replace the > value with the value of $value. I am probably doing something wrong > with the variable declaration but don't see the problem. The > stylesheet > looks like this: > > Do you see what might be wrong? > > Thanks very much, > > Ann Marie > > <?xml version="1.0" encoding="UTF-8"?> > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > <xsl:output indent="yes" method="xml"/> > <xsl:variable name="attr" select="deployment-version"/> > <xsl:variable name="value" select='TEST'/> > <xsl:param name="attr"/> > <xsl:param name="value"/> > > > <xsl:template match="node()|@*"> > > <xsl:copy> > <xsl:apply-templates select="@*|node()"/> > </xsl:copy> > </xsl:template> > > <xsl:template match="@*" priority="10"> > <xsl:attribute name="{name()}"> > <xsl:choose> > <xsl:when test="name()=$attr"><xsl:value-of > select="$value"/></xsl:when> > <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise> > </xsl:choose> > </xsl:attribute> > </xsl:template> > > > </xsl:stylesheet>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|