-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding a template to move appinfo to documentation
- Loading branch information
Showing
1 changed file
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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 --> | ||
|
||
<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"> | ||
<xsl:variable name="newline"> | ||
<xsl:text> </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> | ||
</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> | ||
--> | ||
|
||
<!-- not sure how to id cdata section. can't use match. string? --> | ||
<xsl:template name="build-CDATA"> | ||
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text> | ||
<xsl:apply-templates select="child::node()"/> | ||
<xsl:text disable-output-escaping="yes">]]></xsl:text> | ||
</xsl:template> | ||
</xsl:stylesheet> |