Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
| Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 23rd, 2007, 03:19 PM
Authorized User
 
Join Date: Apr 2006
Location: Raleigh, NC, USA.
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Default Convert DTD to Schema

I am in the process of converting our companies DTD to a Schema, I was asked to put a plan of convincing reasons to convert to Schema.
Here is what I know about our application, it doesn't support namespaces. Would that limit the use of a Schema? Also, what benefits are we missing for leaving namespaces not supported?

Thanks,
Bill

  #2 (permalink)  
Old March 23rd, 2007, 03:45 PM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

The benefits of moving to schema depend on what you want to do with them. If you only need to do the things that you can do with DTDs then the benefits are not great: the main ones are that there are probably now more tools and skills available. The main things that you can do with schemas that you can't do with DTDs are (a) validate the content as well as the structure of the document, (b) define mappings ("data binding") to languages such as Java, (c) do strongly-typed (and therefore more robust) XSLT and XQuery, (d) control exactly when validation takes place and which schema to use for validation, (e) make better use of namespaces.

You can use schemas without using namespaces, but if you do use namespaces then schemas are much better than DTDs because DTDs aren't namespace-aware.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
  #3 (permalink)  
Old March 23rd, 2007, 06:24 PM
Authorized User
 
Join Date: Apr 2006
Location: Raleigh, NC, USA.
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It's interesting how the use of a DTD or Schema depends on what you need to do with them. My main reason was to keep the company (and myself) up to date with the current XML related technologies.
Can you please let me know what you think about not using namespaces, and what benefits namespaces would do for our application. I'll tell you a little bit about our application, we display digital books marked up in XML.
  #4 (permalink)  
Old March 24th, 2007, 02:42 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

If you're only going to use a schema internally, and not use it in conjuction with another schema, for instance where you have the book schema as part of a library that also has schema for CDs etc, then not using namespaces will probably not be a problem, although you will find less support from editing tools in this case.
The main use of namespaces is to differentiate elements with a similar local name, e.g a table in a book and a table in a furniture store, to take a silly example. The namespace acts to separate these so that they can be processed separately, by XSLT for example.

--

Joe (Microsoft MVP - XML)
  #5 (permalink)  
Old March 24th, 2007, 08:01 AM
Friend of Wrox
Points: 1,676, Level: 16
Points: 1,676, Level: 16 Points: 1,676, Level: 16 Points: 1,676, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2006
Location: , , .
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Joe, in your opinion do you think DTDs are being phased out?

Bones
  #6 (permalink)  
Old March 24th, 2007, 08:45 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Most people seem to be choosing XML Schemas over DTDs but there are still an awful lot of DTDs around that will probably never be converted. There are alos a few things DTDs do that schemas cannot, like declaring entity references.

--

Joe (Microsoft MVP - XML)
  #7 (permalink)  
Old March 24th, 2007, 09:05 AM
Friend of Wrox
Points: 1,676, Level: 16
Points: 1,676, Level: 16 Points: 1,676, Level: 16 Points: 1,676, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2006
Location: , , .
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Thats true. But rather than declaring entity references you can use the doc() to bring in external content?

I will admit I know very lillt about DTD's but they seem very very complicated when there are many external references...

thoughts?


  #8 (permalink)  
Old March 25th, 2007, 06:39 PM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Namespaces start to become useful when you are dealing with many different XML vocabularies especially if they are designed by different teams or organizations; they are especially useful when you are sharing XML with other organizations and need to have formal change control over the design. So a lot depends on how you expect your application to grow.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automated tool to convert XML from DTD to DTD lsantos2000 XSLT 2 October 17th, 2007 08:21 AM
Convert DTD to schema boknoy XML 1 March 28th, 2007 03:51 AM
Can XSLT read DTD/schema and Generate XSLT.. ROCXY XSLT 1 November 6th, 2006 09:39 AM
Schema to Schema conversion onlyda XSLT 5 March 23rd, 2006 12:25 PM
XML validation with Schema/DTD using JAXP Hendrik XML 0 December 28th, 2004 06:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.