Mercurial > hg > mpdl-group
view software/eXist/webapp/mpdl/presentation/functions-util.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 | 5589d865af7a |
children |
line wrap: on
line source
<?xml version="1.0"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mpdl-util="http://www.mpiwg-berlin.mpg.de/ns/mpdl/util"> <xsl:function name="mpdl-util:copyWithoutNamespace"> <xsl:param name="myElem"/> <xsl:for-each select="$myElem"> <xsl:choose> <xsl:when test="self::*"> <!--myElem is an element--> <xsl:element name="{$myElem/name()}" namespace=""> <xsl:copy-of select="$myElem/@*"/> <!-- attributes --> <xsl:for-each select="$myElem/* | $myElem/text()"> <!-- element and text child nodes of the node --> <xsl:sequence select="mpdl-util:copyWithoutNamespace(.)"/> </xsl:for-each> </xsl:element> </xsl:when> <xsl:when test="self::text()"> <!-- text --> <xsl:text></xsl:text><xsl:value-of select="."/> </xsl:when> <xsl:otherwise></xsl:otherwise> </xsl:choose> </xsl:for-each> </xsl:function> </xsl:stylesheet>