I'll guess that the "guarantee" is that no matter how stupidly you try to use Genx, it refuses to produce invalid XML

Indeed.

Okay, let's go back to the beginning and list my reasons for all this noise.

We use XML::Fling, specifically written for PM (and E2?), because the less dumb XML generators are all too slow.

We currently do not produce broken XML other than potentially inserting invalid characters, but there is no guarantee that the output remains wellformed when tickers are patched or newly created. I'll make an analogy with strict here.

My thinking is: if something is faster yet than Fling, and additionally guarantees compliance — then it seems like a worthwhile option to pursue.

You find fault, and I can see why, with the fact that so far I'm just talking about the a performance improvement without investigating it. The problem with that is that we have not reached a consensus about control characters, and if Genx wouldn't even be considered due to these issues, it doesn't seem to make sense to invest actual effort (particularly as that would likely incur patching XML::Genx; the bindings are still very young).

You've broken single fields into multiple pieces such that they are a pain to put back together.

Yes, I know, and I was thinking about that even as I wrote it. I don't know if that means I lost sight of the primary goal. I'm trying to satisfy both primary and secondary goals at once. I just didn't see a better way at the time.

But how double-encoding, ie passing a NUL through as 
? As a bonus, this would work for attribute values as well. And I think it's actually a pretty good idea since decoding it is simple (just put the string through an entity decoder a second time after you get it from the XML parser) and it doesn't require double-encoding any non-control characters other than the & itself. The scheme basically uses XML against itself to attain validity. :-)

How does that sound?

Makeshifts last the longest.


In reply to Re^8: XML::Fling begone? (goals) by Aristotle
in thread XML::Fling begone? by Aristotle

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.