xsd-to-dita_xs__import.xsl 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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:xsd-to-dita="xsd-to-dita.xsd"
  5. exclude-result-prefixes="xs xsd-to-dita "
  6. version="2.0">
  7. <!--<xsl:variable name="xsd-to-dita:master.xsd" select="'xsd-to-dita_master.xsd'"/>-->
  8. <!--<xsl:output doctype-public="-//OASIS//DTD DITA Topic//EN"
  9. doctype-system="topic.dtd"/>-->
  10. <xsl:template mode="xsd-to-dita:master.xsd__import" match="xs:import">
  11. <!--<xsl:copy>
  12. <xsl:copy-of select="@*"/>
  13. </xsl:copy>-->
  14. <xsl:call-template name="xsd-to-dita:xs__import"/>
  15. </xsl:template>
  16. <xsl:template name="xsd-to-dita:xs__import">
  17. <xsl:message >
  18. <xsl:value-of select="$xsd-to-dita:out__dir"/>/<xsl:value-of select="tokenize(@schemaLocation,'/')[last()]"/><xsl:value-of select="last()"/>
  19. </xsl:message>
  20. <xsl:comment>#21A import</xsl:comment>
  21. <topicref href="{$xsd-to-dita:out__dir}/{tokenize(@schemaLocation,'/')[last()]}.dita"/>
  22. <xsl:result-document
  23. doctype-public="-//OASIS//DTD DITA Topic//EN"
  24. doctype-system="topic.dtd" href="{$xsd-to-dita:out__dir}/{tokenize(@schemaLocation,'/')[last()]}.dita">
  25. <topic id="{tokenize(@schemaLocation,'/')[last()]}">
  26. <title>kwp</title>
  27. <body>
  28. <p>
  29. <xsl:apply-templates mode="xsd-to-dita:master.xsd__import" select="doc(@schemaLocation)"/>
  30. </p>
  31. <p></p>
  32. </body>
  33. </topic>
  34. </xsl:result-document>
  35. </xsl:template>
  36. <!--<xsl:variable name="xsd-to-dita:master.xsd__import__schemaLocation"/>-->
  37. </xsl:stylesheet>