1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
<xsl:template match="mediawiki">
<xsl:copy>
<xsl:for-each select="page">
<xsl:variable name="title_in" select="title" />
<xsl:variable name="concept_id" select="translate($title_in,' ','')"/>
<xsl:variable name="file" select="title" />
<xsl:variable name="file_out_name" select="concat('../DITAInput/',$file,'.dita')" />
<xsl:variable name="author" select="revision/contributor/username"/>
<redirect:write file="{$file_out_name}">
<web_content>
<concept id="{$concept_id}">
<title><xsl:value-of select="$title_in"/></title>
<shortdesc><xsl:value-of select="revision/text/shortdesc"/></shortdesc>
<prolog>
<author><xsl:value-of select="$author"/></author>
<permissions >
<xsl:attribute name="view">
<xsl:value-of select="revision/text/permissions"/>
</xsl:attribute>
</permissions>
<metadata>
<keywords>
<xsl:apply-templates select="//keyword"/>
</keywords>
</metadata>
</prolog>
<conbody>
<!-- <p><xsl:value-of select="$body"/></p>-->
<xsl:apply-templates name="revision/text/body"/>
<xsl:apply-templates select="revision/text/body/*"/>
</conbody>
<related-links>
<xsl:apply-templates select="//link"/>
</related-links>
</concept>
</web_content>
</redirect:write>
</xsl:for-each>
</xsl:copy>
</xsl:template> |
Partager