hdita2dita.xsl 1017 B

12345678910111213141516171819202122232425262728293031
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <xsl:stylesheet version="2.0"
  3. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  5. xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/"
  6. xpath-default-namespace="http://www.w3.org/1999/xhtml"
  7. exclude-result-prefixes="xs">
  8. <xsl:import href="classpath:///hdita2dita-common.xsl"/>
  9. <xsl:output indent="yes"></xsl:output>
  10. <xsl:template match="/">
  11. <xsl:apply-templates select="html"/>
  12. </xsl:template>
  13. <xsl:template match="html">
  14. <xsl:choose>
  15. <xsl:when test="count(body/article) gt 1">
  16. <dita>
  17. <xsl:attribute name="ditaarch:DITAArchVersion">1.3</xsl:attribute>
  18. <xsl:apply-templates select="@* | node()"/>
  19. </dita>
  20. </xsl:when>
  21. <xsl:otherwise>
  22. <xsl:apply-templates select="body"/>
  23. </xsl:otherwise>
  24. </xsl:choose>
  25. </xsl:template>
  26. </xsl:stylesheet>