[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] wordml to xml (formatting) using loop

Subject: Re: [xsl] wordml to xml (formatting) using loop
From: "Imsieke, Gerrit, le-tex" <gerrit.imsieke@xxxxxxxxx>
Date: Fri, 15 Mar 2013 10:43:37 +0100


Id recursively call a named template that creates the wrapping elements. With each recursion, the stack of formatting instructions will shrink by one, until ultimately the stack is empty and w:t will be processed.

See this ShareXML paste: http://www.sharexml.com:80/x/get?k=LLUgPpFyiAk1

Please note that according to the OOXML schema, the formatting instructions may only occur in what seems like an alphabetical order, that is, w:b, w:i, w:u. So your second example should not happen in practice. It will, however, be handled by the stylesheet nonetheless.


On 15.03.2013 08:18, Joga Singh Rawat wrote:
Hi Team,
Anybody who have an idea to handle it in the best way. I don't have any
idea, how to handling it using loop in xslt 2.0. Right now I am getting
duplicate texts

     <w:t>bold italics underline text</w:t>
Output should be: <b><i><u>bold italics underline text</u></i></b>

     <w:t>italics bold  underline text</w:t>

Output should be: <i><b><u>italics bold underline text</u></b></i>

<!--Text run container-->
  <xsl:template match="w:r">
     <xsl:apply-templates select="w:rPr" mode="styling"/>

  <!--Text run properties container-->
  <xsl:template match="w:rPr" mode="styling">
   <xsl:for-each select="w:vertAlign|w:u|w:b|w:i|w:smallCaps|w:highlight">
    <xsl:element name="{local-name()}">
      <xsl:apply-templates select="../../w:t"/>

-- Gerrit Imsieke Geschdftsf|hrer / Managing Director le-tex publishing services GmbH Weissenfelser Str. 84, 04229 Leipzig, Germany Phone +49 341 355356 110, Fax +49 341 355356 510 gerrit.imsieke@xxxxxxxxx, http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschdftsf|hrer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vvckler

Current Thread