Just build a quick tool to handle a small subset.

The XML in question is generated by an in-house Java app written by a co-worker. The Root attribute format is hardcoded so for this application only I'm confident that the format will not change. I'm well aware of the pitfalls of regex parsing and would not (and in fact do not in other code) dream of doing that when parsing XML from another source.

In my reply to juerd I mentioned that this code runs on a 'gateway' box. That box just accepts XML from a socket connection, archives the XML and then forwards it on to the database box for real parsing via XML::Parser(including the handling of base64 encoded print images & other fun stuff). Therefore the only thing this code needs to do is to be able to identify the type of XML message - as specified by the 'Group' attribute of Root so that the XML can be archived correctly.

The intent of my post (and I know I should have clarified it) was really to have people comment on the regex. I didn't mean to start a war over whether or not you should use a parser or not.

In reply to Re: Re: Preferred Methods (again) by vek
in thread Preferred Methods (again) by vek

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.