Re: [xsl] Namespace problem

Subject: Re: [xsl] Namespace problem
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 08 Nov 2010 14:22:02 +0000
On 08/11/2010 14:09, Nick Leaton wrote:
I'm trying to output the following xml

                 <calypso:value xsi:type="ns3:string"

I have a style sheet with a header as follows

     exclude-result-prefixes="xsl xs calypso xsi saxon"

remove result prefixes xs means remove the namespace whose prefix is ns, and that is the same namespace as has the prefix ns3.

and output code as follows

                     <calypso:value xsi:type="ns3:string"
having the namespace here makes no difference as it is already in scope.
                         <xsl:value-of select="$message/ISIN"/>

This gives this output


Missing is the xmlns:ns3 attribute.

The consumer is outside my control and finicky about what it accepts.

How can I get the xmlns:ns3="";
attribute into the output?

It should not be missing, it should be on the document element.

If you mean that you want it not on the document element but just want it on this calypso:value, probably the easiest is to just remove the
xmlns:ns3=""; and xmlns:xs"";
from xsl:stylesheet, unless you need it for some other reason.


The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________

Current Thread