Mercurial > hg > mpdl-group
comparison software/mpdl-services-new/mpiwg-mpdl-cms-web/WebContent/xsl/generateId.xsl @ 25:e9fe3186670c default tip
letzter Stand eingecheckt
author | Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de> |
---|---|
date | Tue, 21 May 2013 10:19:32 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
23:e845310098ba | 25:e9fe3186670c |
---|---|
1 <?xml version="1.0"?> | |
2 | |
3 <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
4 | |
5 <xsl:output method="xml" encoding="utf-8"/> | |
6 | |
7 <xsl:template match="@*|node()"> | |
8 <xsl:copy> | |
9 <xsl:apply-templates select="@*|node()"/> | |
10 </xsl:copy> | |
11 </xsl:template> | |
12 | |
13 <xsl:template match="*:s|*:head"> | |
14 <xsl:variable name="elemName" select="name()"/> | |
15 <xsl:variable name="docPos"> | |
16 <xsl:choose> | |
17 <xsl:when test="$elemName = 's'"> | |
18 <xsl:value-of select="count(./preceding::*:s) + 1"/> | |
19 </xsl:when> | |
20 <xsl:when test="$elemName = 'head'"> | |
21 <xsl:value-of select="count(./preceding::*:head) + 1"/> | |
22 </xsl:when> | |
23 <xsl:otherwise></xsl:otherwise> | |
24 </xsl:choose> | |
25 </xsl:variable> | |
26 <xsl:copy> | |
27 <xsl:attribute name="xml:id"> | |
28 <xsl:value-of select="concat($elemName, $docPos)"/> | |
29 </xsl:attribute> | |
30 <xsl:apply-templates select="@*|node()"/> | |
31 </xsl:copy> | |
32 </xsl:template> | |
33 | |
34 </xsl:stylesheet> |