Mercurial > hg > mpdl-group
comparison software/eXist/webapp/mpdl/presentation/functions-util.xsl @ 7:5589d865af7a
Erstellung XQL/XSL Applikation
author | Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de> |
---|---|
date | Tue, 08 Feb 2011 15:16:46 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
6:2396a569e446 | 7:5589d865af7a |
---|---|
1 <?xml version="1.0"?> | |
2 <xsl:stylesheet version="2.0" | |
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
4 xmlns:xlink="http://www.w3.org/1999/xlink" | |
5 xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
6 xmlns:mpdl-util="http://www.mpiwg-berlin.mpg.de/ns/mpdl/util"> | |
7 | |
8 <xsl:function name="mpdl-util:copyWithoutNamespace"> | |
9 <xsl:param name="myElem"/> | |
10 <xsl:for-each select="$myElem"> | |
11 <xsl:choose> | |
12 <xsl:when test="self::*"> <!--myElem is an element--> | |
13 <xsl:element name="{$myElem/name()}" namespace=""> | |
14 <xsl:copy-of select="$myElem/@*"/> <!-- attributes --> | |
15 <xsl:for-each select="$myElem/* | $myElem/text()"> <!-- element and text child nodes of the node --> | |
16 <xsl:sequence select="mpdl-util:copyWithoutNamespace(.)"/> | |
17 </xsl:for-each> | |
18 </xsl:element> | |
19 </xsl:when> | |
20 <xsl:when test="self::text()"> <!-- text --> | |
21 <xsl:text></xsl:text><xsl:value-of select="."/> | |
22 </xsl:when> | |
23 <xsl:otherwise></xsl:otherwise> | |
24 </xsl:choose> | |
25 </xsl:for-each> | |
26 </xsl:function> | |
27 | |
28 </xsl:stylesheet> |