System.Xml.XmlException

  • Thread starter Thread starter Jeroen Ceuppens
  • Start date Start date
J

Jeroen Ceuppens

Hi,

I need some sort of a checker to fix a string to a string that can be
handled by xml

Example:
Xml need strings without (when you press the spacebar)
so: good string: "List_that_is_good"
so: bad string: "List_that_is bad"

Before a save the string to xmlfile, I need to check the string, how do I
make such a checker? With RegExpression?
I need also to know which things are allowed in the string (+, - ?), so I
can make it sure that it didn't give an XmlException

Thx
Jeroen
 
Are you only looking for Alphanumerics?

You could do this a few ways... RegEx (as you said), loop through each
character in the string and check the char.IsLetterOrDigit (if available in
CF) property, or depending on what you're doing, validate against XSD?
 
Back
Top