Customizing Akoma Ntoso: modularization, restrictions, extensions
Appendix B: The MapGenerator.xsl stylesheet
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsl:variable name="noTranslation" select='("a", "akomaNtoso", "b", "del", "div", "i", "img", "ins", "li", "ol", "p", "span", "sub", "sup", "table", "td", "th", "tr", "u", "ul", "alt", "border", "cellpadding", "cellspacing", "class", "colspan", "height", "href", "id", "rowspan", "src", "title", "width" )'/>
<xsl:template match="/">
<akomaNtosoMap>
<source xml:lang="en" namespace="http://www.akomantoso.org/20" schemaLocation="akomantoso20.xsd" />
<dest xml:lang="en" namespace="http://www.akomantoso.org/20/en" schemaLocation="akomantoso20.xsd" />
<xsl:variable name="elements" select="distinct-values(//xsd:element/@name)" />
<xsl:variable name="attributes" select="distinct-values(//xsd:attribute/@name)" />
<xsl:variable name="enumerations" select="distinct-values(//xsd:enumeration/@value)" />
<xsl:for-each select="$elements">
<xsl:sort select="." />
<xsl:if test="empty(index-of($noTranslation,.))">
<element source="{.}" dest="{.}" />
</xsl:if>
</xsl:for-each>
<xsl:for-each select="$attributes">
<xsl:sort select="." />
<xsl:if test="empty(index-of($noTranslation,.))">
<attribute source="{.}" dest="{.}" />
</xsl:if>
</xsl:for-each>
<xsl:for-each select="$enumerations">
<xsl:sort select="." />
<xsl:if test="empty(index-of($noTranslation,.))">
<enumeration source="{.}" dest="{.}" />
</xsl:if>
</xsl:for-each>
</akomaNtosoMap>
</xsl:template>
<xsl:template match="*" />
</xsl:stylesheet>




Previous:
Appendix A: Translations of Akoma Ntoso