default namespace in xsl
Posted: Wed May 31, 2006 4:19 pm
I receive an xml message with the following format:
I fail to apply transformation when using a stylesheet like:
I have tried adding the default namespace to the xsl (xmlns="Static/nme" ) without sucess.
However if I use a prefix xmlns:j="Static/nme" , I can reference my nodes with j:\
Is this a normal behavior and is there a way of using the default namespace in the xsl sheet to reference nodes and values?
Tx,
Mik.
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1" ?>
<staticMessage xmlns="Static/nme" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="Static/nme ./StaticMessage.xsd">
...
</staticMessage>
Code: Select all
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:value-of select="staticMessage/body/data"/>
</xsl:template>
</xsl:stylesheet>
However if I use a prefix xmlns:j="Static/nme" , I can reference my nodes with j:\
Is this a normal behavior and is there a way of using the default namespace in the xsl sheet to reference nodes and values?
Tx,
Mik.