root-processing_axf.xsl 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. This file is part of the DITA Open Toolkit project.
  4. Copyright 2012 Jarno Elovirta
  5. See the accompanying LICENSE file for applicable license.
  6. -->
  7. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  8. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  9. xmlns:fo="http://www.w3.org/1999/XSL/Format"
  10. xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
  11. xmlns:dita-ot="http://dita-ot.sourceforge.net/ns/201007/dita-ot"
  12. version="2.0" exclude-result-prefixes="dita-ot xs">
  13. <xsl:template name="createMetadata">
  14. <xsl:variable name="title" as="xs:string?">
  15. <xsl:apply-templates select="." mode="dita-ot:title-metadata"/>
  16. </xsl:variable>
  17. <xsl:if test="exists($title)">
  18. <axf:document-info name="document-title" value="{$title}"/>
  19. </xsl:if>
  20. <!--axf:document-info name="subject" value="The document subject"/-->
  21. <xsl:variable name="author" as="xs:string?">
  22. <xsl:apply-templates select="." mode="dita-ot:author-metadata"/>
  23. </xsl:variable>
  24. <xsl:if test="exists($author)">
  25. <axf:document-info name="author" value="{$author}"/>
  26. </xsl:if>
  27. <xsl:variable name="keywords" as="xs:string*">
  28. <xsl:apply-templates select="." mode="dita-ot:keywords-metadata"/>
  29. </xsl:variable>
  30. <xsl:if test="exists($keywords)">
  31. <axf:document-info name="keywords">
  32. <xsl:attribute name="value">
  33. <xsl:value-of select="$keywords" separator=", "/>
  34. </xsl:attribute>
  35. </axf:document-info>
  36. </xsl:if>
  37. <xsl:variable name="subject" as="xs:string?">
  38. <xsl:apply-templates select="." mode="dita-ot:subject-metadata"/>
  39. </xsl:variable>
  40. <xsl:if test="exists($subject)">
  41. <axf:document-info name="subject" value="{$subject}"/>
  42. </xsl:if>
  43. </xsl:template>
  44. </xsl:stylesheet>