• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

creating xml file using DTD

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to XML parsing. The project I have contains a DTD and I have to post a request XML and I will get the response XML. I will need to write java code to create & post the request XML and receive the repsonse XML and parse it. I was wondering If there are any APIs available which will help me build the XML using DTD or if someone can guide me through that will be awesome

Thank you very much.

R
 
Sheriff
Posts: 28321
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Normally (i.e. in real life) you don't take a DTD and produce an XML document from it. That makes very little sense given that there's usually an infinite number of XML documents that conform to any given DTD. You may well be given an XML document and told to parse it and use the DTD for validation, but that's a different thing entirely. So I suggest that you go back and clarify your requirements, as it seems you might not have understood them correctly.
 
r john
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:Normally (i.e. in real life) you don't take a DTD and produce an XML document from it. That makes very little sense given that there's usually an infinite number of XML documents that conform to any given DTD. You may well be given an XML document and told to parse it and use the DTD for validation, but that's a different thing entirely. So I suggest that you go back and clarify your requirements, as it seems you might not have understood them correctly.



Thank you for your response. I understand that DTD's are for validation purposes but was wondering if there is any way one can create an XML file using the DTD structure
through some API or free tool)

Also, what would be the best and easy way to create an XML file. JDOM is one. Any other anyone can suggest??

Thank you very much in advance.
 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello. I have been dabbling with xml using java also and so far I have found the XMLStreamWriter class useful for writing xml files.
 
Humans and their filthy friendship brings nothing but trouble. My only solace is this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic