This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Extra xmlns=""



> And here's the output I'm getting using MSXML.  I get the same thing in XT,
> but not in Xalan-C or Xalan-J.

As Mike commented, two of those systems are getting this wrong.
Unfortunately you haven't shown enough of the stylesheet to determine
which. (just need to see the xsl:stylesheet start tag)

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

so here <html is in the XHTML namespace as are all unprefixed elements
_in that template_.

so the output should be <html in the XHTML namespace

<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml";>

so far, so good.


<xsl:template match="keywordset">
 <h2>


here h2 is in the default namespace in force at that point in the
stylesheet.

If you haven't got an xmlns= on your xsl:stylesheet then this is no
namespace at all and so you are specifying that you want to generate
an h2 in no namespace. Given that 
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml";>
has already been output, the only way to serialise this is to output
<h2 xmlns="">
and msxsl and xt would be right.

If on the other hand you have xmlns="http://www.w3.org/1999/xhtml"; on
any ancestor of that <h2> in the styleshhet (which can only be the
xsl:stylesheet element, as you've shown the rest) then th eh2 is in the
XHTML namespace, so it should be output as
<h2> and MSXML and XT would be wrong.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]