You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Paul Warner <pa...@yahoo.com> on 2003/03/04 23:38:25 UTC

Added META tag breaks Mozilla

Hello,

I get this error when running a simple transform in a
servlet:

XML Parsing Error: mismatched tag. Expected: </META>.
Location:
http://localhost:8080/diaries/servlet/ParseDiaries
Line Number 18, Column 3:
</HEAD>
--^

Xalan is adding a META tag without adding a close -
and it's refusing to display in Mozilla.  I tried
inserting a </META> close in the xsl stylesheet, but
that bombs of course.  How can I suppress that META
tag?  Or force it to add the </META>?  Interestingly,
if I add my own meta tag with it's own close tag,
Xalan will remove my </META> close tag then add it's
own META tag (without close) just ahead of mine. 
Which leaves two identical META tags, neither with
close tags, and this of course generates the same
error.

I looked for information on this in the archives and
in Google, and I can see it's part of the spec to add
this tag - but no one says how to suppress it or force
it to be a complete tag with a close.

Thanks for any help.

Paul Warner

Re: Added META tag breaks Mozilla

Posted by David N Bertoni/Cambridge/IBM <da...@us.ibm.com>.



If you're generating HTML, the XSLT recommendation requires Xalan to add
the appropriate META element:

   http://www.w3.org/TR/xslt#section-HTML-Output-Method

In HTML, the META element is not closed, so Xalan's behavior is correct:

   http://www.w3.org/TR/REC-html40/struct/global.html#h-7.4.4.2

You need to decide whether you want XML or HTML.  If it's HTML, Xalan will
add a META tag.  If not, it won't.  If you want to omit the META tag (not
recommended,), see the following:

   http://xml.apache.org/xalan-j/usagepatterns.html#outputprops

Your servlet may also need to send the correct HTTP header so Mozilla knows
the stream is HTML and not XML.

Dave



                                                                                                                                               
                      Paul Warner                                                                                                              
                      <paulwwarner@yah         To:      xalan-j-users@xml.apache.org                                                           
                      oo.com>                  cc:      (bcc: David N Bertoni/Cambridge/IBM)                                                   
                                               Subject: Added META tag breaks Mozilla                                                          
                      03/04/2003 02:38                                                                                                         
                      PM                                                                                                                       
                                                                                                                                               



Hello,

I get this error when running a simple transform in a
servlet:

XML Parsing Error: mismatched tag. Expected: </META>.
Location:
http://localhost:8080/diaries/servlet/ParseDiaries
Line Number 18, Column 3:
</HEAD>
--^

Xalan is adding a META tag without adding a close -
and it's refusing to display in Mozilla.  I tried
inserting a </META> close in the xsl stylesheet, but
that bombs of course.  How can I suppress that META
tag?  Or force it to add the </META>?  Interestingly,
if I add my own meta tag with it's own close tag,
Xalan will remove my </META> close tag then add it's
own META tag (without close) just ahead of mine.
Which leaves two identical META tags, neither with
close tags, and this of course generates the same
error.

I looked for information on this in the archives and
in Google, and I can see it's part of the spec to add
this tag - but no one says how to suppress it or force
it to be a complete tag with a close.

Thanks for any help.

Paul Warner