• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Strange XSLt behaviour with Oracle'x xmlparserv2.jar

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Here is some XSL that I am using to transform some XML to HTML
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="paramA"/>
<xsl:param name="paramB"/>
<xsl:template match="stuff">
<a href="http://some.url/"
onclick="return otherurl('{$paramA}','{$paramB}');">
Click-to-follow-the-link
</a>
</xsl:template>
</xsl:stylesheet>
For parsing and transforming I'm using
Oracle's xdk (9.0.1.0.0) xmlparserv2.jar for Java.
So, what happens is that (non-validating) parsing
goes thru without errors and so does
the XSL processing... but the HTML
that is produced causes (at least in Linux Netscape 4.77)
JavaScript Error:... line 1:
syntax error.
otherurl('value-of-paramA&apos,'value-of-paramB')
.........^
So the problem is the handling of the apostrophes and quotes.
Curiosly enough if I change the onclick line in XSL to read:
onclick='return otherurl("{$paramA}","{$paramB}");'>
(so i change every occurane of " to ' and vice versa)
then everything works fine!!
Additionally this problem does not arise in the first place
when I am using oracles (xmlparser-2.0.2.10.0) xmlparserv2.jar
form the paring and XSL processing...
Any comments?! (solutions)
Cheers:
Jeo Pepp
reply
    Bookmark Topic Watch Topic
  • New Topic