I know that little th开发者_运维技巧ings like whitespace at the beginning of the ror.xml file will throw errors, but how could opening the file in Dreamweaver, NOT CHANGING ANYTHING, and then uploading the file make it valid?
Edit: I don't think it makes a difference but the language of script is PHP. The script does the following:
- file opens
- gets compared
- replaces content of file
- closes the file
Looks great but does not work.
When I open both a generated ror.xml (which throws errors), and one I've re-saved (that works correctly), they both look in every way identical. It's Madness!
Natrix,
It looks like the source of the problem is one of two things. Either
- the program that's throwing the error (Firefox RSS button?) is mistaken about the XML not being well-formed; or
- DreamWeaver is actually fixing something.
The latter seems more likely. Can you show us a sample of the generated XML and the XML after Dreamweaver has opened it? I understand that they look identical. It's possible that the generated file has some characters that are incompatible with the declared encoding at the top of the file, and DreamWeaver is silently fixing those characters.
Ah... your sample at http://www.creditrepairadvisors.net/ror.xml actually starts with a bunch of blank spaces before the XML prologue. (Well, it did the first time I accessed it.) That's not allowed in an XML document. Make it start with <?xml ...?>
immediately. That's probably what Dreamweaver is fixing.
Note, you used the word 'valid' in your question, but this is not an issue of XML validity (conformity to a schema of some sort). It's saying the XML is not well-formed. And if it's not well-formed, then it can't even be tested for validity.
精彩评论