Re: My Regexp XML Parser -> Structured Perl Data, Cut & Paste Version, No Module's (Vol I)




<robic0> wrote in message news:evc1r1d8jt63q25vmdocgbevd16uh5att2@xxxxxxxxxx
> On Sat, 24 Dec 2005 11:57:13 -0500, "Matt Garrish"
> <matthew.garrish@xxxxxxxxxxxx> wrote:
>
> Man you make me laff!
>

Well, at least you're getting as much out of this as I am. It would be nice
if you could drop the script-kiddie talk and write proper English sentences
in the future, though.

>
>>By the way, have you put any thought into the public interface for this
>>thing? It's nice that it runs line-by-line and uses regexes to find tags,
>>but that's totally useless for XML parsing. Does it handle events like a
>>SAX
>>parser? (Not that I see.) Does it build a parent/child tree? (Again, I
>>don't
>>see anywhere that you can tell what the relationship is between any set of
>>tags.) Or is this just an exercise in writing regular expressions?
>>
>>
> Since its out of sequence, its totally useless for event driven SAX.

That's exactly my point. What is this thing supposed to do? The (very
simple) point of an XML parser is to verify the integrity of the document
(validation: either well-formedness or compliance to a dtd or schema) and/or
allow you to access the content.

Your parser has no appreciation of nesting beyond the very trivial, so there
is no way that it can check well-formedness. It (you) also doesn't
understand dtds or schemas, and don't realize how nearly impossible it's
going to be for your parser to validate against one.

To get back to my original point, however, your parser does not build a
tree, so that makes it useless for half the applications of a parser. It
also doesn't handle events like a SAX parser, which makes it useless for the
other half. I'm honestly curious what real world application you think this
is going to have?

Oh, and when are you going to start handling xpath queries?

Matt


.



Relevant Pages