Re: [xsl] rogue xmlns="" in output xhtml

Subject: Re: [xsl] rogue xmlns="" in output xhtml
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 13 Oct 2005 10:06:11 +0100
> I am currently using what was once called xslt 1.1, saxon 6.5.2 and my
> output is created using <xsl:document>, as in the pre-xslt 2.0 definition of
> that element.

I think that's probably a mistake. If you are using saxon  6 (as I do in
the day job, although I use saxon8 for most other stuff) I think it is
much better to stick with XSLT 1.0 (which is a published recommendation)
and use saxon:output to get multiple output documents. That way you are
explictly using an extension element to get extended features.


> I know that I should be migrating to xslt 2.0 soon,

Not necessarily, many people won;t migrate until it becomes a
recommendation, which will be some time next year I think as a current
best guess.

>  but I would prefer to
> avoid that for right now. Is there an easy solution using xslt 1.x tools? My
> last driver stylesheet started as follows:

There are not 1.x versions only 1.0 (1.1 was just a drfat suggestion that
wasn't taken further).


You are getting 
      <title xmlns="">PROJFULLNAME: Home</title>

because you have generated a title element in no-namespace and that is
the only way such an element can be serialised if its parent is in a
namespace. The solution is to generate title (and all other elements) in
the xhtml namespace, usually by putting xmlns="..." on xsl:stylesheet
so it is in scope for the whole stylesheet.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread