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

RE: Trouble with namespaces and running identity trans

Subject: RE: Trouble with namespaces and running identity transform on XHTML
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 11 Mar 2004 11:37:49 -0000
ncname xsl
There is a problem generating XHTML, or any other XML format that requires
specific prefixes to be declared. The XSLT 2.0 spec acknowledges this with a
fudge, simply pointing out that if the result tree is going to be serialized
as XHTML then it's a good idea for the namespace fixup process to take this
into account when allocating prefixes. XSLT 1.0 gives you no guarantees
about the prefixes used in the output and therefore no reliable and portable
way of generating XHTML that validates against the XHTML DTD. In practice
it's usually not a problem because most XSLT processors take the path of
least resistance.

Michael Kay

# -----Original Message-----
# From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-
# list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of James J. Ramsey
# Sent: 10 March 2004 22:23
# To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
# Subject: Re:  Trouble with namespaces and running identity transform
# on XHTML
# 
# 
# --- Kevin Jones <kjones@xxxxxxxxxxx> wrote:
# >
# > > Having an explicitly declared namespace attribute
# > in
# > > xsl:element works in xsltproc, Saxon, and Xalan,
# > but
# > > not Sablotron, which outputs
# > >
# > > <ns_1:html
# > xmlns:ns_1="http://www.w3.org/1999/xhtml">
# > > <ns_2:head
# > xmlns:ns_2="http://www.w3.org/1999/xhtml">
# > > --snip--
# > > </ns_2:head>
# > > </ns_1:html>
# > >
# >
# > On Sablotron you can get better output by including
# > a prefix in
# > the xsl:element name attribute. Like this,
# >
# > <xsl:element name="{concat('h:',local-name())}"
# > 	namespace="http://www.w3.org/1999/xhtml">
# > 	<xsl:apply-templates select="@*|node()" />
# > </xsl:element>
# 
# except in the output, that prefixes elements with
# "h:", which I do *not* want.
# 
# Anyway, what I'm not sure of is whether the XSLT spec
# guarantees that
# 
# <xsl:element name="NCName"> <!-- No prefix in NCName
# -->
#  <!-- Content of NCName . . . -->
# </xsl:element>
# 
# will result in an element with the unprefixed name
# NCName in the default namespace, or if it's just that
# XSLT processors happen to serialize that as "<NCName>
# . . . </NCName>".
# 
# 
# __________________________________
# Do you Yahoo!?
# Yahoo! Search - Find what youre looking for faster
# http://search.yahoo.com
# 
#  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.