Pass a value containing "<"

TheWizardofInt

Well-known member
Joined
Dec 31, 1969
Messages
333
Location
Orlando, FL
I need to pass an XML value which contains a "<"

When I load the XML document containing "<", the program throws an error farther down the line, thinking that I have started a new node

Is there a way to pass this value, or do I have to change the character as part of error handling?

Here is an example of what I mean:

<Contacts>
<Contact Notes>
<RecID> DJDEWYDHD>/#</RecID>
<Notes> Here are some notes</Notes>
</Contact Notes>
</Contacts>
 
You should escape any non supported characters, for > use &gt and &lt; for <
Also your XML isnt well formed anyway as you have a space in the tag name for <Contact Notes>
 
The XML was just an example

WHen you say escape the non-supported characters, do you mean replace them with that sort of string, or do you mean that "&gt;" will give me the character I want?
 
XML uses the standard HTML escape sequences for characters - just replace the non supported ones with the correct escaped character.
If you are using any of the built in xml support (XmlTextWriter etc) then this should be taken care of anyway.
 
Back
Top