I noticed an oddity when converting DTDs to Schemas using XMLSPY. I added an unparsed content entity (image) as described on pages 62 -65 of our XML book. I used the ENTITY/NOTATION/ELEMENT/ATTLIST sequence as described in figure 4.17 on page 65. The DTD validated just fine. When I converted it to Schema using XMLSPY, one of the resulting lines in the Schema was the following:
<xs:notation name="jpeg" system="image/jpeg"/>
For some reason, validating the Schema failed until I changed this to:
<xs:notation name="jpeg" system="image/jpeg"></xs:notation>
Has anyone else noticed anything similar?
This site is organized like an interview/FAQ about DTD's and Schema's. explains differences, similarities, when to use which, and what well-formed and valid are.
http://archive.devx.com/projectcool/developer/xmlz/xmlinact/extensibility.html
-- A simple difference between well-formed and valid
http://archive.devx.com/projectcool/developer/xmlz/xmlzquick/valid.html
--An explanation / example of Well-Formed XML and how to do it
http://archive.devx.com/projectcool/developer/xmlz/xmldoc/well.html
Since XML has recently moved from document-center environment to
data-centric environment DTD's are of less importance when compared to Schema.The strength and weaknesses of DTD's and Schema is very well explained in the book"XML Schemas" by Chelsea Valentine, Lucinda Dykes and Ed Tittel.The book deals in a precise manner on DTD and Schema structures and functions with examples.
It deals with document -Focused versus Data-Focused and also has a very good argument on why Schema are better than DTD's.
This article talk about understanding the difference between DTDs and Schemas arguments with their pros and cons.
http://asia.cnet.com/builder/program/dev/0,39009360,39095541,00.htm
| Here is a link to a MS XML Validator in JavaScript and VBscript that uses IE 5.0+ for both MAC and PC. Four files are included validate_js.htm, validate_vbs.htm, WeatherReport.xml, and WeatherSchema.xml. Just load those files into a directory or on a website and point your IE 5.0+ browser to the validate_js.htm or validate_vbs.htm. You have the option to paste XML into an HTML form or enter a URL. Of course the browser must be able to locate the Schema for that XML file. http://msdn.microsoft.com/downloads/samples/internet/default.asp?url=/downloads/samples/internet/xml/xml_validator/default.asp |
| Here is a Microsoft link with lots of additional information on XML: MSDN Online - XML: http://msdn.microsoft.com/workshop/xml/index.asp |
http://builder.com.com/article.jhtml?id=u00320020418adm01.htm
Article briefly touches on the shortcomings of DTDs and discusses the basics of a newer, more powerful standard: XML Schemas. The article touches the possibilities of XML Schemas, and gives you a good grounding in the basics so that you can explore writing them on your own.
http://devcentral.iftech.com/articles/XML/intro_XML_schemas/default.php
This article discusses some problems with DTDs and says that XML Schema answers these problems. The site goes on to give you some good examples of some schemata.
http://www.fawcette.com/xmlmag/2002_04/online/online_eprods/xml_dwahlin04_22/default_pf.asp
The article says that the Document Type Definition (DTD) validation format has been used for many years to validate SGML and XML documents. But now, with the release of XML schemas, a more powerful mechanism for validating XML documents is now available. The site lists the concept pf Namespaces as being only availble to Schemas and this is a great advantage in prevening naming conflicts.
http://www.brics.dk/~amoeller/XML/schemas/dtd-problems.html
The title of this page is pretty self explanatory. This site lists some basic problems with DTDs such as there are no constraints on character data, too simple attribute value models, and the list goes on.
http://www.javacommerce.com/tutorial/xmlj/dtd.htm
This site describes what a DTD is and when to use an internal, external, or shared DTD.
Useful and helpful sub sites of this page include:
Elements - http://www.javacommerce.com/tutorial/xmlj/element.htm
Attributes - http://www.javacommerce.com/tutorial/xmlj/attribut.htm
Entities - http://www.javacommerce.com/tutorial/xmlj/entities.htm
Castor XML is an XML databinding framework. Unlike the two main XML APIs, DOM (Document Object Model) and SAX (Simple API for XML) which deal with the structure of an XML document, Castor enables one to deal with the data defined in an XML document through an object model which represents that data.
Link to Castor Application
Castor is a cool tool to convert XML Schema into JAVA classes that contain ELEMENT and ATTRIBUTE SET and GET CLASS METHODS as well as marshall and unmarshall CLASS METHODS to convert of XML into JAVA Objects and back into XML.
http://www.w3.org/TR/xmlschema-0/
This is an excellent document created by the W3C for explaining XML Schema. It is more or less a specification written in 'plain' English with examples to illistrate how to use each part. It is not something to be read in passing, but if you work with XML Schema on a job or on co-op, you will find it very handy (trust me!).
-Josh
I love w3schools.com. Their tutorials are very simple and easy to follow, and give plenty of good examples. Here are tutorials for DTDs & Schemas:
1) Learn DTD: http://www.w3schools.com/dtd/default.asp
2) Learn Schema: http://www.w3schools.com/schema/default.asp
PS- If you had a hard time understanding DTDs & Schemas from the assigned readings in the book, I think you'll find these tutorials a lot easier.
The following information comes from a colleague on an XML interest distribution list here at Xerox. It has some very useful links.
~~~~~~~~~~~~
1. Think of this as lint for your XML Schema:
http://www.alphaworks.ibm.com/tech/xmlsqc
Reads Schemas XML Schemas and attempts to determine if they are 100% valid under all the various constraints that apply to schemas.
If it determines they are not valid, it attempts to explain the problem in language that a schema novice could probably understand.
2. Good, long XML Schema tutorial with an example for every problem:
It's a ZIP file with 3 PPT presentations and examples. Each page of the PPT addresses a specific scenario.
http://www.xfront.com/xml-schema.html
3. A shorter XML Schema tutorial with examples:
http://www.zvon.org/xxl/XMLSchemaTutorial/Output/series.html
4. Command-line validator in Python (single-click install in Windows as Linux)
Download from: http://www.ltg.ed.ac.uk/~ht/xsv-status.html
5. An online HTML form-based interface for validating schemas and instance documents using.NET framework.
Use online: http://www.gotdotnet.com/services/xsdvalidator/
Download at: (broken link; reporting to Microsoft).
6. Online Schema Inference
Creates an XML Schema definition language (XSD) schema from an XML instance document.
When provided with well-formed XML file, the utility generates an XSD that can be used to validate that XML file.
You can also refine the XSD generated by providing the tool more wellformed XML files.
Use online: http://www.gotdotnet.com/team/xmltools/xsdinference/
Download at: http://www.gotdotnet.com/team/xmltools/xsdinference/XSDInference.exe