Re: [xsl] Understanding xmlns declaration and encoding

Subject: Re: [xsl] Understanding xmlns declaration and encoding
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 8 Sep 2004 16:48:33 +0100
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  version="1.0" xmlns="http://www.w3.org/1999/xhtml";>

  This use to be written as:

  <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl";>


That change has nothing to do with encodings it is like changing from
FORTRAN to C. The first version is a declaration of a stylesheet written
in XSLT, the second is the declaration of a stylesheet for the almost
completely different language that was built into early versions of
msxml (and so IE5) but not supported in current Microsoft products, and
never supported anywhere else. Microsoft somewhat unhelpfully
document that language as being called "XSL" but it was based on a very
early draft of XSL(T) and only ever had a passing resemblance even to
that draft.

> Most of our code is pre XSLT1.0 

given that XSLT dates from 1999 and XML itself is only a year earlier,
one has to ask _why_ one would still have code written to that non
standard Microsoft dialect?

> removed all of the above fixes and narrowed it down to to the new
> namespace decleration: xmlns="http://www.w3.org/1999/xhtml";.

If you are outputting html the html output method will automatically add
a meta element to the result, however if you are outputting xhtml using
the xml output method (which would be the default)  then no meta element
is automatically added.

Note that also the final encoding depends on the way you call msxml if
you are writing directly to a file from msxsl the declarations regarding
encoding in xsl:output will take effect but if you just output the
result as an in memory dom and then later serialise that dom, it will be
the dom that controls such issues as encoding chosen, not the xsl:output
statement.

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