mondenkind: xpath zugriff aus template auf ein xml-element mit namespace!?

habe folgendes problem und hoffe jemand kann mir helfen!

aus einer java-application bekomme ich ein xml-file generiert mit elementen die folgendermaßen aussehen:

<dc xmlns="topology.model.telemetering.tyrux.test.com" id="90" serialNo="56309" estateId="13123"/>
<ed xmlns="topology.model.telemetering.tyrux.test.com" id="60" serialNo="43942" estateId="13123"/>

etc.

mein xsl-file soll das ganze jetzt in html transformieren und dafür würde ich gerne für die unterschiedlichen elemente (dc, ed...) templates anlegen.

<xsl:template match="dc"> funktioniert aber nicht. wie komme ich an meine elemente mit xmlns-attributen ran?!
<xsl:template match=".............."> ?!?!

vielen dank schon mal!

  1. Hello out there!

    <dc xmlns="topology.model.telemetering.tyrux.test.com" id="90" serialNo="56309" estateId="13123"/>
    <ed xmlns="topology.model.telemetering.tyrux.test.com" id="60" serialNo="43942" estateId="13123"/>

    <xsl:template match="dc"> funktioniert aber nicht. wie komme ich an meine elemente mit xmlns-attributen ran?!
    <xsl:template match=".............."> ?!?!

    Du musst im Stylesheet alle Namensräume bekanntmachen:

    <xsl:stylesheet version="1.0"  
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
      xmlns:myNamespace="topology.model.telemetering.tyrux.test.com"  
    
    >
    
    

    Und dann verwenden:
    <xsl:template match="myNamespace:dc">

    See ya up the road,
    Gunnar

    --
    “Remember, in the end, nobody wins unless everybody wins.” (Bruce Springsteen)