note
kcott
<p>G'day [filipebean],</p>
<p>
There's a number of special characters that may need to be escaped in XML content: "<c><</c>" to "<c><</c>"; "<c>></c>" to "<c>></c>"; and "<c>&</c>" to "<c>&</c>" (see [http://www.w3.org/TR/REC-xml/#sec-predefined-ent|XML Predefined Entities]). So,
</p>
<code>
<rule>['^(<xyz>)']</rule>
</code>
<p>would become</p>
<code>
<rule>['^(<xyz>)']</rule>
</code>
<p>
Given the readability issues, it might be better to use CDATA blocks (see [http://www.w3.org/TR/REC-xml/#sec-cdata-sect|XML CDATA Sections]) to escape the entire regex, e.g.
</p>
<code>
<rule><![CDATA[['^(<xyz>)']]]></rule>
</code>
<p><em>
[Note: I haven't investigated how [http://search.cpan.org/perldoc?XML%3A%3ASimple|XML::Simple] interacts with these constructs.]
</em></p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-861371">
<p>-- Ken</p>
</div></div>
1032474
1032474