Menu

#2 Make it more like existing php xml library

open
nobody
None
5
2005-12-01
2005-12-01
Anonymous
No

You could add a wrapper class that basically does this:

while ($parser->parse())
{
if ($parser->iNodeType == NODE_TYPE_ELEMENT)
handleStart($oParser);
if ($parser->iNodeType == NODE_TYPE_ENDELEMENT)
handleEnd($oParser);
if ($parser->iNodeType == NODE_TYPE_TEXT)
handleText($oParser);
//etc..
}

But the user of your library puts in their own handler
for each node type. See xml_set_element_handler() in
the php manual for what I mean. It is harder to do this
since your implementation is class based. But if done,
would make the interface a lot cleaner for people using
your library.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.