Solved

Need help with storing RegEx in XML

Posted on 2007-04-01
2
245 Views
Last Modified: 2012-05-05
Hi,
 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?

<RegularExpressions>
      <TEST>
            <Node><(?<tag>TEST)>(?<text>.*)</\k<tag>></Node>
            <Node><(?<tag>TESTA)>(?<text>.*)</\k<tag>></Node>
      </TEST>
</RegularExpressions>

        '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
            MsgBox(ChildNode.InnerXml)
        Next
0
Comment
Question by:e_murf1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
Jason Evans earned 500 total points
ID: 18833223
Hi there.

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

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

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

Jas.
0
 

Author Comment

by:e_murf1
ID: 18834670
That worked perfectly. Thanks for the help.
Eoghan.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question