xsl-list
[Top] [All Lists]

Re: [xsl] Why namespace-alias result prefix is the alias

2011-03-18 04:07:37
On 18/03/2011 08:38, Karl Stubsjoen wrote:
I'm doing an identity translate on a stylesheet and I am inserting
some extra stylesheet calls at different locations through the
stylesheet.

> So, I have an alias namespace setup, "rxsl", and I have a
namespace-alias setup to translate rxsl to xsl.

The way to think of it is not that, but rather you have an alias set up to alias the namespace http://example.com/foo to http://example.org/bar

but the stylesheet uses the prefix you specify.

Whats the problem?  The resulting translated xslt has the "rxsl"
prefix but properly namespaced to
"http://www.w3.org/1999/XSL/Transform";.  So not really a problem, but
why this behavior?

XSLT1 was very vague as to which prefix would be used in the result (with the result that some processors used one and some the other) in fact xslt 1 always gave a processor licence to use any prefix for any namespace, irrespective of aliasing.

As you note most of the time, this is just cosmetic, but if the result uses namespaces in context, such as xpath expressions then it does matter as the namespace URI and prefixes in element names, but prefixes in attribute values dont.

So xpath2 specified it the way you see.

It's better that way as it makes (say) literal result elements containing xpath or xsd types to look more natural as they all use the given prefixes.


Thanks,
Karl..


David



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>