[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-xml
Subject:    Re: XML::Simple - ignore HTML?
From:       Eric Bohlman <ebohlman () earthlink ! net>
Date:       2001-03-20 19:54:37
[Download RAW message or body]

3/20/01 6:38:09 AM, Ken MacLeod <ken@bitsko.slc.ut.us> wrote:
>After that, though, a suggestion for XML::Simple (and XML::Twig?)
>would be to allow SAX handlers to be switched in for certain elements.
>
>When the start element is reached, the module sends a start_document()
>to the SAX handler, and passes off all events (acting like a SAX
>filter) from then until the corresponding end element, when it calls
>end_document() and stores its return value into the tree at that
>point.
>
>In your case you could then either use a tree-builder (DOM or grove,
>to have a tree to work with) or an XML writer (to just preserve the
>XML string).  Others could use this feature to capture more complex
>XML data structures.

I'm working on something like this for the next version of XML::Records, which 
is sort of analogous to a "pull" version of XML::Twig (unlike the current 
XML::Records, it will be a subclass of XML::TokeParser, making it easier to 
navigate around the document).  You'll be able to call a drive_SAX() method 
which will send SAX events (encapsulated in start_document() and 
end_document()) to a handler you specify, starting at either the next element 
in the stream or an element you specify.


_______________________________________________
Perl-XML mailing list
Perl-XML@listserv.ActiveState.com
http://listserv.ActiveState.com/mailman/listinfo/perl-xml

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic