In my output, however, the inline styles should nest, and moreover, nest
in a particular order:
something like
$ saxon wp1.xml wp1.xsl
<?xml version="1.0" encoding="utf-8"?><run><b><i>This is text in bold and
italic.</i></b></run>
davidc(_at_)souldern /c/tmp
$ cat wp1.xml
<w:r xmlns:w="data:,w">
<w:rPr>
<w:i/>
<w:b/>
</w:rPr>
<w:t>This is text in bold and italic.</w:t>
</w:r>
$ cat wp1style.xml
<style_nesting>
<b><i><u/></i></b>
</style_nesting>
$ cat wp1.xsl
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:w="data:,w"
exclude-result-prefixes="w">
<xsl:variable name="s" select="document('wp1style.xml')/style_nesting"/>
<xsl:template match="w:r">
<run>
<xsl:apply-templates mode="s" select="$s">
<xsl:with-param name="t" select="w:t"/>
<xsl:with-param name="p" select="w:rPr"/>
</xsl:apply-templates>
</run>
</xsl:template>
<xsl:template match="*" mode="s">
<xsl:param name="t"/>
<xsl:param name="p"/>
<xsl:choose>
<xsl:when test="$p/*[local-name()=local-name(current())]">
<xsl:copy>
<xsl:apply-templates mode="s" select="*">
<xsl:with-param name="p" select="$p"/>
<xsl:with-param name="t" select="$t"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="s" select="*">
<xsl:with-param name="p" select="$p"/>
<xsl:with-param name="t" select="$t"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="not(*)">
<xsl:value-of select="$t"/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
--~------------------------------------------------------------------
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>
--~--