generated from opengeospatial/bblock-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
65 additions
and
1 deletion.
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
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
45 changes: 45 additions & 0 deletions
45
_sources/transforms/transforms-example/transforms/sample.xslt
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,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | ||
<xsl:output method="xml" indent="yes" encoding="UTF-8"/> | ||
|
||
<!-- Match the root node --> | ||
<xsl:template match="/"> | ||
<xsl:apply-templates select="Article"/> | ||
</xsl:template> | ||
|
||
<!-- Transform <Article> --> | ||
<xsl:template match="Article"> | ||
<Document type="article"> | ||
<xsl:apply-templates select="*"/> | ||
</Document> | ||
</xsl:template> | ||
|
||
<!-- Transform <Title> to <Heading> --> | ||
<xsl:template match="Title"> | ||
<Heading> | ||
<xsl:apply-templates/> | ||
</Heading> | ||
</xsl:template> | ||
|
||
<!-- Wrap <Authors> content in <Contributors> --> | ||
<xsl:template match="Authors"> | ||
<Contributors> | ||
<xsl:apply-templates select="Author"/> | ||
</Contributors> | ||
</xsl:template> | ||
|
||
<!-- Leave <Author> as is --> | ||
<xsl:template match="Author"> | ||
<xsl:copy> | ||
<xsl:apply-templates/> | ||
</xsl:copy> | ||
</xsl:template> | ||
|
||
<!-- Append " [Modified]" to the <Body> --> | ||
<xsl:template match="Body"> | ||
<xsl:copy> | ||
<xsl:value-of select="concat(., ' [Modified]')"/> | ||
</xsl:copy> | ||
</xsl:template> | ||
|
||
</xsl:stylesheet> |