xsl-list
[Top] [All Lists]

Re: [xsl] Namespace problem

2010-11-08 08:16:18
Nick Leaton wrote:
I'm trying to output the following xml

            <calypso:secCode>
                <calypso:name>ISIN</calypso:name>
                <calypso:value xsi:type="ns3:string"
xmlns:ns3="http://www.w3.org/2001/XMLSchema";>XF0003195919</calypso:value>
            </calypso:secCode>

I have a style sheet with a header as follows

<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:xs="http://www.w3.org/2001/XMLSchema";
    xmlns:calypso="http://www.calypso.com/xml";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xmlns:saxon="http://saxon.sf.net/";
    xmlns:ns3="http://www.w3.org/2001/XMLSchema";
    version="2.0"
    exclude-result-prefixes="xsl xs calypso xsi saxon"
    >

and output code as follows

                <calypso:secCode>
                    <calypso:name>ISIN</calypso:name>
                    <calypso:value xsi:type="ns3:string"
xmlns:ns3="http://www.w3.org/2001/XMLSchema";>
                        <xsl:value-of select="$message/ISIN"/>
                    </calypso:value>
                </calypso:secCode>

This gives this output

            <calypso:secCode>
                <calypso:name>ISIN</calypso:name>
                <calypso:value
xsi:type="ns3:string">XF0003195919</calypso:value>
            </calypso:secCode>

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="http://www.w3.org/2001/XMLSchema";
attribute into the output?

Which XSLT processor do you use? Can you post a minimal XML and XSLT code sample allowing us to reproduce the problem?


--

        Martin Honnen
        http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>