Re: [xsl] namespace - don't like to like the like

Subject: Re: [xsl] namespace - don't like to like the like
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 25 Sep 2003 16:09:20 +0100
> Have I missed the obvious and nobody wants to post an answer or else?
If you put a namespace in the stylesheet it should appear in the result.
Which XSLT system are you using?
although you are probably using teh default html output, in which case
the behaviour of namepsaces is rather underspecified in XSLT 1.

In any case, as you are producing xhtml you need to tell xslt not to use
the html output method so add
<xsl:output method="xml"/>
If the namespace still doesn't appear in the result, something is wrong
somewhere... 

Note, you probably don't want to do this:

<xsl:tylesheet ...>
      <xsl:template match="/">
            <html lang="en" xmlns="http://www.w3.org/1999/xhtml";>
               .....

as that will just put that html element in the xhtml namespace.

If you are generating xhtml you probably want all output elements to be
in that namespace so instead do

<xsl:tylesheet ... xmlns="http://www.w3.org/1999/xhtml";>
      <xsl:template match="/">
            <html lang="en">
               .....
David


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. 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
________________________________________________________________________

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


Current Thread