xsl-list
[Top] [All Lists]

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

2007-02-05 06:16:19
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
san
Andrew Welch <andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com>  to xsl-list 
 show details  1:06 pm (1 hour ago)  

On 2/5/07, San <san_sar(_at_)yahoo(_dot_)com> 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="http://www.exercise.com";
xmlns:adlcp="http://www.adlnet.org/xsd"/>

the desired output (added namespaces in the root
element)
<Metadata
xmlns:ex="http://www.exercise.com";
xmlns:per="http://www.adlnet.org/xsd";>
....
</Metadata>

How do I add this namespaces, since I can't do it
manually?Which xpath that access the root and tell
it
to add the namespaces?


Add the namespaces to your xsl:stylesheet element:

<xsl:stylesheet

 xmlns:ex="http://www.exercise.com";
 xmlns:per="http://www.adlnet.org/xsd";


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

<xsl:template match="/">
 <Metadata>

...will result in:


<Metadata xmlns:ex="http://www.exercise.com";
 xmlns:per="http://www.adlnet.org/xsd";>


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

cheers

andrew

- Hide quoted text -

--~------------------------------------------------------------------
 



 
____________________________________________________________________________________
No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail 

--~------------------------------------------------------------------
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>
--~--