cheekuperl:

...and chances are, it would be wrong. XML looks much simpler than it actually is.

I spend most of my @work time working with data interchange with various financial institutions and get to work with 'XML' files all the time. The problem is, they tend to generate it just as you say: with a few print statements. So what happens is we get files that *look* like they should be XML, but fail in one or more ways.

This is one of the reasons you see websites and databases with text like "<amp;" and such everywhere. Someone doesn't encode properly, someone doesn't decode properly, etc.

The problem is so common that whenever I get a new XML data feed, the first thing I do is run it through an XML validator. (Of course, when you point out that the file you receive isn't valid XML, they'll adamantly insist that it is. Then you're stuck with the job of trying to get the data into your system without making the data any worse than it already is.)

For all the problems that XML is supposed to solve, I have more headaches with XML feeds than anything else.

...roboticus

When your only tool is XML, all data interchange problems look like a pain in the ass.


In reply to Re^2: Save results into one big XML file help! by roboticus
in thread Save results into one big XML file help! by Anonymous Monk

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.