[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsl: help (urgent)

Subject: Re: xsl: help (urgent)
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Tue, 10 Apr 2001 08:36:30 +0100
xsl help download
Hi Reghu,

You have:

> <DESCRIPTION>Search and download the &#60;a
> href=\"http://openworld.oracle.com/oowdba-wwwprd-
> apps/plsql/oow_user.show_public?p_event=3&#38;p_type=search\">Oracle
> OpenWorld 2000 technical papers and presentations&#60;/a>, over 250
> papers and presentations in total from Oracle and partner companies.
> </DESCRIPTION>

As far as the XSLT processor is concerned the &#60; is just a
less-than sign - it doesn't mean anything special at all.  The text
within the DESCRIPTION element is just text.  It doesn't know that you
mean it to be HTML.

The best thing that you can do is to have the DESCRIPTION element hold
HTML rather than a string.  So make it look like:

<DESCRIPTION>
   Search and download the <a
   href="http://openworld.oracle.com/oowdba-wwwprd-apps/plsql/oow_user.show_public?p_event="3&p_type=search">Oracle
   OpenWorld 2000 technical papers and presentations</a>, over 250
   papers and presentations in total from Oracle and partner
   companies.
</DESCRIPTION>

If the HTML that you want to have in your HTML output is held *as
HTML* then you can just copy it into the output with:

  <xsl:copy-of select="DESCRIPTION/node()" />

I don't know whether it's going to be possible for you to do that - it
looks as though the XML that you have is something that's
automatically generated from a database, so perhaps you have no choice
in the matter.

In that case the XSLT that you have is correct - you're using
disable-output-escaping in the right way, and with Saxon I get:

<FONT size="2">Search and download the <a
href=\"http://openworld.oracle.com/oowdba-wwwprd-apps/plsql/oow_user.show_pu
blic?p_event=3&p_type=search\">Oracle OpenWorld 2000 technical papers
and presentations</a>, over 250 papers and presentations in total from
Oracle and partner companies.</FONT>

Note that there's still a problem there with the double quotes ("s)
being 'escaped' or something with a backslash - if you went down this
route you'd need to do some string processing on the value of the
DESCRIPTION element to replace all the occurrences of \" with "
instead.

Also note that you don't need to use disable-output-escaping with
values that don't hold HTML/XML strings, and in fact it's dangerous to
do so because you might introduce characters that mess up the HTML/XML
in the output.  For example, you should use:

   <xsl:value-of select="ENTRY_DATE"/>

However, it looks as though whatever processor you're using *doesn't*
support disable-output-escaping. So given that, the only option in
XSLT would be to write a 'little' HTML parser to create the elements
for you. Trust me - you don't want to do that. A solution that
addresses the problem outside XSLT will be both faster and easier to
implement.  So your Java application that fixes the problem looks like
the best solution.

Sorry not to be more help,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.