Re: Faulty DTD of Object element

At 14:20 00/02/21 +0100, Gregor Karlinger wrote:
 >I think the DTD given in section 4.5 is incorrect (at least it contradicts
the
 >Schema definition):
 >
 >  <!ELEMENT Object (#PCDATA) >
 >
 >Is a understand the text of section 4.5, the Object element can also
encapsulate
 >any XML markup. Therefore the content model must be ANY instead of
(#PCDATA).

Ed is correct about the statement regarding ANY. (ANY = element types within
the DTD). Consequently, we use #PCDATA. XML1.0 does permit MIXED content
models:

        An element type has mixed content when elements of that type 
        may contain character data, optionally interspersed with child 
        elements. ...
        <!ELEMENT p (#PCDATA|a|ul|b|i|em)*>
        <!ELEMENT p (#PCDATA | %font; | %phrase; | %special; | %form;)* >
        <!ELEMENT b (#PCDATA)>
        http://www.w3.org/TR/REC-xml#sec-mixed-content

Such that we could do the following:
        <!ELEMENT SignatureMethod ((#PCDATA | HMACOutputLength)*) >
        <!ELEMENT Object ((#PCDATA  | SignatureProperties | Manifest)*) >
        <!ELEMENT KeyValue  ((#PCDATA | DSAKeyValue | RSAKeyValue )*) >

However, while I can get XMetalPro to compile and validate instances with
that declaration, I can't get IE (and I'm not sure if my declaration is bugg
or not ...) so I avoid them. I will add some structure to the schema to make
what is going on more clear though:

<element name='KeyInfo'> 
  <type content='elementOnly'>
    <group order='choice' minOccurs='1' maxOccurs='*'>       
	<element name='KeyName' type='string'/> 
	<element ref='ds:KeyValue'/> 
	<element name='RetrievalMethod' type='uri'/> 
	<element ref='ds:X509Data'/> 
	<element ref='ds:PGPData'/> 
	<element name='MgmtData' type='string' minOccurs='0' maxOccurs='1'/>
	<any />
    </group>
    <attribute name='Id' type='ID' minOccurs='0' maxOccurs='1'/> 
  </type> 
</element>

<element name='KeyValue'>
  <type content='mixed'>
    <element ref='ds:DSAKeyValue'/>
    <element ref='ds:RSAKeyValue'/>
    <any />
  </type>
</element>




_________________________________________________________
Joseph Reagle Jr.   
Policy Analyst           mailto:reagle@w3.org
XML-Signature Co-Chair   http://www.w3.org/People/Reagle/

Received on Thursday, 24 February 2000 19:42:29 UTC