Solved

Need help with storing RegEx in XML

Posted on 2007-04-01
2
239 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
2 Comments
 
LVL 10

Accepted Solution

by:
MrClyfar 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Search and display values in the textbox using VB.net and SQL 19 47
cannot connect to sqlserver 8 25
.NET 2008 VB and C# 6 27
vb.net and creating a class 5 14
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now