Click here to Skip to main content
15,905,683 members
Home / Discussions / C#
   

C#

 
GeneralRe: Updating data programmatically Pin
totig28-May-03 2:51
totig28-May-03 2:51 
GeneralRe: Updating data programmatically Pin
Rocky Moore28-May-03 3:38
Rocky Moore28-May-03 3:38 
GeneralRe: Updating data programmatically Pin
totig28-May-03 5:16
totig28-May-03 5:16 
GeneralRe: Updating data programmatically Pin
jtmtv1828-May-03 11:20
jtmtv1828-May-03 11:20 
GeneralXML Loading Problem Pin
Nick Parker27-May-03 17:10
protectorNick Parker27-May-03 17:10 
GeneralRe: XML Loading Problem Pin
J. Dunlap27-May-03 20:21
J. Dunlap27-May-03 20:21 
GeneralRe: XML Loading Problem Pin
Nick Parker28-May-03 1:43
protectorNick Parker28-May-03 1:43 
GeneralGrabbing Text Input with C# / .net Pin
dratti27-May-03 12:41
dratti27-May-03 12:41 
GeneralInstantiate .NET type within web page (like ActiveX) Pin
Michal Januszczyk27-May-03 10:15
sussMichal Januszczyk27-May-03 10:15 
GeneralRe: Instantiate .NET type within web page (like ActiveX) Pin
Vasudevan Deepak Kumar27-May-03 19:52
Vasudevan Deepak Kumar27-May-03 19:52 
GeneralRe: Instantiate .NET type within web page (like ActiveX) Pin
Ed K30-May-03 3:49
Ed K30-May-03 3:49 
GeneralGood Enum Question Pin
Ed K27-May-03 9:26
Ed K27-May-03 9:26 
GeneralRe: Good Enum Question Pin
Eric Gunnerson (msft)27-May-03 11:29
Eric Gunnerson (msft)27-May-03 11:29 
GeneralRe: Good Enum Question Pin
ralfoide27-May-03 14:08
ralfoide27-May-03 14:08 
GeneralRe: Good Enum Question Pin
Eric Gunnerson (msft)27-May-03 17:43
Eric Gunnerson (msft)27-May-03 17:43 
GeneralRe: Good Enum Question Pin
J. Dunlap27-May-03 14:11
J. Dunlap27-May-03 14:11 
GeneralRe: Good Enum Question Pin
KingTermite27-May-03 11:32
KingTermite27-May-03 11:32 
GeneralRe: Good Enum Question Pin
Rein Hillmann27-May-03 15:26
Rein Hillmann27-May-03 15:26 
GeneralRe: Good Enum Question Pin
leppie28-May-03 6:57
leppie28-May-03 6:57 
GeneralInteraction between a Form and a Class Pin
JJF00727-May-03 8:21
JJF00727-May-03 8:21 
GeneralRe: Interaction between a Form and a Class Pin
KingTermite27-May-03 14:28
KingTermite27-May-03 14:28 
GeneralWhitespaceHandling Pin
Kant27-May-03 5:30
Kant27-May-03 5:30 
If the XML file has whitespaces then it crashes my app. What I am doing wrong??

I get this "An error occured while parsing EntityName. Line 8, position 14."
That position it has whitespaces. I am actually testing my app.

<br />
<br />
FileInfo fileInfo = new FileInfo(fileName);<br />
<br />
XmlNode xmlRootNode;<br />
XmlTextReader xmlReader = null;<br />
if (fileInfo.Exists)<br />
{<br />
using (Stream strm = fileInfo.OpenRead())<br />
{<br />
  using (StreamReader sr = new StreamReader(strm))<br />
  {<br />
 <br />
     xmlReader = new XmlTextReader(sr);<br />
     xmlReader.WhitespaceHandling = WhitespaceHandling.None;<br />
     try<br />
     {<br />
	XmlDocument myDocument = new XmlDocument();<br />
<br />
	myDocument.Load(xmlReader);<br />
....<br />
}<br />
<br />
}<br />
}<br />


Even if I open the XML file in IE, it fails. I get this error. "Whitespace is not allowed at this location. Error processing resource 'file:///C:/abcd.xml'. Line 8, Position 14"

I want to avoid those nodes where whitespaces exist.

Thx

Don't Beer | [beer] and drive.
GeneralRe: WhitespaceHandling Pin
Philip Fitzsimons27-May-03 22:26
Philip Fitzsimons27-May-03 22:26 
GeneralRe: WhitespaceHandling Pin
Kant28-May-03 5:01
Kant28-May-03 5:01 
GeneralRe: WhitespaceHandling Pin
Philip Fitzsimons28-May-03 5:06
Philip Fitzsimons28-May-03 5:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.