OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] DTDs newbie question

[ Lists Home | Date Index | Thread Index ]

<snip/>

> but now i want to define a element 'registry' which a value struct like
> this: Do i need a schema for that ?

You need to declare it within your DTD, yes. The DTD is a schema but it is
not an XML Schema-- you probably know that but just to be clear. Simply add

<!ELEMENT registry (value) >

To your DTD. So this document would be valid:

<?xml version="1.0"?>
<!DOCTYPE registry [
 <!ELEMENT registry (value) >
 <!ELEMENT value (string | int | struct) >
 <!ELEMENT int (#PCDATA) >
 <!ELEMENT string (#PCDATA) >
 <!ELEMENT struct (member)+ >
 <!ELEMENT member (name, value) >
 <!ELEMENT name (#PCDATA)>
]>
<registry>
  <value>
    <struct>
      <member>
        <name></name>
        <value>
          <string></string>
        </value>
      </member>
    </struct>
 </value>
</registry>

All the best
Jeff Rafter
Defined Systems
http://www.defined.net
XML Development and Developer Web Hosting






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS