Extract inline comments from a Word 2007 document using XSLT


/ Published in: XML
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <![CDATA[
  2. <?xml version="1.0" encoding="utf-8"?>
  3. <xsl:stylesheet version="1.0"
  4. xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
  5. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  6. <xsl:output method="xml" indent="yes" />
  7.  
  8. <!--<xsl:template match="@* | node()">-->
  9. <xsl:template match="/">
  10. <html>
  11. <head>
  12. <link rel="stylesheet" type="text/css" href="BeckmanCoulter_Comments.css"/>
  13. </head>
  14. <body>
  15. <h2>Word Comments<!--: <xsl:value-of select="b:LIS2A2Spec/@name"/>--></h2>
  16. <xsl:for-each select="w:comments/w:comment">
  17. <br />
  18. <xsl:value-of select="./@w:author"/> (<xsl:value-of select="./@w:initials"/>)&#160;&#160;&#160;|&#160;&#160;&#160;<xsl:value-of select="./@w:date"/>
  19. <br />
  20. <xsl:value-of select="."/>
  21. <br />
  22. </xsl:for-each>
  23.  
  24. <br/>
  25. <hr/>
  26. <br/>
  27. </body>
  28. </html>
  29. </xsl:template>
  30. </xsl:stylesheet>
  31. ]]>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.