Question on ANY (its use in RDF)

Roger L. Costello costello at mail11.mitre.org
Sun Jan 24 15:06:13 GMT 1999


I have a question about the ANY type.  It is my understanding
that an element defined to be of type ANY can contain any 
element that is defined *within* the DTD (i.e., it cannot use
elements that are not defined in the DTD).  Correct?

Consider the RDF.dtd (at bottom).  It defines an element rdf:Description
that is of type ANY.  Here is an example RDF XML document:

<?xml version="1.0"?>
<!DOCTYPE rdf:RDF SYSTEM "RDF.dtd">
<rdf:RDF xmlns:cat="http://db2.ibm.com"
         xmlns:rdf="http://www.w3.org/schemas/rdf-schema">
  <rdf:Description about="http://db2.ibm.com/catalogs">
     <cat:tables>
       <rdf:Bag>
         <rdf:li> 
           <rdf:Description><systables cat:tname="SYSTABLES"
cat:owner="SYSIBM  " cat:colnos="38"/></rdf:Description> 
         </rdf:li>
         <rdf:li> 
            <rdf:Description><syscolumns cat:tname="SYS &lt; COLUMNS"
cat:owner="SYSIBM  " cat:colnos="34"/></rdf:Description> 
          </rdf:li>
      </rdf:Bag>
     </cat:tables>
  </rdf:Description>
</rdf:RDF>

How can rdf:Description contain the element cat:tables?  It is
not defined in rdf.dtd.  I thought that ANY says that the element
can contain any elements defined *within* the DTD?  /Roger

Here is RDF.dtd:

<!ENTITY % container  "( rdf:Seq | rdf:Bag | rdf:Alt )">
<!ENTITY % rdfObj "( rdf:Description | %container; )">
<!ELEMENT rdf:RDF ( %rdfObj; )* >

<!ENTITY % property "ANY">

<!ELEMENT rdf:Description %property;>

<!ATTLIST rdf:Description
          ID NMTOKEN #IMPLIED
          about CDATA #IMPLIED
          aboutEach CDATA #IMPLIED
          bagID NMTOKEN #IMPLIED
>

<!ENTITY % collmember "rdf:li">

<!ELEMENT rdf:Seq ( %collmember; )*>
<!ATTLIST rdf:Seq
          ID NMTOKEN #IMPLIED>
 <!ELEMENT rdf:Bag ( %collmember; )*>
<!ATTLIST rdf:Bag
          ID NMTOKEN #IMPLIED>
<!ELEMENT rdf:Alt ( %collmember; )+>
<!ATTLIST rdf:Alt
          ID NMTOKEN #IMPLIED>

<!ENTITY % value "( %rdfObj; | PCDATA )">

<!ELEMENT rdf:li ( %value; )>
<!ATTLIST rdf:li
          resource CDATA #IMPLIED>


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list