开发者

How do I find errors in a XML file?

开发者 https://www.devze.com 2023-01-26 22:32 出处:网络
Sometimes 开发者_StackOverflow社区when I\'m trying to run my code, the Eclipse console says: Error in an XML file: aborting build.

Sometimes 开发者_StackOverflow社区when I'm trying to run my code, the Eclipse console says:

Error in an XML file: aborting build.

That means that I have a mistake in my main XML file. Is there any way to find my mistake without making guesses and erasing some XML code in order to see where the problem is? Something like validation of my XML file! Thanks.


XML Tools, a plugin for Notepad++ allows you to check if the XML syntax is broken and tells you on what line the error is.

To install the XML tools plugin, download the plugin zip file, and extract the contents to where you have installed Notepad++ (such as C:\Program Files\Notepad++). Then restart Notepad++, open the XML file you wish to check, click on the "Plugins" menu at the top, select "XML Tools" and click on "Check XML syntax now."

Hope that helps.


You could even open it in firefox, and if it is malformed it will show you where the error lies.


Can't say for sure if it is same issue but I have on occasion Run my application with an xml file as the active window and that creates an abort build. Make sure your not Running an xml file.


XML Tools, a plugin for Notepad++ allows you to check if the XML syntax is broken and tells you on what line the error is.

I think that Notepad++ reports the first line after the error(s) at which Notepad++ knows there must be an error earlier.

I have just used Notepad++ and XML Tools to investigate a file which turned out to have about 30 "single bit flipped" errors. For example, "text:p" appeared as "text:q"; "table-cell" appeared as "table:cdll" and ">" appeared as "=" etc.

Initially I thought that the error must be in the matched tags section immediately preceding the reported line. However, with so many errors I was looking for problems a hundred or two hundred lines above the reported error line and well above the immediately preceding matched tags section.

I reasoned that if an end ">" had been converted to "=" then Notepad++ would be reading much that followed as free text.

I found XML Copy Editor much easier to use as it found each line with an error. I needed to pretty print first using Notepad++.

0

精彩评论

暂无评论...
验证码 换一张
取 消