[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: "James J. Ramsey" <jjramsey_6x9eq42@xxxxxxxxx>
Date: Thu, 11 Mar 2004 09:14:38 -0800 (PST)
james trans spec
--- Michael Kay <mhk@xxxxxxxxx> wrote:
> 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.

My reading of the XSLT 2.0 spec, or more to the point
the XSLT 2.0 and XQuery 1.0 Serialization spec, is a
bit more strongly worded than that. The XHTML output
method is supposed to "output namespace declarations
in a way that is consistent with the requirements of
the XHTML DTD if this is possible."

> 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.

So, if I'm looking at XSLT tools rather than some
flavor of macros or Perl scripts (which are starting
to look pretty good right now), my choices are

* write an XSLT 1.0 stylesheet so that when it is
processed by an XSLT 1.0 processor, the serializer
will never find adding namespace prefixes to be the
path of least resistance. That seems to mean avoiding
declaring a prefix for the XHTML namespace in the XSL
stylesheet, and avoiding using the "namespace"
attribute of xsl:element.

* Use an XSLT processor that implements the
almost-ready-for-primetime spec for XSLT 2.0. The main
downsides to this are that the XSLT 2.0 spec is still
in flux and that, AFAIK, there is only one stable XSLT
processor that implements the XSLT 2.0 spec, namely
Saxon. At least one upside is that I shouldn't need a
separate filter (like HTML Tidy) to add whitespace
before the "/>" in the tags for empty elements.

Do you Yahoo!?
Yahoo! Search - Find what you?re looking for faster

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

Current Thread


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.
First Name
Last Name
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.