• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why to use DTD if the schema is more flexible/powerful?

 
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wonder
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Because DTD verification is simpler and faster than Schema verification.
Bill
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi William,
thanks for answering me. But by this logic it is even more simple avoid employing validation.
Then, since the syntax of DTD is not of XML, for me it sounds additional overburden to verifying application/programmer/user, etc.
Am I wrong?
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would certainly only validate if there is a chance of badly formatted data. In a system where well known programs communicate with each other it doesn't make sense to validata.
Fortunately there is usually a validate switch on XML parsers so you can experiment with it on and turn it off for production.
Bill
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks again, William.
Somehow I stay confused:
is it a some kind of pretext, just to give an error and refuse treating a data just because of some possibly insignificant error. I do not quite get the usefullness of validation and how it is working on distributed media. It makes more sense for me for debugging but it is not the case of XML as the Internet language
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Remember, XML gets created in many different ways. If I was teaching an XML course, I would insist on DTD/Schema validation. If I was offering a web service available to the public, I could use validation so that people trying to interface to the service could get feedback as to why it didn't work for them. If I was running a private service with well known clients - why bother.
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
William,
Thanks again for your patience but I miss the point.
I thought, that XML on Internet, is employed on the server side (forms, JSP transformed and sending to client as HTML document, etc.). How it can be otherwise? Than the validation errors are for (server-side) developer of XML document not for client (someone who did not create XML document). Now, to induce errors, except of the content of entering fields (for which XML validation is not in anyway user-friendly-way of informing. And how it is possible to understand, that painfully elaborated graphical UI incur low-level XML validation for interaction?), the client should change XML document (make to miss some attributes, etc.) Do you impl by your answer that client has access to XML source for mendling?
The essence of your information is still escaping me.
I thought the client introduces something in the form. It is the elements’ content/values (what is usually the the job of CGI, JSP). But how can a client induce the error of incorrect attribute, its missing, etc.?
I am missing where, why and how XML is employed.
I really need here some concrete examples.
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Here's an example of how a client/customer might be responsible for creating/altering XML and hence produce XML that needs validating.
The only time I've used XML in a commercial environment is on a B2B team. Customers would send us orders in XML, we'd send shipping notices, and they'd be all sorts of XML notifications that these XML documents had been received/notices that the order couldn't be filled/ billing and payment information. True, some of these orders were placed by filling in a web form which we controlled. But for most of the customers or clients, they were responsible for creating the XML and could do it in a variety of ways - using customisable B2B products, programming their own solutions, using portals such as Ariba. Basically, we didn't care how they created the XML but we needed a way of checking that what they created was valid. We used DTDs, largely because our B2B product used DTDs, but also because it was quicker, as William said. We used validation largely when setting up sizeable customers - to work with them to get the XML into a format acceptable to us both - and turned it off during production, unless problems arose.
Hope this helps to explain how it's possible for clients to produce unacceptable XML.
Kathy
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Kathy,I really appreciate your, with Willy, time, reading and responding to my questions.
I think I now should look for description of B2B
[ October 29, 2002: Message edited by: G Vanin ]
 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To answer your original question, DTD's have been around a lot longer than schemas. There are lots of applications out there using existing DTD's, and organizations are usually reluctant to re-write working stuff, unless there is an absolute need. However, Schemas do have a lot of advantages over DTD's, like true support for namespaces, support for datatypes (not just PCDATA/strings), and regular expression-like syntax for constraining your documents, among other things.
Even though DTD's do not have an XML-like syntax, they are pretty easy to use. Schemas on the other hand are extremely powerful, but have a lot more complexity. Ever tried reading the Schemas specification, Schemas Part 1 and Schemas Part 2?
Schemas is not just to way to constrain/validate your documents, but is a language in itself, and is an indispensable part of the WebServices/SOAP initiative. IMHO, it is the way to go, and will eventually replace DTD's but it might take a while.
[ October 29, 2002: Message edited by: Junaid Bhatra ]
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Agree with you most of your posting, but this one

IMHO, it is the way to go, and will eventually replace DTD's but it might take a while.


Nothing eventually replaces FORTRAN, LISP or COBOL yet. They are still very much alive. Don't count on it!!!
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot, Roseann and Junaid,
I certainly shall lokk over shortly.
I tried to use schemas according to MS MSDN's tutorials in XSLT processor and IE6.0. And they produce the results quite different from descriptions and each other.
 
Kathy Rogers
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
B2B is just business-to-business - it's commonly used for relationships between suppliers and their business customers. In the company I worked for, we were dealing with large companies that bought a lot of hardware/software, which we sold, so we could spend some time setting up the links and procedures so that they could order from us. It's called B2B to distinguish it from B2C, or business-to-consumer, your typical private individual buys from Amazon scenario. There are issues which are different for B2B - for example, controlling who can place orders within the customer organisation, offering restricted catalogues or discounts or other special services and most importantly, tying in the supplier's system with existing purchasing systems/practices at the customer organisation.
Hope this makes more sense of my last message!
Kathy
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, once more, Kathy,
I started to look for definition on Internet and it is hard to get to something short because there are a lot of links to round-about presentations on B2B, B2C...
 
Junaid Bhatra
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vanin,
One of the best resources for learning Schemas that I found on the net is Roger Costello's Schema tutorial. Check it out if you are interested.
Also, believe it or not, W3C's Schema primer is quite readable too.
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Junaid,
I have a strange feeling that it is more than enough - 50 MB zip of manual!
I even do not work with XML - just curious
[ November 06, 2002: Message edited by: G Vanin ]
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by G Vanin:
Thanks Junaid,
I have a strange feeling that it is more than enough - 50 MB zip of manual!
I even do not work with XML - just curious
[ November 06, 2002: Message edited by: G Vanin ]


If you are getting something free from internet which is really worth and if it is recommended by JR, please don't hestitate to download it at any cost.
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Balaji,
is it a joke? It is impossible to get everything. Mb it is necessary to sharpen the possibilities of extracting exactly what is needed
I am not a criminal to do such things like any cost
[ November 06, 2002: Message edited by: G Vanin ]
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I prefer the w3schools' tutorials much better. Concise and precise, easy to get you started. http://www.w3schools.com/schema/default.asp
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Roseann,
I saw it. It is even worse for saving-as.
I prefer
http://www.zvon.org/index.php?nav_id=3
i.e. anything saveable-as to diskettes.
Also I am going to write my own downloader because I save-as from library PC that does not permit to install downloader
reply
    Bookmark Topic Watch Topic
  • New Topic