Luca,
the result of your example is:
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
</head>
<body>
<p>
value-of with escaping<br>
well-formed Apache html
</p>
<p>
value-of without escaping<br>
well-formed Apache html
</p>
<p>
copy-of<br>
well-formed <a href="http://www.apache.org">Apache</a> html
<br></p>
</body>
</html>
which I guess is what you expected :-))
The key is that, I suppose, <esql:get-columns/> automatically escapes any
markup it encounters in any field, which I checked with
<URL>?cocoon-view=content .
Sample such output is:
<esercizi lesson="A101">
<bar id="g">
</bar>
<esercizio><id_esercizio>1</id_esercizio><lezione>A101</lezione><ordine>1</o
rdine><categoria>grammatica</categoria><descrizione>Scegli le forme dei
verbi essere e avere</descrizione><durata>10 - 15
min.</durata><corpo><form name="esercizi">
<table width="100%" border="0" cellspacing="2"
cellpadding="0">
<tr>
<td width="31"><img src="_img/trasp.gif" width="31"
height="8"></td>
<td width="7">&nbsp;</td>
<td>&nbsp;</td>
</tr>
[...]
That's why one needs to escape output. And I guess that <esql:get-xml/>
would not work with non valid markup.
L.
-----Messaggio originale-----
Da: Luca Morandini [mailto:[EMAIL PROTECTED]]
Inviato: gioved� 3 ottobre 2002 19.24
A: [EMAIL PROTECTED]
Oggetto: RE: R: embedding html in xml ?
Jessica & Lorenzo,
I'd like conducting a little experiment....
let's suppose we have an XML like this:
<?xml version="1.0"?>
<page>
<parameter>
well-formed <a href="http://www.apache.org">Apache</a> html
<br/>
</parameter>
</page>
...and an XSL like this:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="page">
<html>
<head/>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="parameter">
<p>
value-of with escaping<br/>
<xsl:value-of select="."
disable-output-escaping="yes"/>
</p>
<p>
value-of without escaping<br/>
<xsl:value-of select="."
disable-output-escaping="no"/>
</p>
<p>
copy-of<br/>
<xsl:copy-of select="./node()"/>
</p>
</xsl:template>
</xsl:stylesheet>
..and a simple sitemap like:
<map:match pattern="test.html">
<map:generate src="test.xml"/>
<map:transform src="test.xsl"/>
<map:serialize type="html"/>
</map:match>
...the result is that only "copy-of" respects the "tagging" of the HTML
fragment.
Since I believe your method, somehow, works, could you please send me an
example of the output of the generation step (i.e. what
your XSP page retrieves from the database) ?
Best regards,
---------------------------------------------
Luca Morandini
GIS Consultant
[EMAIL PROTECTED]
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------
> -----Original Message-----
> From: Jessica Niewint [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 03, 2002 5:10 PM
> To: [EMAIL PROTECTED]
> Subject: Re: R: embedding html in xml ?
>
>
> At 16.21 03/10/2002 +0200, you wrote:
> >Luca,
> >
> >I'm sure you're right with the specification. I was just sharing a humble
> >real life example.
> >
> >I actually have an XSP containing <esql:get-columns/>. One of the columns
> >contains HTML (which BTW most of the times isn't even well-formed at all
> >:-)), as I guessed in Jessica's case.
>
>
>
> Yes :-))
>
>
> >If I don't put any disable-output-escaping="yes" I get the whole markup
> >escaped and visible to the user. That's why I disable it, and get a nice
> >page fragment as designed by who put the HTML in the DB. This works to
me,
> >even if sincerely I don't know why :-))
> >
> Works also for me !!!! (and I also have no idea why 8-)))))
>
>
>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>