This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes DTD in XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "DTD in XML" Watch "DTD in XML" New topic
Author

DTD in XML

Mi Na Mi
Greenhorn

Joined: Jan 09, 2012
Posts: 4
Hello,
I have 2 xml files with dtd defined right inside the xml files. I merge those two files, but the output xml file is completely missed. Is any way to read a definition of dtd inside the xml??
Thank you.

Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19728
    
  10

The parser will take care of reading the DTD, it's not up to you. I don't understand what this "output file" is and what it means for it to be "completely missed", though. Perhaps you could explain in a bit more detail?
Mi Na Mi
Greenhorn

Joined: Jan 09, 2012
Posts: 4
I merge two xml files, and both of them have dtd declaration, but merged file does not contain a dtd
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19728
    
  10

That's because you didn't put one there. You didn't say how you merged the two files, but there's no reason why the merged result should have any DTD at all and no reason why a DTD for the merged result should have any relationship with the DTDs for the input files. So if you want the result to have a DTD, it's up to you to make that happen.
Mi Na Mi
Greenhorn

Joined: Jan 09, 2012
Posts: 4
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: DTD in XML
 
It's not a secret anymore!