PDA

View Full Version : Bypassing XML parser on non-compliant browsers


the_pm
November 2nd, 2004, 19:28
This post is directed mostly to BigBison: could you post the source for that PHP script you wrote that checks XML browser compatibility? I understand you were making some last minute modifications, and since it's open for public use, I thought others here might be interested in looking at it. I intend to try it on IWDN, and if it does what it's purported to do, I'll extend you full credit for this excellent contribution.

Also, you could consider wrapping it up in a small article about why it exists and how you made it, and we could publish it in the articles section. Again, full credit would be due, but it could be a great tool for others and would give it a convenient home :)

Pauly
November 2nd, 2004, 19:41
I might be interested in looking at this actually, sounds interesting!

Jamie
November 2nd, 2004, 19:56
Sure does, a little explanation from Paul or BigBison on how it works and what it is intended for would be great. :)

the_pm
November 22nd, 2004, 23:25
Ok. The script is posted, but I'm not sure of the best way to implement a system like this. http://forums.iwdn.net/viewtopic.php?t=108

How is this sort of script implemented? I've successfully stuck it at the top of a page and had it return the proper heading, but I can't think of a more inefficient way to do things than this. I noticed Jason (Digiscape) uses a similar method on his site. What's the procedure, guys? :)

BigBison
November 23rd, 2004, 01:14
Ah, grasshopper, you've missed the point of the flowchart...
You must not fail to see the trees for the forest...

Sorry! In other words, I'm rewriting it to suit my present needs, it was written for the software I was previously using, integrating it with anything I'm unfamiliar with (like PHPBB) is beyond me. My rewrite is still pending, but I'm not sure that will help either.

The point is, you know at what point in your code you need to classify a browser, and what to do once you've made the determination. So, modify my script to fit your needs.

I didn't design the script to output a header. I designed it to determine which skin to use, my skins were each different in terms of DOCTYPE, <html> line, MIME type, etc. I wasn't intending to use it to modify one skin, which is what you're trying to make it do.

You can't make multiple skins for IWDN, which are all identical in appearance yet different in code? To use my script as-is, you've got to start there, then I'll be better able to help you integrate it.

the_pm
November 23rd, 2004, 01:27
Ah, ok. I was thinking this script would be useful for the rest of the site. In fact, if you're interested in seeing the modifications I made, I'll post a test page for you. It does infact return the appropriate header given the browser in question. It doesn't strip out the />, but a little at a time, eh? :)

Let me get something together and post it.

the_pm
November 23rd, 2004, 01:29
Scratch that - I already have it up. http://www.iwdn.net/index2.php

Look in Opera, then in IE. It's pretty hacky work on my part, but it did the job ;)