Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Need help with storing RegEx in XML

Posted on 2007-04-01
2
Medium Priority
?
251 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

670 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