Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 23, 2013 09:24 AM by DarrellNorton
Member
328 Points
125 Posts
Jan 23, 2013 07:54 AM|LINK
Hi there
I am using XDocument to read an XML file and i am getting the follwing error-
Non white space characters cannot be added to content.
i hav written following code to load an XML-
XDocument document = new XDocument("c:\Work\file.xml")
ANy help will be appreciated.
All-Star
87443 Points
9718 Posts
Moderator
MVP
Jan 23, 2013 09:24 AM|LINK
You cannot load a file like that into an XDocument. That works for the XmlDocument class, but not XDocument.
You can load a file using the Load method, like this:
XDocument document = XDocument.Load("c:\Work\file.xml")
varunpals
Member
328 Points
125 Posts
Using XDocument and getting error - Non white space characters cannot be added to content.
Jan 23, 2013 07:54 AM|LINK
Hi there
I am using XDocument to read an XML file and i am getting the follwing error-
Non white space characters cannot be added to content.
i hav written following code to load an XML-
XDocument document = new XDocument("c:\Work\file.xml")
ANy help will be appreciated.
DarrellNorto...
All-Star
87443 Points
9718 Posts
Moderator
MVP
Re: Using XDocument and getting error - Non white space characters cannot be added to content.
Jan 23, 2013 09:24 AM|LINK
You cannot load a file like that into an XDocument. That works for the XmlDocument class, but not XDocument.
You can load a file using the Load method, like this:
XDocument document = XDocument.Load("c:\Work\file.xml")Darrell Norton's Blog
Please click "Mark as Answer" if this helped you.