root-processing_axf.xsl 1.7 KB

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