I'm wondering if it's possible to
normalize all the space without removing the leading and trailing
whitespace?
<xsl:variable name="x" select="normalize-space(concat('!',.,'!'))"/>
<xsl:value-of select="substring($x,2,string-length($x)-2)"/>
I didn't follow all your wordml but the following flattens out any b and
i elements (and can easily be extended any list of inline elements.
<p>
<b> bold <br/> text <i> bold and italic </i> just bold again </b>
plain text and images <img src="zzz"/>
</p>
gets turned into
<p>
<start-b/> bold <end-b/><br/><start-b/> text <end-b/><start-b/><start-i/> bold
and italic <end-i/><end-b/><start-b/> just bold again <end-b/>
plain text and images <img src="zzz"/>
</p>
so all text is now a child of <p>.
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
<xsl:template match="b|i">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="text()">
<xsl:for-each select="ancestor::*[self::b|self::i]">
<xsl:element name="start-{name()}"/>
</xsl:for-each>
<xsl:value-of select="."/>
<xsl:for-each select="ancestor::*[self::b|self::i]">
<xsl:sort data-type="number" select="- position()"/>
<xsl:element name="end-{name()}"/>
</xsl:for-each>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--