Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Schema&DTO

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
What is difference between Schema & DTO?
How do you parse/validate the XML document?
Thanks
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Lakshmi siri:
What is difference between Schema & DTO?


I assume you meant DTD? In that case, the difference is that the DTD is more limited in terms of what you can describe compared to XML Schema.

Originally posted by Lakshmi siri:
How do you parse/validate the XML document?


Take a look at HowToValidateXmlAgainstSchema.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Parsers are essentially tools created for a specific purpose. For example, a DOM parser implements the DOM API and creates DOM in memory whereas SAX parser implements SAX API. Popular Example would be "Xerces" by Apache

Validating tools are necessary to enforce certain rules. E.g. Validating tools would check XML documents for well formedness and certain other basic criteria. These tools can also validate documents against schemas and DTDs.

Hope that helps!
Vidya
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The biggest differences are DTDs allow the use of Entities, Schemas allow the use Namespaces. Schemas also allow you to create more defined data types to validate against. DTDs only allow the use of default data types, for validation. Schemas can inherit from other schemas. Schemas are also well-formed XML so you can parse them with SAX or DOM.
 
Ranch Hand
Posts: 578
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to add on to what the ranchers have said

* Since SCHEMA is based on XML it does not require a seprate parser for reading it ..For DTD's on the other hand you need a seprate DTD parer to read the DTD's ..(I gues thats what Jay meant by saying taht u can parse schemas with SAX or DOM )
 
Yes, of course, and I accept that blame. In fact, i covet that blame. As does this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic