You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Yuh-Fwu Guu <yu...@csicontrols.com> on 2000/12/14 22:33:13 UTC
Re: META tag error -- Problem Solved
It was my fault, the servlet code set the content type to "text/xml" instead of "text/html". That's why the xml file was transformed to html file correctly via the correct xsl file, but the browser was told when receiving the response the content type is "text/xml".
Thanks a lot for all your help!!!
Guu
----- Original Message -----
From: Yuh-Fwu Guu
To: xalan-dev@xml.apache.org
Sent: Thursday, December 14, 2000 2:31 PM
Subject: Re: META tag error
Art,
The META tag is generated by xalan? How do I end it with "/>"?
and
Dimitry,
<xsl:output method="html" indent="yes"/> was included in the xsl file.
The xsl file is shown below: Anymore thoughts? Thanks.
===============================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="LoginPage">
<html>
<head>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="BrowserInfo">
<h1>BrowserInfo:</h1>
<h2>ContentPath:</h2>
<p><xsl:value-of select="ContentPath"/></p>
<h2>ContentType:</h2>
<p><xsl:value-of select="ContentType"/></p>
</xsl:template>
<xsl:template match="ServerInfo">
<h1>ServerInfo:</h1>
<h2>ServletPath:</h2>
<p><xsl:value-of select="ServletPath"/></p>
<h2>ServerName:</h2>
<p><xsl:value-of select="Server/ServerName"/></p>
<h2>ServerPort:<xsl:value-of select="Server/ServerPort"/></h2>
<p><xsl:value-of select="Server/ServerPort"/></p>
</xsl:template>
</xsl:stylesheet>
----- Original Message -----
From: Voytenko, Dimitry
To: 'xalan-dev@xml.apache.org'
Sent: Thursday, December 14, 2000 1:44 PM
Subject: RE: META tag error
Hi,
No, I think this is IE message. So servlet worked correctly. It means that response has <? xml ?> in the begining. And IE tries to show it as XML.
He just needs to specify xsl:output with method="html" to remove XML header from output.
-----Original Message-----
From: Art Welch [mailto:art_w@EASTPOINT.COM]
Sent: Thursday, December 14, 2000 11:25
To: 'xalan-dev@xml.apache.org'
Subject: RE: META tag error
Try ending the META tag with />.
[Art Welch] -----Original Message-----
From: Yuh-Fwu Guu [mailto:yuh-fwu_guu@csicontrols.com]
Sent: Thursday, December 14, 2000 1:44 PM
To: xalan-dev@xml.apache.org
Subject: META tag error
I am getting the error:
End tag "head" does not match the start tag "META". Line 3, Position 70
<META http-equiv="Content-Type" content="text/html; charset=UTF-8"></head>
---------------------------------------------------------------------^
using Internet Explorer 5.5 to invoke a servlet to transform an xml document to a html document using xalan. I cannot find what's wrong by looking at the file generated by xalan(as shown below). Can anyone please shed some lights on what I am doing wrong?
The error does not occur if I save the file to an html file and then open it with the browser.
Thanks.
===========================================================
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8"></head>
<body>
<h1>BrowserInfo:</h1>
<h2>ContentPath:</h2>
<p></p>
<h2>ContentType:</h2>
<p>null</p>
<h1>ServerInfo:</h1>
<h2>ServletPath:</h2>
<p>/servlet/LoginServlet</p>
<h2>ServerName:</h2>
<p>127.0.0.1</p>
<h2>ServerPort:80</h2>
<p>80</p>
</body>
</html>
Re: META tag error
Posted by Alessandro Marcellini <am...@tiscalinet.it>.
Hi,
I'm trying to use meta-tag in my html documents too.
I've some problem:
My search-engine is attribute-order sensitive:
the tag '<META name="AUTHOR" content="pippo"/>' is correct,
instead the tag '<META content="pippo" name="AUTHOR"/>' isn't correct.
Is there anyone that know how can I order the attributes
in an element but the alphabetical order?
In my stylesheet I write attributes in the correct order, but Xalan
changes them into alphabetical order.
How can I avoid this behaviour?
Thank's
Alessandro