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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Question on ANY (its use in RDF)

[ Lists Home | Date Index | Thread Index ]
  • From: costello@mail11.mitre.org (Roger L. Costello)
  • To: xml-dev@ic.ac.uk
  • Date: Sun, 24 Jan 99 10:05:35 -0500

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@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)





 

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

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