You are allowed this sort of data in tags as long as its marked as CDATA (character data, not to be parsed)

The CDATA tag takes the format <![CDATA...]> where the ... is the text data you dont want to be parsed.

Therefore, your XML should look like:

<main> <txt> <![CDATA this is text. don't forget to look at <a href="http://perl +monks.org">perlmonks</a> don't you just hate <blink>blinking</blink> text? ]]> </txt> </main>

There is another get around: convert all the <'s in the text not to be parsed to &lt; which will look like:

Its not a problem with the parser, more the format of your XML.

<main> <txt> this is text. don't forget to look at &lt;a href="http://perlm +onks.org">perlmonks&lt;/a> don't you just hate &lt;blink>blinking&lt;/blink> text? </txt> </main>

This basically stops anything tags being seen by the parser. Not great but it works.

Oh, and if your using the CDATA tags, dont forget to escape anything that may look like the end ]]> in your data.

- Jed


In reply to Re: Maximum parsing depth with XML::Parser? by Speedfreak
in thread Maximum parsing depth with XML::Parser? by ar0n

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.