Help with ampersands in strings

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

printf
Forum Contributor
Posts: 173
Joined: Wed Jan 12, 2005 5:24 pm

Post by printf »

The problem is that some are entitys are encoded and others are not, so when encode them and they already encoded the praser doesn't understand what is a entity and what isn't. The only way to fix it is to go into each node and fix it so the praser will not think things like <HTML ELEMENT> is node.

But for this problem, it would take more time to fix the document than what it is worth! My idea is to just create a parser that can handle the bogus xml document....

examples.... (these are just on my notebook, I don't feel like putting them on my web server)

I removed the example....


pif!
Last edited by printf on Sun Jun 18, 2006 4:54 pm, edited 1 time in total.
L4E_WakaMol-King
Forum Commoner
Posts: 26
Joined: Wed Jun 14, 2006 10:54 am

Post by L4E_WakaMol-King »

Printf, you are a lifesaver! The code works perfectly.

I looked at the source code, and I think I understood what was going on. Basically, you just wrote your own xml parser of sorts? That makes sense, since it's always going to be parsing the same document with the same formatting.

I really can't thank you enough. You have been so helpful.
printf
Forum Contributor
Posts: 173
Joined: Wed Jan 12, 2005 5:24 pm

Post by printf »

Thanks, I am happy we got it fixed for you, I have generic XML parser if you want it, it can convert any XML document into a single index array, that allows you to grab stuff easier than using xml_parse(), I do like using xml_parse_into_struct();, it doesn't have the problems that xml_parse() has with certain entities!


Take Care

pif!
phpCCore Brad
Forum Commoner
Posts: 47
Joined: Sun Dec 04, 2005 5:46 pm
Location: Michigan, USA
Contact:

Post by phpCCore Brad »

Nevermind this post I was reading for a while and didn't see it was solved :D
Post Reply