Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: XSLT - removing a tag from within text >Thread Next - Re: XSLT - removing a tag from within text Re: XSLT - removing a tag from within textTo: NULL Date: 6/17/2009 3:47:00 PM gwoodhouse@g... a écrit : > On Jun 17, 2:34 pm, Martin Honnen <mahotr...@yahoo.de> wrote: >> gwoodho...@gmail.com wrote: >>> Yeah, problem is none of that works. >> None of what? > > <xsl:template match="span"> > <xsl:copy> > <xsl:apply-templates select="@* | node()"/> > </xsl:copy> > </xsl:template> > > would make a global change to the functionality of the XSLT (not that > this actually seems to do anything at all even if it did work) > > All i want is a nice simple string/node change. On just one node. When > i tell it to. Everywhere else in the XSLT it's doing exactly as it > should, the only thing i need to change is outputting the end_time > field WITHOUT <span>. you don't have a <span> node, you just have a <span> text; just use string manipulation functions such as substring-before() and substring-after() that are available in xslt 1.0 for that purpose something like this: <xsl:template match='end_time'> <xsl:value-of select="substring-before(.,'<span')"/> <xsl:value-of select="substring-before(substring-after(.,'>'),'</span>'"/> <xsl:value-of select="substring-after(.,'</span>')"/> </xsl:template> very ugly -- Cordialement, /// (. .) --------ooO--(_)--Ooo-------- | Philippe Poulard | ----------------------------- http://reflex.gforge.inria.fr/ Have the RefleX ! | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
