On the server side (PHP) I have successfully used HTML SAX Parser
class by Alexey G. Piyanin to check for "well formed" XHTML input:
http://www.phpclasses.org/package/2140-PHP-Parse-HTML-documents-using-regular-expressions.html
or
http://www.zend.com//code/codex.php?ozid=1465&single=1
it has worked really well for my needs and surely the same can be done
client-side, if ever needed :)
Diego
On Sat, Dec 31, 2011 at 2:05 PM, Poetro <[email protected]> wrote:
> 2011/12/31 dtang85 <[email protected]>:
>> Whats the difference between SAX and DOM? Someone asked me that and my
>> initial thought was that DOM API methods is the main API for XML. Can
>> someone clarify? Thanks!
>
> SAX stands for Simple API for XML, and is a different method to parse
> the XML. The parser goes through the XML file and triggers event for
> everything it encounters. For example when it finds an opening tag, it
> triggers an event, when it finds an attribute, it triggers another
> one, when it reaches a text node then another, when it reaches the end
> of the tag then another. So it sequentially parses the XML file
> triggering event for everything it encounters within the XML during
> parsing. It is really fast, but it is sequential, so you cannot go
> back and forward withing the XML with it. If you want to do another
> run in the XML, you have to parse the whole XML another time, or you
> build a DOM like document during the SAX parsing.
>
> --
> Poetro
>
> --
> To view archived discussions from the original JSMentors Mailman list:
> http://www.mail-archive.com/[email protected]/
>
> To search via a non-Google archive, visit here:
> http://www.mail-archive.com/[email protected]/
>
> To unsubscribe from this group, send email to
> [email protected]
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]