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

RE: adding namespaces to result nodes

Subject: RE: adding namespaces to result nodes
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 8 Apr 2005 12:26:20 +0100
predictable and unpredictable prefixes
>          Iam taking the text of an element in the input file 
> and making it
> into an element. The element in question is named 'slideshow' and it
> doesn't have a prefix. You say
> "the processor may put the element in the default namespace, or it may
> invent a prefix"
> Does this mean the processor Iam using (xalan) is adding the 
> prefix whereas
> another processor may not.

Yes. If you write

<xsl:element name="slideshow" namespace="http://some.uri/"/>

Then the processor may generate

<ns0:slideshow xmlns:ns0="http://some.uri/"/>

or

<slideshow xmlns="http://some.uri/"/>

- it's implementation-defined. 

XSLT 2.0 has rules that make the generation of namespace prefixes slightly
more predictable, though there are still cases where the processor is
allowed to dream one up.

> 
> Iam not tied to any processor and I may opt for another 
> processor if this
> is the case other things permitting.

It's not a good idea to choose a processor because it happens to do what you
want, when the language says that the behavior of your stylesheet is
unpredictable. Better to ask yourself some questions about the requirement
you are trying to satisfy - why do namespace prefixes matter so much?

Michael Kay
http://www.saxonica.com/

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.