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




<robic0> wrote in message news:kf7pq15pfhs754mu2o2d8fs6meg0h8v2e6@xxxxxxxxxx
> On Fri, 23 Dec 2005 19:29:45 -0500, "Matt Garrish"
> <matthew.garrish@xxxxxxxxxxxx> wrote:
>>Now how about the part where you start dealing with the fact that xml is
>>not
>>constrained to single lines. Your little toy has a lot of trouble with:
>>
> Huh, constrained to single lines?
> Wha, where?
>
>><!-- comment out this section
>><oldroot>
>> <oldstuff>oops!</oldstuff>
>></oldroot>
>>-->
>>
> Comments are a problem for now. I have a workaround
> for the near future. I've posted a general complaint
> about this Regex problem to the general forum.
>
>>and also:
>>
>><myplace
>> city="here"
>> province="there"/>
>>
> "white space" is not considered as a seperator yet, only " ". If its
> xml complieant I will enact it.
>

Exactly my point. The last XML processor I built took three weeks just to
write the design for and another 1.5 months to build. And I didn't write my
own parsers; I used a combination of DOM and SAX parsing. You don't know XML
and are proud that you've spent four days designing and writing on the fly
this parser of yours. Are you beginning to see why we don't take you
seriously.

>
> Maybe you should not get or use any my software. If I find out you did
> I will sue you!!!!
>

Maybe you should consider the legal ramifications of what you've done. You
posted the code here asking for help fixing it on the premise that it is
free and open code. By doing so, you've entered an agreement with everyone
on clpm who responds in any way to your code that this will always be the
case. Though I don't believe you could ever make a cent off it, bear in mind
that I have a real cause for legal action if I find out you use this code in
any commercial product (and that includes reproducing it for an employer).

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?

Matt


.



Relevant Pages

  • Re: Word 2003 XML
    ... In essence the parser determines whether the XML provided to it, ... have much info. about the schemas associated with an XML document. ... (which is what namespaces are all about). ...
    (microsoft.public.mac.office.word)
  • Re: My Regexp XML Parser -> Structured Perl Data, Cut & Paste Version, No Modules (Vol I)
    ... >>>but that's totally useless for XML parsing. ... >Your parser has no appreciation of nesting beyond the very trivial, ... >going to be for your parser to validate against one. ... Wheather or not I can use it to write a schema checker is something I ...
    (comp.lang.perl.misc)
  • Re: my first Tck/Tk program... and an XML question
    ... parsers shouldn't care which form of syntax is used, and an XML ... tags being identified as ending element tags were the explicit, ... parsing the XML output produced by the code I posted and I notice that ... We've seen the problem only when using the libxml2 parser. ...
    (comp.lang.tcl)
  • Re: my first Tck/Tk program... and an XML question
    ... parsers shouldn't care which form of syntax is used, and an XML ... tags being identified as ending element tags were the explicit, ... parsing the XML output produced by the code I posted and I notice that ... We've seen the problem only when using the libxml2 parser. ...
    (comp.lang.tcl)
  • Re: SAX PARSING DESIGN PATTERN
    ... I am parsing out an xml document using a sax parser. ... In the class that implements the parser element for a given tag I include a reference to the parent parser element object. ... The parsing loop will retrieve a handler for the current tag during startElement() and set its "parent" instance variable to the current AbstractHandler before pointing currentHandler at the new one. ... Or does your SAX parser actually have StartElementand EndElementmethods? ...
    (comp.lang.java.programmer)