| Author |
dtd parsing error
|
Josweth Reddy
Ranch Hand
Joined: Nov 02, 2005
Posts: 30
|
|
Hi Everyone, Im new to JAXB and Im deploying a sample application to unmarshal from the xml document. While using the xjc command to generate the jaav code,facing an error saying that "parsing a schema...[ERROR] The markup in the document preceding the root element must be well-formed." The below is the dtd file <!ELEMENT item_list (item_info*)> <!ELEMENT item_info (#PCDATA)> <!ELEMENT name (#PCDATA)> <!ELEMENT price (#PCDATA)> xjc command using xjc item.dtd item.xjs Please help me out to generate the java code by executing the xjc command. Thanks in advance, Josweth Reddy
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12267
|
|
Just glancing at the XJC documentation here it appears that xjc assumes all input files are schema so it is trying to parse your dtd as xml and fails giving you an XML parsing error. Bill
|
Java Resources at www.wbrogden.com
|
 |
Josweth Reddy
Ranch Hand
Joined: Nov 02, 2005
Posts: 30
|
|
Hi Bill, Thanks for the clarification. But I would like to develop a sample application using JAXB. Shall I go for the xsd file instead of dtd ?. Or else please tell me the alternate. Thanks, Josweth Reddy
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
Here is a link to an article about the architecture of JAXB. Notice how it continually mentions schemas? Anyway, if you scan it for "DTD" you will find it has some advice for what to do about DTDs.
|
 |
 |
|
|
subject: dtd parsing error
|
|
|