Re: XML whackyness

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Tony Proctor wrote:

How are you looking at the file Frank? Assuming these to be the special
3-byte sequence identifying the file content as UTF-8 then I would not
expect them to be visible in, say, Notepad. It automatically filters them
out and uses them to decide how the rest of the file data should be
interpreted (i.e. as UTF-8 rather than the default ANSI character set).

Similarly, you don't need to do anything special when loading the XML file
with MSXML since it interprets those bytes for you

We rely on this feature a lot, but we've never had to filter anything out
ourselves. It all works pretty well for us.


Well, if you actually read the file contents into a string and then pass it to xmlDoc.Load, it generates an error.

Out of interest, how are you generating these files?


I am not generating them. They come from some entity outside of the company (don't know really).

       Tony Proctor

"Frank Rizzo" <none@xxxxxxxx> wrote in message
news:uUcL93l3FHA.1276@xxxxxxxxxxxxxxxxxxxxxxx


Every now and then when I open an XML file, I'll see various
miscallaneous characters before the first less-than bracket.  Like today
I've seen ascii 254 and 255, yesterday I saw .  What are these
characters?  Are they garbage?  Can I ignore them?  The reason I am
asking is because there is a routine that reads the text from XML file
into memory and passes me the string.  When the string has these whacky
characters, domDocument.LoadXml method fails.

Thanks






.



Relevant Pages

  • Re: XML whackyness
    ... > miscallaneous characters before the first less-than bracket. ... > asking is because there is a routine that reads the text from XML file ... > into memory and passes me the string. ... first angled bracket before sending it on to the XML DOM in our XML objects at work. ...
    (microsoft.public.vb.general.discussion)
  • Reading XML file - chars being dropped
    ... I have a PHP script parsing an XML file, and am having a problem when ... parser, and when I feed it an XML file like the one below, the string ... few characters are lost for some reason. ...
    (comp.lang.php)
  • Re: vb.net code for inserting vbcrlf every 80 characters - WHOOPS
    ... Dim httpStream as system.net.webclient = new net.webclient ... So now instead of sticking it in a string I buffer it from bytes ... string which I place in an XML file. ... was thinking to insert vbCrLf every 80 characters or so but I don't ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to convert Infix notation to postfix notation
    ... If this is for an error message, why isn't it using stderr for its output? ... array of 15 characters, and you call this function with the limit 15 on ... Making sure that the only string I allocate and append to, ... because mulFactor in all versions must needs incorporate the functions ...
    (comp.lang.c)
  • Re: Prothon should not borrow Python strings!
    ... """It does not make sense to have a string without knowing what encoding ... same cul de sac as Python. ... Prothon_String_As_ASCII // raises error if there are high characters ... Python's split between byte strings and Unicode strings is ...
    (comp.lang.python)