Created
April 10, 2020 15:38
-
-
Save simonpoole/b7425768b1b5cb317c6227c93c6839cd to your computer and use it in GitHub Desktop.
xslt to renumber a OSM Notes file
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
<?xml version="1.0" encoding="utf-8"?> | |
<xsl:stylesheet | |
version="2.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output | |
method="xml" | |
indent="yes" /> | |
<xsl:template match="@id" /> | |
<xsl:template match="note"> | |
<xsl:copy> | |
<xsl:attribute name="id"> | |
<xsl:text>-</xsl:text> | |
<xsl:number /> | |
</xsl:attribute> | |
<xsl:apply-templates select="@*|node()" /> | |
</xsl:copy> | |
</xsl:template> | |
<xsl:template match="@*|node()"> | |
<xsl:copy> | |
<xsl:apply-templates select="@*|node()" /> | |
</xsl:copy> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment