|
13 | 13 | <xsl:strip-space elements="*" /> |
14 | 14 | <xsl:preserve-space elements="codeblock pre screen" /> |
15 | 15 |
|
| 16 | + <!-- set the language for the topic --> |
| 17 | + <xsl:template match="/topic"> |
| 18 | + <topic id="{@id}" xml:lang="en-us"> |
| 19 | + <xsl:copy> |
| 20 | + <xsl:apply-templates select="node()" /> |
| 21 | + </xsl:copy> |
| 22 | + </topic> |
| 23 | + </xsl:template> |
| 24 | + |
| 25 | + <!-- body/title isn't necessary --> |
| 26 | + <xsl:template match="//body/title" /> |
| 27 | + |
| 28 | + <!-- Some of our files have body/style, it isn't appropriate for dita --> |
| 29 | + <xsl:template match="//body/style" /> |
| 30 | + |
16 | 31 | <!-- Fix up any xref links that reference adoc documents |
17 | 32 | since adoc will not be used after the dita conversion --> |
18 | 33 | <xsl:template match="//xref[contains(@href, '.adoc')]"> |
19 | 34 | <xref href="{replace(@href, '.adoc', '.dita')}"><xsl:value-of select="text()" /></xref> |
20 | 35 | </xsl:template> |
21 | 36 |
|
22 | 37 | <!-- |
23 | | - Sections cannot be nested in DITA, but you can do a content reference. |
24 | | - This splits out the nested section into its own topic file and creates a conref in the original document. |
| 38 | + Sections cannot be nested in DITA. This splits out the nested section into its own topic file. |
25 | 39 | The new subsection file will be created alongside the original with the id of the current topic and the |
26 | 40 | subsection concatenated together. |
27 | 41 | --> |
28 | 42 | <xsl:template match="/topic/body/section//section"> |
29 | 43 | <xsl:variable name="sub-section-filename" select="concat(ancestor::topic/@id, @id, $file-extension)" /> |
30 | | - <div conref="{$sub-section-filename}"> |
31 | | - <xsl:value-of select="@id" /> |
32 | | - </div> |
| 44 | + <!-- We are removing the content from the main document and putting it into a new one --> |
33 | 45 | <xsl:result-document href="{$sub-section-filename}" format="sub-section"> |
34 | 46 | <topic id="{@id}"> |
35 | 47 | <xsl:copy-of select="title" /> |
|
0 commit comments