PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1847
Number of posts: 5013

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Problem using xml_parser w/ PHP 4 Posted by tvienti on 9 Sept 2004 at 8:09 PM
Hey everybody,

I've been working on a custom extension to HTML that I can use in my web-development. I'm reading the files using the XML parser but I'm having some trouble. Basically, PHP 4's XML parsing functions don't handle XML if it's not properly formatted. Which in turn means my parser won't accept anything that's not perfect XHTML.

Since I was hoping to make this a relatively user-friendly language and corresponding parser that I could provide to other developers, I'd like it to be able to accomodate things like

  <img src="some_image.jpg">


instead of the XML compliant

  <img src="some_image.jpg" />


Does anybody have any suggestions on how I could tackle this without writing all of my own low-level XML parsing functions? Is there a more flexible library available for PHP 4 that can gracefully parse through potentially invalid XML?

Thanks for the feedback,
T
Report
Re: Problem using xml_parser w/ PHP 4 Posted by DarQ on 10 Sept 2004 at 5:03 AM
im glad that your parser complains. you should write proper xhtml, or no
xhtml at all. standards are not there to be messed up.

and btw: how much of a problem is it, rewriting it to proper xhtml? if you have little understanding of the rules, then you can either start and learn it at w3schools. or just use the w3c validator that can tell you what inconsitancies you have in your xhtml.

: Hey everybody,
:
: I've been working on a custom extension to HTML that I can use in my web-development. I'm reading the files using the XML parser but I'm having some trouble. Basically, PHP 4's XML parsing functions don't handle XML if it's not properly formatted. Which in turn means my parser won't accept anything that's not perfect XHTML.
:
: Since I was hoping to make this a relatively user-friendly language and corresponding parser that I could provide to other developers, I'd like it to be able to accomodate things like
:
:
:   <img src="some_image.jpg">
: 

:
: instead of the XML compliant
:
:
:   <img src="some_image.jpg" />
: 

:
: Does anybody have any suggestions on how I could tackle this without writing all of my own low-level XML parsing functions? Is there a more flexible library available for PHP 4 that can gracefully parse through potentially invalid XML?
:
: Thanks for the feedback,
: T
:

DarQ
Jou my no rap dy lekkere dikke tsjap

Report
Re: Problem using xml_parser w/ PHP 4 Posted by tvienti on 11 Sept 2004 at 11:31 AM
Not the most helpful response. Obviously I can write my own XHTML compliant code. But let's say somebody wants to convert an existing site to using my extension that isn't XHTML compliant. Let's be honest, XHTML compliance is a nice to have among today's browsers, and I'd like it to not be a requirement for my extension.

Thanks anyway,

T

: im glad that your parser complains. you should write proper xhtml, or no
: xhtml at all. standards are not there to be messed up.
:
: and btw: how much of a problem is it, rewriting it to proper xhtml? if you have little understanding of the rules, then you can either start and learn it at w3schools. or just use the w3c validator that can tell you what inconsitancies you have in your xhtml.
:
: : Hey everybody,
: :
: : I've been working on a custom extension to HTML that I can use in my web-development. I'm reading the files using the XML parser but I'm having some trouble. Basically, PHP 4's XML parsing functions don't handle XML if it's not properly formatted. Which in turn means my parser won't accept anything that's not perfect XHTML.
: :
: : Since I was hoping to make this a relatively user-friendly language and corresponding parser that I could provide to other developers, I'd like it to be able to accomodate things like
: :
: :
: :   <img src="some_image.jpg">
: : 

: :
: : instead of the XML compliant
: :
: :
: :   <img src="some_image.jpg" />
: : 

: :
: : Does anybody have any suggestions on how I could tackle this without writing all of my own low-level XML parsing functions? Is there a more flexible library available for PHP 4 that can gracefully parse through potentially invalid XML?
: :
: : Thanks for the feedback,
: : T
: :
:
: DarQ
: Jou my no rap dy lekkere dikke tsjap
:
:

Report
Re: Problem using xml_parser w/ PHP 4 Posted by kamran_pro on 12 Sept 2004 at 3:35 PM
DOM XML functions would help you.
http://www.php.net/manual/en/ref.domxml.php (Reference Manual).
-------------------------------------
: Not the most helpful response. Obviously I can write my own XHTML compliant code. But let's say somebody wants to convert an existing site to using my extension that isn't XHTML compliant. Let's be honest, XHTML compliance is a nice to have among today's browsers, and I'd like it to not be a requirement for my extension.
:
: Thanks anyway,
:
: T
:
: : im glad that your parser complains. you should write proper xhtml, or no
: : xhtml at all. standards are not there to be messed up.
: :
: : and btw: how much of a problem is it, rewriting it to proper xhtml? if you have little understanding of the rules, then you can either start and learn it at w3schools. or just use the w3c validator that can tell you what inconsitancies you have in your xhtml.
: :
: : : Hey everybody,
: : :
: : : I've been working on a custom extension to HTML that I can use in my web-development. I'm reading the files using the XML parser but I'm having some trouble. Basically, PHP 4's XML parsing functions don't handle XML if it's not properly formatted. Which in turn means my parser won't accept anything that's not perfect XHTML.
: : :
: : : Since I was hoping to make this a relatively user-friendly language and corresponding parser that I could provide to other developers, I'd like it to be able to accomodate things like
: : :
: : :
: : :   <img src="some_image.jpg">
: : : 

: : :
: : : instead of the XML compliant
: : :
: : :
: : :   <img src="some_image.jpg" />
: : : 

: : :
: : : Does anybody have any suggestions on how I could tackle this without writing all of my own low-level XML parsing functions? Is there a more flexible library available for PHP 4 that can gracefully parse through potentially invalid XML?
: : :
: : : Thanks for the feedback,
: : : T
: : :
: :
: : DarQ
: : Jou my no rap dy lekkere dikke tsjap
: :
: :
:
:




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.