You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Erik Dasque <ed...@silverstream.com> on 2000/02/24 19:45:56 UTC
non escaped HTML with
I have a SQL database that can contain among other things embedded html. The html is entered by end users such that when a page is displayed they can control their own links. Unfortunately I have no direct control over the data creation. I need to be able to pull the data in XML format and using XSL transform it to HTML. The problem I have is that the output becomes <, >, etc. Here is some detail:
<Document>
<Author>Bob</Author>
<HTMLBody>this is a <a href="www.xml.org">pointer</a> to a great site.</HTMLBody>
</Document>
<xsl:template match="HTMLBody">
<xsl:value-of/>
</xsl:template>
The output is "this is a <a href="www.xml.org">pointer</a> to a great site.
The anchor tag is actually displayed in the browser. I have tried the CDATA tag as well as preprocessing the data to convert from "<" to < but I can't get the correct result
Thanks a lot.
Ed.
Re: non escaped HTML with
Posted by Erik Dasque <ed...@silverstream.com>.
Are you talking about SQLProcessor from Cocoon ? My HTML BODY element is
actually XHTML (using Tidy)
My XML is :
<?xml version="1.0" standalone="yes"?>
<DOCUMENT DOC_ID="3" DateCreated="02/08/2000 00:00"
MimeType="text/plain" Version="1">
<Author AUTHOR_ID="1">
<FirstName>John</FirstName>
<LastName>Archer</LastName>
<EMail>jarcher@silverstream.com</EMail>
<Title>Technical Marketing Manager</Title>
</Author>
<BODY><![CDATA[When dealing with remote objects, such as Enterprise
JavaBeans (EJB), some of the biggest performance problems can be traced to
network traffic. A method call that has to be marshaled over a socket
connection is going to be much slower than a method call issued in local
memory. The following piece of client code, which assumes that
<code>bean</code> is a handle to an EJB, makes <em>six</em> remote calls
(remember, red here stands for client code):]]></BODY>
<TITLE>This is the title of the test doc</TITLE>
</DOCUMENT>
but the XSL engine still escapes it. The text displayed is actually ... The
following piece of client code, which assumes that
<code>bean</code> is a handle to an EJB, makes
<em>six</em> remote calls
(remember, red here stands for client code):...
TIA
Ed.
Ed.
----- Original Message -----
From: "Donald Ball" <ba...@webslingerZ.com>
To: <xa...@xml.apache.org>
Sent: Thursday, February 24, 2000 2:45 PM
Subject: Re: non escaped HTML with
> On Thu, 24 Feb 2000, Erik Dasque wrote:
>
> > I have a SQL database that can contain among other things embedded html.
The html is entered by end users such that when a page is displayed they can
control their own links. Unfortunately I have no direct control over the
data creation. I need to be able to pull the data in XML format and using
XSL transform it to HTML. The problem I have is that the output becomes <,
>, etc. Here is some detail:
> >
> > <Document>
> > <Author>Bob</Author>
> > <HTMLBody>this is a <a href="www.xml.org">pointer</a> to a great
site.</HTMLBody>
> > </Document>
> >
> > <xsl:template match="HTMLBody">
> > <xsl:value-of/>
> > </xsl:template>
> > The output is "this is a <a href="www.xml.org">pointer</a> to a great
> > site.
> > The anchor tag is actually displayed in the browser. I have tried the
> > CDATA tag as well as preprocessing the data to convert from "<" to
> > < but I can't get the correct result
>
> I have just recently discovered a good solution to this problem. I had
> come up with a workaround that let me signal certain columns as containing
> XML data, putting a dummy wrapper around them, and asking xerces to parse
> the document for me and add it to the SQL result tree, but it wasn't a
> complete solution since XML != HTML and most of my existing HTML fragments
> have <br>s and <img>s and such. I had wanted to use OpenXML's HTML parser
> but it seems to have not made it to xerces yet and openxml's docs are
> quite out of date. However, I recently ran across JTidy and my life became
> complete. I will be adding HTML parsing functionality to the SQL taglib
> sometime soonish. If you need this functionality before then, feel free to
> add it yourself and send in a patch.
>
> - donald
>
Re: non escaped HTML with
Posted by Assaf Arkin <ar...@exoffice.com>.
Pierpaolo Fumagalli wrote:
>
> Donald Ball wrote:
> >
> > [...] I had wanted to use OpenXML's HTML parser but it seems to have
> > not made it to xerces yet and openxml's docs are quite out of date.
>
> I believe the plan was to have it under xml.apache.org.... Any updates
> on that Assaf????
Time. I need time. Can someone find me time?
arkin
>
> Pier
>
> --
> --------------------------------------------------------------------
> - P I E R -
> stable structure erected over water to allow the docking of seacraft
> <ma...@betaversion.org> <http://www.betaversion.org/~pier/>
> --------------------------------------------------------------------
> - ApacheCON Y2K: Come to the official Apache developers conference -
> -------------------- <http://www.apachecon.com> --------------------
--
----------------------------------------------------------------------
Assaf Arkin www.exoffice.com
CTO, Exoffice Technologies, Inc. www.exolab.org
Re: non escaped HTML with
Posted by Pierpaolo Fumagalli <pi...@apache.org>.
Donald Ball wrote:
>
> [...] I had wanted to use OpenXML's HTML parser but it seems to have
> not made it to xerces yet and openxml's docs are quite out of date.
I believe the plan was to have it under xml.apache.org.... Any updates
on that Assaf????
Pier
--
--------------------------------------------------------------------
- P I E R -
stable structure erected over water to allow the docking of seacraft
<ma...@betaversion.org> <http://www.betaversion.org/~pier/>
--------------------------------------------------------------------
- ApacheCON Y2K: Come to the official Apache developers conference -
-------------------- <http://www.apachecon.com> --------------------
Re: non escaped HTML with
Posted by Donald Ball <ba...@webslingerZ.com>.
On Thu, 24 Feb 2000, Erik Dasque wrote:
> I have a SQL database that can contain among other things embedded html. The html is entered by end users such that when a page is displayed they can control their own links. Unfortunately I have no direct control over the data creation. I need to be able to pull the data in XML format and using XSL transform it to HTML. The problem I have is that the output becomes <, >, etc. Here is some detail:
>
> <Document>
> <Author>Bob</Author>
> <HTMLBody>this is a <a href="www.xml.org">pointer</a> to a great site.</HTMLBody>
> </Document>
>
> <xsl:template match="HTMLBody">
> <xsl:value-of/>
> </xsl:template>
> The output is "this is a <a href="www.xml.org">pointer</a> to a great
> site.
> The anchor tag is actually displayed in the browser. I have tried the
> CDATA tag as well as preprocessing the data to convert from "<" to
> < but I can't get the correct result
I have just recently discovered a good solution to this problem. I had
come up with a workaround that let me signal certain columns as containing
XML data, putting a dummy wrapper around them, and asking xerces to parse
the document for me and add it to the SQL result tree, but it wasn't a
complete solution since XML != HTML and most of my existing HTML fragments
have <br>s and <img>s and such. I had wanted to use OpenXML's HTML parser
but it seems to have not made it to xerces yet and openxml's docs are
quite out of date. However, I recently ran across JTidy and my life became
complete. I will be adding HTML parsing functionality to the SQL taglib
sometime soonish. If you need this functionality before then, feel free to
add it yourself and send in a patch.
- donald