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

RE: xslt 1.0 namespace on output doc

Subject: RE: xslt 1.0 namespace on output doc
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 12 Apr 2006 17:35:05 +0100
xslt 1.0 namespace
> should get transformed by:
> <?xml version="1.0" encoding="UTF-8" ?>
> <xsl:stylesheet version="1.0"
> 			xmlns="http://www.w3.org/1999/xhtml"
> 			xmlns:xhtml="http://www.w3.org/1999/xhtml"

<snip/> 
			
> <xsl:template match="/">
> 	<html lang="de" xml:lang="de">
> 
> into the following xhtml (apart from white-space, and well, not really

<snip/>

> <html xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">

<snip/>

> 
> But only Transformiix (Fx 1.5.01) gives me the expected 
> result, whereas
> SAXON 6.5.5 and MSXML 3 both add
> xmlns:xhtml="http://www.w3.org/1999/xhtml"
> to the html element.

With XSLT 1.0, the majority are usually in the right. The specification says
that for a literal result element (such as <html>) all namespace nodes that
are in-scope for that element in the stylesheet are copied to the result
document. This includes the namespace node that maps the prefix "xhtml" to
the URI "http://www.w3.org/1999/xhtml" 

You might be able to prevent this happening with exclude-result-prefixes.
This isn't guaranteed to work, however: some processors will ignore the
exclude-result-prefixes if the namespace in question is one that is actually
used in the result tree. This is conformant behavior because XSLT 1.0
basically says the serializer can add any namespaces it wants. By contrast,
the behavior you are seeing from Transformiix appears to be non-conformant.

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.