[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Getting the root namespace from the input document

Subject: Re: Getting the root namespace from the input document
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 5 Feb 2007 12:06:13 +0000
Re:  Getting the root namespace from the input document
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="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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.