Skip to content

Commit

Permalink
Reformat for proper indentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbjones committed Aug 14, 2019
1 parent bcd56c5 commit 2b6a46d
Showing 1 changed file with 31 additions and 41 deletions.
72 changes: 31 additions & 41 deletions style/eml_appinfo2documentation.xsl
Original file line number Diff line number Diff line change
@@ -1,85 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:doc="eml://ecoinformatics.org/documentation-2.2.0"
exclude-result-prefixes="xs"
version="1.0">





<!--Identity template,
provides default behavior that copies all content into the output -->


<!--Identity template, provides default behavior that copies all content into the output -->

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>





<!-- template for appinfo node that
a) converts to a documentation node and b) uses element name to label content -->
<xsl:template match="xs:appinfo">

<!-- template for appinfo node that a) converts to a documentation node and b) uses element name to label content -->
<xsl:template match="xs:appinfo">

<xsl:variable name="newline">
<xsl:text>&#10;</xsl:text>
</xsl:variable>

<xsl:variable name="colon">
<xsl:text>:</xsl:text>
</xsl:variable>

<xsl:variable name="comma">
<xsl:text>,</xsl:text>
</xsl:variable>

<xsl:variable name="sp1">
<xsl:text> </xsl:text>
</xsl:variable>

<xsl:variable name="delimiter">
<xsl:text>|</xsl:text>
</xsl:variable>
<xs:documentation>

<xsl:for-each select="doc:summary|doc:tooltip|doc:description">
<xsl:value-of select="$newline"/>
<xsl:variable name="value" select="local-name()"/>
<xsl:value-of select="$value"/>
<xsl:value-of select="$colon"/>
<xsl:value-of select="$sp1"/>
<xsl:value-of select="."/>
<xsl:value-of select="$newline"/>

</xsl:for-each>

<xsl:for-each select="doc:moduleDocs">
<xsl:for-each select="*">
<xsl:value-of select="$newline"/>
<xsl:variable name="value" select="local-name()"/>
<xsl:value-of select="$value"/>
<xsl:value-of select="$colon"/>
<xsl:value-of select="$sp1"/>
<xsl:value-of select="."/>
<xsl:value-of select="$newline"/>

</xsl:for-each>

<xsl:for-each select="doc:moduleDocs">
<xsl:for-each select="*">
<xsl:value-of select="$newline"/>
<xsl:variable name="value" select="local-name()"/>
<xsl:value-of select="$value"/>
<xsl:value-of select="$colon"/>
<xsl:value-of select="$sp1"/>
<xsl:value-of select="."/>
<xsl:value-of select="$newline"/>
</xsl:for-each>
</xsl:for-each>
</xs:documentation>
</xsl:template>

<!--
<xsl:template match="xs:appinfo">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<xsl:text> add some text </xsl:text>
</xsl:copy>
</xsl:template>
-->


<!-- <xsl:template match="xs:appinfo"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> <xsl:text> add some text </xsl:text> </xsl:copy> </xsl:template> -->

<!-- not sure how to id cdata section. can't use match. string? -->
<xsl:template name="build-CDATA">
<xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>

<xsl:apply-templates select="child::node()"/>
<xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
</xsl:template>
</xsl:stylesheet>
</xsl:stylesheet>

0 comments on commit 2b6a46d

Please sign in to comment.