Re: [xsl] Getting the root namespace from the input document

Subject: Re: [xsl] Getting the root namespace from the input document
From: San <san_sar@xxxxxxxxx>
Date: Mon, 5 Feb 2007 05:16:05 -0800 (PST)
Hi Andrew,
thanks for your reply.
The problem is I don't know the namespace before. So
must take the namespace from input document. That what
I need and then put those namespace into the output
root document. 
thanks a bunch
Andrew Welch <andrew.j.welch@xxxxxxxxx>  to xsl-list 
 show details  1:06 pm (1 hour ago)  

On 2/5/07, San <san_sar@xxxxxxxxx> wrote:
> Also, I need to get the namespace from the input
> document and put it into the root element.
> For example the input root document :
> <manifest xmlns:ex="";
> xmlns:adlcp=""/>
> the desired output (added namespaces in the root
> element)
> <Metadata
> xmlns:ex="";
> xmlns:per="";>
> ....
> </Metadata>
> How do I add this namespaces, since I can't do it
> manually?Which xpath that access the root and tell
> to add the namespaces?

Add the namespaces to your xsl:stylesheet element:



Then just create the <Metadata> element and the
namespaces will be
added for you:

<xsl:template match="/">

...will result in:

<Metadata xmlns:ex="";

This might not be what you meant, but I won't guess...



- Hide quoted text -

Current Thread