Re: [xsl] Beginner: adding xmlns:mml attribute

Subject: Re: [xsl] Beginner: adding xmlns:mml attribute
From: Daniel Veillard <daniel@xxxxxxxxxxxx>
Date: Thu, 9 Jan 2003 14:10:52 +0100
On Thu, Jan 09, 2003 at 09:57:27AM +0000, Jeni Tennison wrote:
> Hi Roel,
> 
> >> What the stylesheet gives me, with Saxon 6.5.2, from an input document
> >> with an empty <document> element, is:
> >
> > Right, this is what seems to be causing problems: the processor. I was 
> > using xsltproc, and it didn't give me the xmlns part in the html tag. 
> > Saxon does. Which one is right? Can they both be right? Should I notify 
> > anyone of a bug?
> 
> Saxon is right (it usually is). You should notify Daniel Veillard of
> the bug in xsltproc.

  Fixed in CVS.
This was specific to the HTML serialization.

  BTW about Saxon serialization, "UTF-8" is the proper identification string
for the encoding defined in RFC 2044, not "utf-8" .
  http://www.ietf.org/rfc/rfc2044.txt

  all instances of that string are defined with capital letters in the
spec defining it.
  I'm also surprized that Saxon indents HTML output by default in the
absence of an xsl:output directive asking for such a transformation.
Or maybe Jeni indented it for readability in her mail.

> > Anyway, another difference between Saxon & xsltproc now shows up: if
> > I put inside the <head></head> tags of my xsl sheet
> >
> > <![CDATA[ <?import namespace="mml" implementation="#MathPlayer" ?> ]]>
> >
> > and I process it with xsltproc, I get
> >
> > <?import namespace="mml" implementation="#MathPlayer" ?>

  I cannot reproduce this with my current version of xsltproc

paphio:~/tmp -> cat tst.xsl
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:m="http://www.w3.org/1998/Math/MathML";>
   <xsl:template match="/">
     <html>
       <head>
       <![CDATA[ <?import namespace="mml" implementation="#MathPlayer" ?> ]]>
       </head>
     </html>
   </xsl:template>
</xsl:stylesheet>
paphio:~/tmp -> xsltproc tst.xsl tst.xsl
<html xmlns:m="http://www.w3.org/1998/Math/MathML";><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> &lt;?import
namespace=&quot;mml&quot; implementation=&quot;#MathPlayer&quot; ?&gt; </head></html>
paphio:~/tmp ->

  Last point is that when using the HTML output method, using 
xsl:processing-instruction is NOT equivalent to what Roel Vanhout 
was specifying, the spec says that the HTML serialization should
terminate PI with '>' and not '?>' as the CDATA section suggested.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@xxxxxxxxxx  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

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


Current Thread