Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Unfortunately, XML 1.0 made some stupid decisions when it comes to handling things like "control characters". It appears that XML 1.1 removes this stupidity (well, restricts it to null characters).

I've heard from at least one source that not even CDATA prevents this stupidity. I haven't tried to convince myself on this point by studying the standard but I'll note that the set of claims that I've heard from intelligent people who seem knowledgible about XML, confidently proclaimed, clearly contradict each other on the subject of how XML deals with control characters. I've sent people to go read the XML spec who returned and told me that I can use  for CTRL-A in XML (no, you can't).

I've advocated that we strip control characters from the XML we send out (by default, while allowing people to request it not be stripped, in part because so many "XML parsers" actually have no problem dealing with control characters). I don't see any other reasonable choices for what to do with control characters in PerlMonks XML, and that isn't for lack of looking; lots of different options looked promising but were eventually found unacceptable.

Until someone implements that, you can strip the control characters before you hand the "XML" to your parser. Since this is a Perl programming site, I'd hope that most visitors won't find this particularly difficult to implement. Yes, I'd rather produce fully valid XML by default.

See XML::Fling begone? for much more on this situation. Please read through that thread before replying in this thread.

- tye        


In reply to Re: rss feed corrupted by certain nodes (control characters) by tye
in thread rss feed corrupted by certain nodes by bsdz

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others making s'mores by the fire in the courtyard of the Monastery: (9)
    As of 2014-12-25 10:14 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (160 votes), past polls