Advertisement
Linda-chan

document.xsl

Sep 10th, 2013
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 0.89 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <xsl:stylesheet version="1.0"
  4.                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5.                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
  6.  
  7. <xsl:output method="text"
  8.            encoding="utf-8"
  9.            media-type="text/plain" />
  10.  
  11. <!-- ============================================================ -->
  12.  
  13. <xsl:template match="w:p">
  14.   <xsl:if test="count(w:r/w:t) > 0">
  15.     <xsl:apply-templates select="w:r/w:t" />
  16.    
  17.     <xsl:if test="count(following-sibling::node()/w:r/w:t) > 0">
  18.       <xsl:text>&#13;&#10;</xsl:text>
  19.       <xsl:text>&#13;&#10;</xsl:text>
  20.     </xsl:if>
  21.   </xsl:if>
  22. </xsl:template>
  23.  
  24. <!-- ============================================================ -->
  25.  
  26. <xsl:template match="w:t">
  27.   <xsl:value-of select="." disable-output-escaping="yes" />
  28. </xsl:template>
  29.  
  30. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement