Per XSLT kopierte Elemente verlieren Namespace

Titus76

Grünschnabel
Hallo,
ich versuche über folgendes Skript ein XML-Dokument zu kopieren (später werden beim Kopieren noch Änderungen eingefügt). Allerdings wird der Namespace "java" nicht kopiert. Wie kann ich die Namespaces in den Knoten mitkopieren?

XML-Datei:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<handler name="URLMapper" type="java:org.apache.axis.handlers.http.URLMapper"/>
</deployment>

XSL-Datei:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://xml.apache.org/axis/wsdd/">
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{name()}">
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="@*">
<xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>
</xsl:stylesheet>

Ergebnis:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/">
<handler name="URLMapper" type="java:org.apache.axis.handlers.http.URLMapper"/>
</deployment>
 
Hallo,
das hatte ich auch schon mal (erfolglos) versucht. Nur der Standard Namespace wird aus dem Stylesheet-Element übernommen und gesetzt.
 

Neue Beiträge

Zurück