Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML Mystery

Status
Not open for further replies.

CarlStreet

Programmer
Mar 23, 2003
5
US
I have an XML file that I can open with the MS Native XML editor
BUT, I cannot edit it. So I copied it into Notepad and edited it there. BUT, once I save it out it cannot be read by the MS Editor nor does it work.

The file works just FINE without changes; BUT, even if I copy it to notpad and make NO changes at all and just save it, it neither works nor does it show up in the editor -- comes up blank.

Furstrating and WEIRD to the max....
any ideas?
 
May be a character set issue.

Using a hex dump routine, what are the first few characters of the file (in hex)?

Tom Morrison
Micro Focus
 
File that works:

3C 3F 78 6D 6C 20 76 65 72 73 69 6F 6E 3D 22 31 2E

File that fails:

3C 3F 78 6D 6C 20 76 65 72 73 69 6F 6E 3D 22 31 2E
 
Why are you *copying it over* to Notepad?
That's not how you do it.

Open it *with* Notepad or get yourself Notepad++ and open it with that.
You should do fine then.

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Thanks for your response -- My bad; apparently I gave the wrong impression - I AM opening it with notepad and have tried several other text editors -- and then simply saving it WITHOUT making any changes whatsoever -- except for the name, of course.

[Now before we go down another rabbit hole, the only change to the name is on this order:

Original name: filename.xml

Copy name: filenameb.xml

You get the idea -- I am NOT blowing the extension, filetype, etc.]

Result: file no longer functions and cannot even be viewed in a browser...

Like I said, this is a new one on me -- one of those, "this will only take a minute" turns into 2 days of WTF! deals.
 
I see.
Well, browsers do validate XMLs before displaying them. What error does the Browser throw?
Also, have you run the file through a XML verifier to check what part of the XML exactly turns to poo?

My best guess:
Is the XML UTF-8 encoded?
If so: Remove - or add - the BOM and retry.





[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Browser throws NO error -- simply displays blank page -- true for both FF and IE

Original file IS UTF-8 and displays and functions just fine but I despite that I have already tried with: UTF-8

and: <?xml version="1.0" ?> -- as per W3C

W3C XML Validator only says "unable to validate due to errors" -- but NO CLUE as to what and where errors are -- about as useful as pinning a note to your chest to tell you that you are dead...

Visually, files appear identical and have the same [13K] size -- but, of course that is NOT a CRC check and only gets the size "close"; not guaranteeing an exact character for character match.

Have opened in a HEX editor and files are identical for about the first 100 characters -- hate to think the ONLY solution is to do each and every one -- BTW, looked at both top and bottom with same HEX match...

Have also rebooted system and tried in both Win XP-Pro and Win7 OS with same [non] results...


 
Are these files top secret or can you post snippets of the head here?
Is the file linked to a schema and/or a XSL perhaps?


[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
No Problem -- Moulder and Scully say I can give you access... :)

the one that works:


the one that fails:


As you can see these are NOT large, complex, and/or convoluted, exotic code files -- they are about as plain vanilla as it gets -- Thus my frustration and confusion...
 
Well, the second one does throw an error.
Where does that CDATA Segment come from? How did it get into this file?
These two files are certainly not the same file anymore - structure-wise!
And the tag before the introduced CDATA is missing its closing tip bracket.

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Any update on this issue?

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top