You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Derek Hohls <DH...@csir.co.za> on 2002/03/22 09:26:38 UTC

Where is tag coming from?

Hi

A very stupid -but frustrating - problem this:

I have an XSP generating an XML file and being transformed by XSL -
nothing new here.

When I look at the resultant HTML, tho', I see a line:
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
has been added below the <html> (that I  create).

No big deal?  But, whatever is doing this, is doing the same thing
to a javascript snippet that has:

        write('<html>');
        write('<head>');

in the XSL file, and causing it to become:

        write('<html>');
        write('<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">');
 
in the HTML thereby causing it fail because of the linewrap. 
 (yes, if you remove that line and test the saved
HTML page 'manually' it does work)

Why is this happening and, more important, how do I stop it adding
these <META> tags?

Thanks
Derek

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Where is tag coming from?

Posted by MJ Ray <ma...@cloaked.freeserve.co.uk>.
Derek Hohls wrote:
>         write('<html>');
>         write('<head>');
> in the XSL file, and causing it to become:

I think it's because cocoon sees the tags, not the context.  Rather, to
cocoon, the tags are the context and the rest is just so much content. 
Probably a good thing generally, but it's hurting you here.

Have you tried write('<'+'head>');?   Not sure if that will work as a quick
fix, or whether this mysterious <'+'head> tag will cause trouble.  You
probably want your Javascript in a different file anyway, though.

Hope that helps,
-- 
MJR ,----------------------------------------------------
    | Q. Do you need a net-based application developing, 
    |    or advice and training about web technology?
    | A. I suggest you try http://www.luminas.co.uk/

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Where is tag coming from?

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 22.Mar.2002 -- 10:26 AM, Derek Hohls wrote:
> No big deal?  But, whatever is doing this, is doing the same thing
> to a javascript snippet that has:
> 
>         write('<html>');
>         write('<head>');

On another note: since XML doesn't know about JS strings, what happens
here is 
	 <![#PCDATA[write(']]><html><![#PCDATA['); write('
and so on. But you want
	 <![#PCDATA[write('&lt;html&gt;'); write('
IOW you don't want to create nodes but text.

Thus you should replace "<" with "&lt;" and ">" with "&gt;" in all
your strings or java code.

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>