开发者

Problem in XML parser program

开发者 https://www.devze.com 2022-12-12 17:51 出处:网络
I am doing a simple XML parser program.I am running it in command prompt.The program (abc.java) compiles successfully.But it gives following error after running it:

I am doing a simple XML parser program.I am running it in command prompt.The program (abc.java) compiles successfully.But it gives following error after running it:

 C:\Program Files\Java\jdk1.6.0_13\bin>java abc abc.xml

[Fatal Error] abc.xml:1:8: The processing instruction target matching "[xX][mM][ lL]" is not allowed. Parsing error, line 1, URI file:/C:/Program%20Files/Java/jdk1.6.0_13/bin/abc.xml

The processing instruction target matching "[xX][mM][lL]" is not allowed.

What does it mean? Please help.

Here is my xml file if needed.(abc.xml):

    <?xml version="1.0" encoding="UTF-8" ?> 
  <bookstore>
  <book开发者_运维知识库 category="COOKING">
  <title lang="en">Everyday Italian</title> 
  <author>Giada De Laurentiis</author> 
  <year>2005</year> 
  <price>30.00</price> 
  </book>

  <book category="CHILDREN">
  <title lang="en">Harry Potter</title> 
  <author>J K. Rowling</author> 
  <year>2005</year> 
  <price>29.99</price> 
  </book>
  </bookstore>


it seems like you have spaces in your xml file before xml tag

if so, remove them

0

精彩评论

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