Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2
This is the forum to discuss the Wrox book Beginning XML, 4th Edition by David Hunter, Jeff Rafter, Joe Fawcett, Eric van der Vlist, Danny Ayers, Jon Duckett, Andrew Watt, Linda McKinnon; ISBN: 9780470114872
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2 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 November 2nd, 2009, 01:20 AM
Registered User
 
Join Date: Nov 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Declaring attributes for namespace declarations in DTDs.

On page 121 there is a special note about the need for declaring attributes in the DTD for the namespace declarations that will be used in the instance documents.

Quote:
As far as DTDs are concerned, namespace declarations, such as xmlns:contacts="http://wiley.com/contacts", are also treated as attributes. Although the Namespace Recommendation insists that xmlns statements are declarations and not attributes, DTDs must declare them in an ATTLIST declaration if they are used. Again, this is because the W3C finalized the syntax for DTDs before the Namespace Recommendation was completed.
However, no examples are given and the authors do not even mention what type to use. Can I assume that the following is correct:

Code:
<!ATTLIST rootElementName xmlns:contacts CDATA #IMPLIED>
Wouldn't this also imply that, once this is specified in the DTD that the writers of the instance documents are essentially locked in not only to always using the prefix chosen in the DTD but also they have no choice as to which namespace must be the default one?

Finally, if the DTD contained a #FIXED value for the namespace then isn't it true that the instance document wouldn't really need a namespace declaration at all?




Similar Threads
Thread Thread Starter Forum Replies Last Post
Mixed content in DTDs GrantRobertson BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2 0 November 2nd, 2009 12:40 AM
c# Forward declarations xyoavx C# 0 May 30th, 2009 07:44 AM
When to use NEW in declarations LarryMoore BOOK: Beginning Microsoft Visual Basic 2008 ISBN: 978-0-470-19134-7 8 September 24th, 2008 04:02 PM
Where are my control declarations? Ron Howerton ASP.NET 2.0 Basics 13 December 6th, 2007 03:11 PM
Variable Declarations New2ASPnet General .NET 1 July 30th, 2004 09:49 AM





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