This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes XSLT and JAXB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSLT and JAXB" Watch "XSLT and JAXB" New topic
Author

XSLT and JAXB

Nitti Lin
Ranch Hand

Joined: May 15, 2003
Posts: 39
Hi guys,

I'm using XSLT to transform XML and use Jaxb to parse the transformed XML, but received error saying

"The markup declarations contained or pointed to by the document type declaration must be well-formed."

After I traced into it, in Something.xsd file and the line that caused problem is
"<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="1.0">"

That's the xsd file I defined to generate Jaxb classes. I do have a </xs:schema> end tag at the end of Something.xsd.

What I'm doing are....
1) I can use Something.xsd to generate Jaxb classes and this has been working for a while.
2) I used XSLT and Transformer to transform received XML into the same XML format as Something.xsd, and it generated an XML with the same format as Something.xsd. The generated XML has <!DOCTYPE>, which reference Something.xsd.
3) When I pass that transformed XML to my Jaxb classes, the unmarshaller complains about the line below
"<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="1.0">"
saying it's not well-formed.

Does anyone have any ideas what's going on or is there any way that I can make transformed XML without showing "<!DOCTYPE>"?

Thanks,

Nitti


SCJP, SCWCD, SCJD, (SCEA, MCSD.net)
Nitti Lin
Ranch Hand

Joined: May 15, 2003
Posts: 39
OK,

I work it out!

Nitti
 
GeeCON Prague 2014
 
subject: XSLT and JAXB