Alex Khost

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromAlex Khost
ToMe
SubjectJavaScript XML Parsing
Date14 June 2004 16:16
Hello,
I have been using JavaScript as a client-side XML
parser but have run into Macintosh issues (and came
across your site in a Google search). Strangely
enough, after trying your suggestion of adding a blank
style sheet to the XML page, my ie browser now crashes
when attempting to load the XML page (Mac OS 10.2.3).
Here's a copy of the XML on a server:
http://xxxxx.xxxx.xxx/xxxxxx/xxxxxx/js_xml_example.xml
(basically, a cut and paste of the PPK example, with
your stylesheet added).

Also, have you had any luck on the Safari browser (in
your jslibs notes, you seem to say that it works in
Konqueror/Safari, but I've had no luck getting it to
work on my end...)

Many thanks in advance for any thoughts-- and thank
you for the useful information on your site!!

Alex Khost
FromMe
ToAlex Khost
SubjectRe: JavaScript XML Parsing
Date15 June 2004 8:59
Alex,

If you are using PPKs script as well as his XML, it is not surprising that
you cannot get it to work in Safari, since PPK's script does not work in
Safari, and it also does not work in IE Mac, since IE mac has a broken
implementation of the ActiveXObject.

IE on Mac OS X is well known to crash whenever it encounters something it
doesn't like (see PPK's notes:
http://www.quirksmode.org/browsers/explorer5mac.html ). My copy of IE does
not crash on either my script or PPK's - IE 5.2 on OS X 10.3 - however, as
expected, it does not work with PPK's script, but it does work with my
script.

My code is specifically designed to work in IE Mac, Safari and Opera, as
well as Mozilla (Netscape6+) and IE Windows. (It does not work in Konqueror)

I just tested in Safari 1.2 (OS X 10.3), and sure enough, my code works
(although for some unknown reason, it did not work the first time I tried
it - probably because it did not load the stylesheet fast enough - maybe
increasing the interval delay in my script would help). However, it would
not surprise me if it did not work in Safari 1.0, since it also does not
work in OmniWeb, which is currently based on the Safari 1.0 code. I have no
idea of what happens in Safari 1.1, since Apple do not allow you to run
earlier versions of Safari (reminds me of Internet Explorer for Windows). I
take it you have Safari 1.1. What happens if you try to run the script on
my page:
http://www.howtocreate.co.uk/tutorials/jsexamples/importingXML.html

Also, does your copy of IE crash if you run the script on that page? Or
just on your own page (do you have a URL)?

Please let me know how you get on, this kind of feedback is very useful.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromAlex Khost
ToMe
SubjectRe: JavaScript XML Parsing
Date15 June 2004 15:01
Mark,
Thank you for your reply.

I've now converted the script over completely to what
you have on your site and also tried running the
script directly from your website. Here are the
results:

Mac OS 10.2.3
In IE 5.2 the browser crashes when attempting to load
the XML page. When I take out the blank.css page, it
opens without problem. It also crashed when attempting
to run the JavaScript (with or without the blank.css
import in the XML). I have checked this extensively,
and it looks like IE 5.2 in this case is attempting to
create the ActiveX Object (and therefore crashes).
When attempting to run it from your site, it hangs.

In Safari 1.0 (which I need to update! I'm not really
a Mac user, just need to get this script working on
Macs...!) it suprisingly pops up your 'For no apparent
reason...' setTimeOut alert. I will get the Safari 1.3
upgrade and let you know...

Using the Mac Classic Environment (9.??) I only have
Internet Explorer 5.0 installed. In this case, when
invoking the JavaScript function, the page hangs and a
force quit is needed to close the browser.

In Netscape 6+ and FireFox/Mozilla on Mac and Win
platforms, all is working perfectly, as well as IE 6
on Windows. If you want to check from the URL I'm
using, the directory is at:
http://xxxxx.xxxx.xxx/xxxxxx/xxxxxx/ and I am
currently using 'test.html,' although I will be
updating this file as I work today.

Thanks again,
Alex
FromMe
ToAlex Khost
SubjectRe: JavaScript XML Parsing
Date15 June 2004 20:59
Alex,

I tested my original script in IE 5.0 OS 9 classic and it worked (a little
slower than in OS X - and it made occasional mistakes) - I really have no
idea why it would fail for you. I am afraid that it is probably a problem
with your installation. The current version is 5.1 for Mac OS 9, so maybe
that will fix it (I am probably using a slightly newer 5.0 release than you
are).

As for IE on OS X, PPK does mention that styled XML can crash IE 5.2 Mac on
OS X 10.2 (any ActiveX problem is probably because it tries to use an XML
parser at that point):
http://www.quirksmode.org/oddsandends/xmlcss.html
I suspect this is a problem with IE 5.2 on Mac OS X 10.2, since it works
for me on OS X 10.3.

Now, Safari ... you have the latest version (1.0) for OS X 10.2. To upgrade
Safari to 1.2, you would also have to upgrade your operating system to 10.3.
I have done some research online and found that Safari 1.2 is the first
Safari release to allow XML to be loaded into an iframe, and parsed
correctly.

All this means that the script basically cannot work in Safari or IE on OS
X 10.2.

However, it does work in
   - most IE 5 releases and Mozilla on OS 9
   - Opera and Mozilla on OS X 10.2
   - IE, Safari, Opera and Mozilla on OS X 10.3

I will have to update my notes to say that. Thanks for your accidental help
in keeping version information :) I am sorry for the inconvenience that
this must cause you, but I am afraid that these are limitations that I
cannot work around.


Tarquin
FromAlex Khost
ToMe
SubjectRe: JavaScript XML Parsing
Date16 June 2004 13:54
Tarquin,
Thanks again for all of your help-- if I discover any
alternatives that work on Mac OS 10.2 IE/Safari, I'll
be sure to let you know!

Alex
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.