Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > BOOK: Beginning XML 3rd Edition
BOOK: Beginning XML 3rd Edition
This is the forum to discuss the Wrox book Beginning XML, 3rd Edition by David Hunter, Andrew Watt, Jeff Rafter, Jon Duckett, Danny Ayers, Nicholas Chase, Joe Fawcett, Tom Gaven, Bill Patterson; ISBN: 9780764570773
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning XML 3rd Edition 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
Old February 3rd, 2006, 06:06 PM
Registered User
Join Date: Jan 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Default values in XMLSchema

   I just want to mention, first, that all files referred to in my question were validated by the Schematron validator.

     When, in chapter 4, we created a .dtd file and an .xml file which used that dtd, one of the attributes we created was "period" and we created it with a default value of "Cretaceous". Then, in dinosaurs5.xml and later iterations, we left out the "period" attribute on Gallimimus Bullatus. Nonetheless we had declared a default value for "period" and, sure enough, when I brought up our dinosaur xml file, in Firefox or in IE, the browser showed an attribute of "period='Cretaceous'" for Gallimimus, even though we had not entered one in the .xml file. This was correct behavior and I only mention it to compare to it what happened in Chapter 5.

     In Chapter 5 we use XMLSchemas to achieve the same purpose that our dtd served in the previous chapter. Again, we create a "period" attribute and assign a default value of "Cretaceous". It is part of our DinoAttributes attributeGroup and it looks like this:
     <attribute name="period" type="token" default="Cretaceous" />

     Here's the difference, and here is my question: when I call up dinosaurs10.xml (or dinosaurs9.xml for that matter)in my browsers, there is NO period attribute listed for Gallimimus Bullatus. It is just not there. But it should be there, right?! So what is going on here? It would seem that the browsers don't understand XMLSchema as well as they do DTDs. Is this a browser bug, or what is it?

     I really appreciate your input on this, as it is inexplicable to me. Thank you.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Default Field Values tachtenberg Reporting Services 1 February 19th, 2008 05:52 PM
setting default values prithvi28 XSLT 1 October 3rd, 2006 01:38 PM
Default Values for Query Odifius Access VBA 3 September 20th, 2006 06:30 AM
Default values? Raymie_C Access VBA 2 May 16th, 2005 11:48 AM
Default Values davest Access VBA 2 October 19th, 2004 05:57 AM

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