[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: From WordprocessingML inline styles to nested inli
> 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@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>
|
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
|