.NET Framework Bookmark and Share   
 index > .NET Base Class Library > XmlTextReader.ReadOuterXml question
 

XmlTextReader.ReadOuterXml question

I am getting an exceptionat the call to ReadOuterXml to read through an xml file that I have. It is an exception stating '/' is an unexpected token. The expected token is '='
The xml file that I am going through has an element with a slash in it like this <Date/Time>
The problem is occurring at the slash. I guess because this is an escape character. Any easy way to get around this problem?

Thanks
useruser1
That's not valid XML. A slash character is not valid in an element name. The way to get around it is to stop using invalid XML.
  • Marked As Answer byuseruser1 Monday, September 21, 2009 9:51 PM
  •  
Adam Sills
That's not valid XML. A slash character is not valid in an element name. The way to get around it is to stop using invalid XML.
  • Marked As Answer byuseruser1 Monday, September 21, 2009 9:51 PM
  •  
Adam Sills
Your right. This xml file is created from another program that someone else created. I just needed to get the info from the file. So I guess I'll have to change it around to make it valid.
useruser1

You can use google to search for other answers

Custom Search

More Threads

• how to uninstall language pack
• problems running a .net app that resides on a network drive
• How to make ColorDialog modeless?
• How to use Configuration.GetSection() and ConfigurationManager.OpenMappedExeConfiguration()
• dispose method in a correct way
• EventWaitHandle synchronization between windows forms app and windows service
• Why is HashSet<T> not working for me?
• System.Diagnostics.Process.GetProcesses not working in VISTA
• Issues with Generics and System.Monitor
• Focus moves from UserControl to ScrollBar placed on the same Usercontrol