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

Re: Dynamically setting namespace prefix

Subject: Re: Dynamically setting namespace prefix
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Thu, 7 Jun 2007 14:22:08 +0100
Re:  Dynamically setting namespace prefix
On 6/7/07, Hofman, Peter <peter.hofman@xxxxxxxxxxxxx> wrote:
Hi all,

I am trying to generate schemas from some XML source, using XSLT 2.0
(Saxon 8.9 B).

During the generation I have to dynamically add imports of several other
schemas, of which the namespace is composed during processing.

However, I need to add those namespaces to the schema element, in order
to have references to the imported schemas work.

How can I dynamically set the prefix of a namespace, if I do not know
how many there will be. Using a variable in xsl:namespace like
<xsl:namespace name="$some_variable" .../> fails.

Use an AVT eg:


<xsl:element name="{$pre}:mynode">
 ...
</xsl:element>

where $pre is the prefix thats defined.

Or are you just missing the braces in xsl:namespace?

<xsl:namespace name="{$some_variable}"/>

Maybe post a failing example to make it clearer...

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.