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

Re: Generating XSLT

Subject: Re: Generating XSLT
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 15 Nov 2004 20:45:41 -0500
prefixes uses
At 2004-11-15 16:46 +0100, Geert Josten wrote:
<xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>

See, now that is just *clever*, that makes it a lot easier. :-)

It sure is, but still quite silly that only the namespace is renamed and not the prefixes as well. In other words, just renaming the prefixes _instead_ of the namespaces would have been nicer...

It has been tried and failed.

If you don't preserve the prefix then when you use the target prefix in an attribute value (and the processor doesn't know which attribute values are qnames that require namespace prefix transliteration), then you end up with a disconnect. Your emitted stylesheet includes namespace prefix uses without a resolved namespace URI.

"In the early days" (tomorrow is the 5th anniversary of XSLT/XPath 1.0!) there were processors that emitted arbitrary namespace prefixes in the result tree and my stylesheets for writing stylesheets didn't work.

Yes, I know the spec doesn't oblige the processor to use the authored prefix, but I cannot see any other way. Even if you hardwire the processor to recognize output XSLT and transliterate only the namespace prefixes found in there in context (awkward at best), that disenfranchises other existing and future vocabularies that will need to have the output namespace bound for attribute value usage.

If the processor uses an arbitrary namespace prefix, it will never know which values in the result tree are QNames.

But if the processor uses the authored namespace prefix, then the author of the stylesheet has an assurance that the use of QNames arbitrarily in the result will have bound prefixes.

I hope this helps.

............................ Ken

-- World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal

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.