Subject: Re: [xsl] xsl: help (urgent) From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx> Date: Tue, 10 Apr 2001 08:36:30 +0100 |
Hi Reghu, You have: > <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> As far as the XSLT processor is concerned the < 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] xsl: help (urgent), Reghu Krishna Pillai | Thread | Re: [xsl] xsl: help (urgent), Steve Muench |
Re: [xsl] Re:Confusion about preced, Jeni Tennison | Date | [xsl] Merging two documents, Martin Renner |
Month |