Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
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
 
Old September 11th, 2003, 12:09 PM
Registered User
 
Join Date: Sep 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help with DTD

Hi,

I am trying to write a DTD for an element with any children (as long as it is wellformed XML).
eg: <boolean>
       <somechild>..</somechild>
    </boolean>
where the DTD has no knowledge of either the key or value of somechild. <!ELEMENT boolean ANY> did not work (using Xerces parser for C++).

Thanks
P Keshav
 
Old September 12th, 2003, 12:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to armmarti
Default

Hi,

When you write <!ELEMENT boolean ANY> in the DTD, it means that the content of the element type "boolean" can be anything(well-balanced XML snippet). But it doesn't mean that you can ommit the declaration of some descendant element of "boolean". For example, suppose you have the DTD declaration:

Code:
...
<!ELEMENT boolean ANY>
...
and XML document like this:

Code:
...
<boolean>
   <child1>content1<child11>content11</child11></child1>
</boolean>
...
Then you have to declare both "child1" and "child11" in the DTD. The only thing the "ANY" gives you is that the declared element is free to have any well-formed content, but it doesn't let you to miss element declarations of its descendant elements.

Regards,
Armen





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
Create DTD Lizane Java Basics 1 June 15th, 2007 06:51 AM
DTD question bcogney XML 1 April 8th, 2007 06:01 PM
Issue with DTD tgopal CSS Cascading Style Sheets 2 September 20th, 2006 04:15 AM
Which DTD? Snib HTML Code Clinic 2 July 16th, 2004 03:34 AM





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