in reply to XML:Simple read tag value with regex
G'day filipebean,
There's a number of special characters that may need to be escaped in XML content: "<" to "<"; ">" to ">"; and "&" to "&" (see XML Predefined Entities). So,
<rule>['^(<xyz>)']</rule>
would become
<rule>['^(<xyz>)']</rule>
Given the readability issues, it might be better to use CDATA blocks (see XML CDATA Sections) to escape the entire regex, e.g.
<rule><![CDATA[['^(<xyz>)']]]></rule>
[Note: I haven't investigated how XML::Simple interacts with these constructs.]
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: XML:Simple read tag value with regex
by filipebean (Novice) on May 07, 2013 at 15:06 UTC |