Isidoro Russo

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromIsidoro Russo
ToMe
SubjectThanks for ImportXML :) and a question
Date19 May 2005 10:42
Hi,
my name's Isidoro Russo, i'm from Italy. I work for Opera Software as 
translator so, a couple of weeks ago, i decided to create a site with the 
latest news about the translation and the browser in general.
I ran into problem when i tried to load an external XML file into the  page.
Opera doesn't support XSLT and my hosting provider doesn't let me  use any
server-side programming. I went for XMLHttpRequest then. After a  long and
unsuccessful search i found your script and...wow! it works like  a charm!!!
So, THANK U VERY MUCH!!!

My site's address is: [URL]
The page is best viewed with Opera 7.6+ but works in IE too (with some 
minor glitches due to buggy CSS handling).

I've still some problems in Mozilla/Firefox though, but not related to  your
script. My XML files contain a field, named <description>, in which i  put
some XHTML inside a <![CDATA[...]]> tag. Mozilla/Firefox's XML parser 
doesn't like it so the two browsers don't render the field at all.
I've googled around but found no solution, i DO need xhtml inside 
<description> 'cos this field contain a lot of links and text formatting. 
Do u know any workaround?
Thanks a lot in any case :)

bye bye,
Isidoro Russo

PS: i've followed your scripts' terms of use while creating the site: i've 
left your comment untouched and i'll put a link to your site in my links 
page as soon as i'll have one. :)

Thanks again, bye.
FromMe
ToIsidoro Russo
SubjectRe: Thanks for ImportXML :) and a question
Date19 May 2005 22:41
Attachmentsample script showing the browser differences
Isidoro,

> I work for Opera Software as translator

hey, cool :) people like you do a fantastic job for us, much appreciated.

> i  put some XHTML inside a <![CDATA[...]]> tag. Mozilla/Firefox's XML
> parser doesn't like it so the two browsers don't render the field at all.

Ok, I did a little research. Mozilla/Firefox does interpret CDATA blocks in
XML, but with a minor difference to the others. It views them as a separate
node:
<description>foo<![CDATA[ bar ]]></description>
Opera and IE will have one child node of the description element:
"foo bar "
Mozilla/Firefox will have two child nodes:
"foo" " bar "
Firstly, make sure you are not running into this problem. Note that in Opera
and Mozilla/Firefox, whitespace constitutes a node, whereas in IE, it does
not. So if 'foo' was replaced with empty space, Mozilla would still see two
nodes, and IE/Opera would see one.

I have attached simplified sample files demonstrating this.

If all else fails ...
XML may contain the same entities as HTML, so if needed, you can convert all
XML-unsafe characters into their HTML entity equivalents, and remove the
CDATA declaration. These two are equivalent:
<description><![CDATA[<p>&nbsp;</p>]]></description>
<description>&lt;p&gt;hello&amp;nbsp;world&lt;/p&gt;</description>

It's a bit more complicated because you need to convert everything into
entities (PHP offers the htmlentities or htmlspecialchars functions for this
purpose), but it is reliable.

Hope this helps you solve the problem.

Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromIsidoro Russo
ToMe
SubjectThanks for ImportXML :) and a question
Date20 May 2005 23:42
> hey, cool  :)  people like you do a fantastic job for us, much
appreciated.

Thanks  And smart people like you do an awesome job for us modest
webmasters!

> Ok, I did a little research. Mozilla/Firefox does interpret CDATA blocks
> in XML, but with a minor difference to the others. It views them as a
> separate node

GREAT!!! U saved my day! In all my googling i wasn't able to find anything
so useful: i made a little change in my code and now i works in IE, Opera
and FF :)
THANK YOU VERY MUCH!

> I have attached simplified sample files demonstrating this.

Sorry, i found no attachment in this mail :( but your information was 
VITAL:
I thought that FF completely ignored CDATA fields.

> If all else fails ...
> XML may contain the same entities as HTML, so if needed, you can convert
> all XML-unsafe characters into their HTML entity equivalents, and remove
> the CDATA declaration.

Ehehe, you should see my CDATA fields then! They're full of tags: conversion
is almost impossible!

Thank U again mate, your help was essential (and so were your scripts) :) .
Ask me whatever u want, i'll try to do my best to repay the favor.

Bye bye,
Isidoro

PS: I'm restyling my page (i think it'll be online in a few days). I'll put
a link to your site in the new page.
FromMe
ToIsidoro Russo
SubjectNew Opera News design!
Date24 May 2005 12:04
Hi,
a new version of my site is online. It works on firefox too (I must thank  u
for this!).

Check it on:
[url]

Thanks again,
Bye bye

Isidoro

PS: a link to your page is available on "Link  Utili"->"Collaboratori"->"How
to create"
there's also a little note about you on the lower right column :)

PS2: i didn't publish your email for privacy reason.
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.