Need help with storing RegEx in XML

 I need to store some regular expressions in an XML but the special characters appear to be causing problems. I read somewhere that if I convert them to hex it works ok but I'd prefer to store them as they are. Does anyone know how I can get around this?


        'load the xml file
        xd.Load(Application.StartupPath & "\RegularExpressions.xml")
        Dim Node As XmlNode
        Dim ChildNode As XmlNode

        Node = xd.SelectSingleNode("//TEST")
        For Each ChildNode In Node
Who is Participating?
Jason EvansConnect With a Mentor Senior Software DeveloperCommented:
Hi there.

Try storing the actual XML node data in a CData attrbiute eg

    <![CDATA[Test <> (? expression ) >&""""!!!]]>

CData is useful in situation where you will be storing data in XML format that might cause problems for an XML parser.

e_murf1Author Commented:
That worked perfectly. Thanks for the help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.