[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] How do I force the XSLT processor to retain a namespace declaration despite an ancestor element having that same namespace declaration?
Subject: Re: [xsl] How do I force the XSLT processor to retain a namespace declaration despite an ancestor element having that same namespace declaration? From: Andrew Welch <andrew.j.welch@xxxxxxxxx> Date: Mon, 25 Jul 2011 18:34:26 +0100 |
On 25 July 2011 18:05, Costello, Roger L. <costello@xxxxxxxxx> wrote: > Hi Folks, > > When this is evaluated: > > <test xmlns:xs="http://www.w3.org/2001/XMLSchema"> > <inner xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" /> > </test> > > The output is this: > > <test xmlns:xs="http://www.w3.org/2001/XMLSchema"> > <inner type="xs:string" /> > </test> > > Notice that the namespace declaration on <inner> is gone. > > How do I force the XSLT processor to retain that namespace declaration and not discard it? (I am passing the <inner> element to other functions that don't have access to its surrounding elements, so I need that namespace declaration retained.) > The key part here is how are you "passing the <inner> element to other functions"? In the parsed xml, the namespace is in scope on the inner element - if you call in-scope-prefixes() you'll see 'xs' getting returned, so you shouldn't need access to the surrounding elements. If you are treating the xml as a string and just substringing or regexing out the <inner> element, then you will run into problems like this. -- Andrew Welch http://andrewjwelch.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] How do I force the XSLT p, Christopher R. Maden | Thread | Re: [xsl] How do I force the XSLT p, David Carlisle |
Re: [xsl] How do I force the XSLT p, Christopher R. Maden | Date | Re: [xsl] How do I force the XSLT p, David Carlisle |
Month |