You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Dietrich Schulten <ib...@system-entwicklung.de> on 2001/06/08 11:38:35 UTC

getting rid of META tag in HTML output

Hi,

It turned out that JEditorPane stumbles upon the META tag that is 
generated by xalan-j 2.

While this might be a problem with my use of JEditorPane, can I get rid 
of the META tag at all?

I'm transforming to HTML using xalan-j 2 and receive a META tag

<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

Here's the beginning of my stylesheet:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:Clouseau= 
                  "http://www.system-entwicklung.de/catalog/clouseau"
                version="1.0"
                exclude-result-prefixes="Clouseau"
>
<xsl:output method="html" encoding="ISO-8859-1" 
omit-xml-declaration="yes" />

Without xsl:output I get a different META tag, IIRC with an UTF-8 
charset.

Greetings
Dietrich

---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Re: getting rid of META tag in HTML output

Posted by Dietrich Schulten <ib...@system-entwicklung.de>.
Hi Gary,

Gary L Peskin <ga...@firstech.com> schrieb:

> Could you please add this as an enhancement request to bugzilla if it's
> not there already and I'll have a look.

Thank you very much for your effort.

It turned out to be a shortcoming of JEditorPane, its setText() method 
doesn't handle META tags with charset settings at all, but always throws 
a ChangedCharSetException. One must
a) set the correct mime type and character set manually
b) switch on IgnoreCharsetDirective:
jEditorPane1.getDocument().putProperty("IgnoreCharsetDirective", 
Boolean.TRUE);

So I don't think we need an omit-meta directive in XSLT :-)

Dietrich



---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Re: getting rid of META tag in HTML output

Posted by Gary L Peskin <ga...@firstech.com>.
Dietrich --

Never mind about the enhancement request.  I've found a bug that's
already in there that I can add this on to (Bug 1310).

On the CVS version of xalan, you can now specify
xalan:omit-meta-tag="yes" on the xsl:output element and no meta tag will
be created.

Thanks,
Gary

Gary L Peskin wrote:
> 
> Hi, Dietrich --
> 
> I'd like to take this discussion over to the Xalan list since it is
> Xalan-related.
> 
> There is currently no way to omit the META tag from being generated.
> For now, you'll have to see why JEditorPane doesn't like it and possibly
> fool around with the charset encoding or something.  You might to fool
> around with some of the other xsl:output attributes as well.
> 
> I'd like to implement a xalan:omit-meta-tag attribute which would take a
> value of "yes" or something else.  If the value of the attribute is
> "yes", the meta tag would be omitted entirely.
> 
> Could you please add this as an enhancement request to bugzilla if it's
> not there already and I'll have a look.
> 
> Thanks,
> Gary
> 
> Dietrich Schulten wrote:
> >
> > Hi,
> >
> > It turned out that JEditorPane stumbles upon the META tag that is
> > generated by xalan-j 2.
> >
> > While this might be a problem with my use of JEditorPane, can I get rid
> > of the META tag at all?
> >
> > I'm transforming to HTML using xalan-j 2 and receive a META tag
> >
> > <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
> >
> > Here's the beginning of my stylesheet:
> >
> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >                 xmlns:Clouseau=
> >                   "http://www.system-entwicklung.de/catalog/clouseau"
> >                 version="1.0"
> >                 exclude-result-prefixes="Clouseau"
> > >
> > <xsl:output method="html" encoding="ISO-8859-1"
> > omit-xml-declaration="yes" />
> >
> > Without xsl:output I get a different META tag, IIRC with an UTF-8
> > charset.
> >
> > Greetings
> > Dietrich

Re: getting rid of META tag in HTML output

Posted by Gary L Peskin <ga...@firstech.com>.
Hi, Dietrich --

I'd like to take this discussion over to the Xalan list since it is
Xalan-related.

There is currently no way to omit the META tag from being generated. 
For now, you'll have to see why JEditorPane doesn't like it and possibly
fool around with the charset encoding or something.  You might to fool
around with some of the other xsl:output attributes as well.

I'd like to implement a xalan:omit-meta-tag attribute which would take a
value of "yes" or something else.  If the value of the attribute is
"yes", the meta tag would be omitted entirely.

Could you please add this as an enhancement request to bugzilla if it's
not there already and I'll have a look.

Thanks,
Gary

Dietrich Schulten wrote:
> 
> Hi,
> 
> It turned out that JEditorPane stumbles upon the META tag that is
> generated by xalan-j 2.
> 
> While this might be a problem with my use of JEditorPane, can I get rid
> of the META tag at all?
> 
> I'm transforming to HTML using xalan-j 2 and receive a META tag
> 
> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
> 
> Here's the beginning of my stylesheet:
> 
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>                 xmlns:Clouseau=
>                   "http://www.system-entwicklung.de/catalog/clouseau"
>                 version="1.0"
>                 exclude-result-prefixes="Clouseau"
> >
> <xsl:output method="html" encoding="ISO-8859-1"
> omit-xml-declaration="yes" />
> 
> Without xsl:output I get a different META tag, IIRC with an UTF-8
> charset.
> 
> Greetings
> Dietrich

Re: getting rid of META tag in HTML output

Posted by Gary L Peskin <ga...@firstech.com>.
Hi, Dietrich --

I'd like to take this discussion over to the Xalan list since it is
Xalan-related.

There is currently no way to omit the META tag from being generated. 
For now, you'll have to see why JEditorPane doesn't like it and possibly
fool around with the charset encoding or something.  You might to fool
around with some of the other xsl:output attributes as well.

I'd like to implement a xalan:omit-meta-tag attribute which would take a
value of "yes" or something else.  If the value of the attribute is
"yes", the meta tag would be omitted entirely.

Could you please add this as an enhancement request to bugzilla if it's
not there already and I'll have a look.

Thanks,
Gary

Dietrich Schulten wrote:
> 
> Hi,
> 
> It turned out that JEditorPane stumbles upon the META tag that is
> generated by xalan-j 2.
> 
> While this might be a problem with my use of JEditorPane, can I get rid
> of the META tag at all?
> 
> I'm transforming to HTML using xalan-j 2 and receive a META tag
> 
> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
> 
> Here's the beginning of my stylesheet:
> 
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>                 xmlns:Clouseau=
>                   "http://www.system-entwicklung.de/catalog/clouseau"
>                 version="1.0"
>                 exclude-result-prefixes="Clouseau"
> >
> <xsl:output method="html" encoding="ISO-8859-1"
> omit-xml-declaration="yes" />
> 
> Without xsl:output I get a different META tag, IIRC with an UTF-8
> charset.
> 
> Greetings
> Dietrich

---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org