ms2ooo_docpr.xsl 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. * This file is part of the LibreOffice project.
  4. *
  5. * This Source Code Form is subject to the terms of the Mozilla Public
  6. * License, v. 2.0. If a copy of the MPL was not distributed with this
  7. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  8. *
  9. * This file incorporates work covered by the following license notice:
  10. *
  11. * Licensed to the Apache Software Foundation (ASF) under one or more
  12. * contributor license agreements. See the NOTICE file distributed
  13. * with this work for additional information regarding copyright
  14. * ownership. The ASF licenses this file to you under the Apache
  15. * License, Version 2.0 (the "License"); you may not use this file
  16. * except in compliance with the License. You may obtain a copy of
  17. * the License at http://www.apache.org/licenses/LICENSE-2.0 .
  18. -->
  19. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" exclude-result-prefixes="w wx aml o dt fo v">
  20. <xsl:template match="o:DocumentProperties">
  21. <office:meta>
  22. <meta:generator>Microsoft Word 2003</meta:generator>
  23. <dc:title>
  24. <xsl:value-of select="o:Title"/>
  25. </dc:title>
  26. <dc:description>
  27. <xsl:value-of select="o:Description"/>
  28. </dc:description>
  29. <dc:subject>
  30. <xsl:value-of select="o:Subject"/>
  31. </dc:subject>
  32. <meta:initial-creator>
  33. <xsl:value-of select="o:Author"/>
  34. </meta:initial-creator>
  35. <meta:creation-date>
  36. <xsl:value-of select="substring-before( o:Created, 'Z')"/>
  37. </meta:creation-date>
  38. <dc:creator>
  39. <xsl:value-of select="o:LastAuthor"/>
  40. </dc:creator>
  41. <xsl:if test="string-length(substring-before( o:LastSaved, 'Z')) &gt; 0">
  42. <dc:date>
  43. <xsl:value-of select="substring-before( o:LastSaved, 'Z')"/>
  44. </dc:date>
  45. </xsl:if>
  46. <!-- comment out the below line now because Oasis format doesn't allow the meta:print-by to be empty element -->
  47. <!--meta:printed-by /-->
  48. <xsl:if test="string-length(substring-before( o:LastPrinted, 'Z')) &gt; 0">
  49. <!--
  50. <meta:print-date>
  51. <xsl:value-of select="substring-before( o:LastPrinted, 'Z')"/>
  52. </meta:print-date>
  53. -->
  54. </xsl:if>
  55. <meta:keyword>
  56. <xsl:value-of select="o:Keywords"/>
  57. </meta:keyword>
  58. <meta:editing-cycles>
  59. <xsl:value-of select="o:Revision"/>
  60. </meta:editing-cycles>
  61. <meta:editing-duration>
  62. <xsl:if test="o:TotalTime">
  63. <xsl:value-of select="concat('PT', floor(o:TotalTime div 60), 'H', o:TotalTime mod 60, 'M0S')"/>
  64. </xsl:if>
  65. </meta:editing-duration>
  66. <meta:user-defined meta:name="Category" meta:value-type="string">
  67. <xsl:value-of select="o:Category"/>
  68. </meta:user-defined>
  69. <meta:user-defined meta:name="Manager" meta:value-type="string">
  70. <xsl:value-of select="o:Manager"/>
  71. </meta:user-defined>
  72. <meta:user-defined meta:name="Company" meta:value-type="string">
  73. <xsl:value-of select="o:Company"/>
  74. </meta:user-defined>
  75. <meta:user-defined meta:name="Version" meta:value-type="string">
  76. <xsl:value-of select="o:Version"/>
  77. </meta:user-defined>
  78. <meta:user-defined meta:name="HyperlinkBase" meta:value-type="string">
  79. <xsl:value-of select="o:HyperlinkBase"/>
  80. </meta:user-defined>
  81. <xsl:apply-templates select="../o:CustomDocumentProperties"/>
  82. <meta:document-statistic meta:page-count="{o:Pages}" meta:paragraph-count="{o:Paragraphs}" meta:word-count="{o:Words}" meta:character-count="{o:Characters}"/>
  83. </office:meta>
  84. </xsl:template>
  85. <xsl:template match="o:CustomDocumentProperties">
  86. <xsl:for-each select="node()[@dt:dt]">
  87. <meta:user-defined meta:name="{local-name()}" meta:value-type="{@dt:dt}">
  88. <xsl:value-of select="."/>
  89. </meta:user-defined>
  90. </xsl:for-each>
  91. </xsl:template>
  92. </xsl:stylesheet>