Altova Mailing List Archives
>microsoft.public.xsl Archive Home
>Thread Next - Re: replacing text
Date: 2/4/2007 12:52:00 AM
Hi, I've a huge problem understanding XSLT. I'm trying to replace the contents of a element within a XML document, so that the time information is removed. i.e. <Document xmls:a="http://www.temp.com"> <SomeInfo> <Date>2007-01-01T00:00:00+00:00</Date> </SomeInfo> <SomeInfo> <Date>2007-01-01T00:00:00+00:00</Date> </SomeInfo> </Document> what I've tried is the following, but it seems to be hopelessly wrong; <?xml version="1.0"?> <xsl:stylesheet version="1.0" xml:space ="default" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://www.temp.com"> <xsl:template name="test"> <xsl:for-each select="/a:Date"> <xsl:call-template name="string-replace"> <xsl:with-param name="text"> <xsl:copy-of select="node()"/> </xsl:with-param> </xsl:call-template> </xsl:for-each> </xsl:template> <xsl:template name="string-replace"> <xsl:param name ="text" /> <xsl:value-of select="substring-before($text,'T')" /> </xsl:template> </xsl:stylesheet> Any help, pointers, tirade of my stupidity would be appreciated....