xsl-list
[Top] [All Lists]

Re: Understanding xmlns declaration and encoding

2004-09-08 11:04:37
Hello, I am now transforming the stylesheet using new MSXML2 objects,
including an ixslProcessor and ixslTemplate and invoking to processor with
the Transform method and writing straight to the browser using the
iXslProcessor output method.
The resulting HTML (at the top) looks like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html">

When I exclude this
xmlns="http://www.w3.org/1999/xhtml";

from the stylesheet decleration, I notice that <br/> tags and <hr/> tags
end up like this: <br> and <hr>.  Including it results in the <html> tag
looking like this:
<HTML xmlns="http://www.w3.org/1999/xhtml";>

and the <br> and <hr> tags are now <br/> and <hr/> in the result.

Is this all confirmed and normal behaviour?

I guess I don't understand when:
<xsl:output method="html" encoding="??????????"/>
The encoding has any effect on the outcome.

I am writing my html to the browser after the ixslProcessor tranformation
using the iXslProcessor output method like this:

response.write xslProcObj.output

I am having trouble reproducing my UTF-16 issue with the new MSXML
objects.  I'd like to control the output to reproduce the error...

Karl


  <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
________________________________________________________________________

--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--





<Prev in Thread] Current Thread [Next in Thread>