RE: [xsl] namespace prefix weirdness

Subject: RE: [xsl] namespace prefix weirdness
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 18 Aug 2004 13:35:19 +0100
> > In fact if Saxon delayed the decision to generate the xmlns="" 
> > undeclaration
> > until after namespace fixup, it could reassign the default ("") 
> > prefix, and
> > generate a more pleasing output tree. But it doesn't.
> 
> So is this purely an aesthetic issue?  It has no effect on subsequent 
> processing?
> 

The choice of namespace prefixes, unfortunately, is not completely
arbitrary, (a) because you might be using constructs that use namespace
prefixes in element or attribute content, and (b) because you might require
that the result document is valid against a DTD that disallows the presence
of certain xmlns:xxx attributes. But the XSLT specification essentially
mandates a minimum set of prefixes that must be declared in the result tree,
while leaving the XSLT processor free to declare additional prefixes if it
needs to. This is what Saxon has done in this case.

Michael Kay

Current Thread