This blog is mainly for me, a way of remembering things I've done; when I couldn't find an answer on Google, I wrote about it here. Hopefully, other people may find it helpful too.
XSL to re-number sequences

Say you have an XML file, some of the elementa have attributes with sequence numbers, and you want to re-number them all consecutively, try this XSL:

<xsl:stylesheet version="1.0" xmlns:xsl="" xmlns:ns1="" exclude-result-prefixes="ns1" xmlns:r="" >
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="@* | node()">
  <xsl:apply-templates select="@* | node()"/>

<xsl:template match="@Sequence">
 <xsl:attribute name="Sequence">
  <xsl:number from="/" level="any"/>


Last modified on 2012-07-14