[Home] [By Thread] [By Date] [Recent Entries]


<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



Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member