Altova Mailing List Archives


ambiguous content model

From: Eike Jordan <jordan@----------.-->
To: xml-dev@-----.---.---
Date: 6/11/2003 11:21:00 AM
Hello list,

considering the following content model

   <table type="row">
     <title/>
     <tgroup>
       <title/>
       <integer/>
       <void/>
       <integer/>
     </tgroup>
     <tgroup>
       <title/>
       <void/>
       <real/>
       <real/>
     </tgroup>
   </table>

should be valid and

   <table type="row">
     <title/>
     <tgroup>
       <title/>
       <integer/>
       <real/>
       <real/>
       <integer/>
       <void/>
     </tgroup>
   </table>

should *not*

which means that a table should consist of *one* title and *one-or-more* table-groups.
each table-group should consist of *one* title and *one-or-more* of
*integer-or-void*, *real-or-void* or *text-or-void*
with my approach i'm caught in a trap of an 'ambigous content model':

<!ENTITY % real.mix    "(real    | void)">
<!ENTITY % integer.mix "(integer | void)">
<!ENTITY % text.mix    "(text    | void)">
<!ENTITY % tableContent.mix "
     ((%integer.mix;)+)     |
     ((%real.mix;)+)        |
     ((%text.mix;)+)
">

<!ENTITY % tableType.att "type  (row|column) #REQUIRED">

<!ELEMENT table (
    title,
   (tableInput)+,
   (description)?)
 >
<!ATTLIST table
    tableType.att;
 >

<!ELEMENT tableInput (
   (
    (title),
    (%tableContent.mix;)
   )
)>
<!ELEMENT integer (#PCDATA)>
<!ELEMENT real    (#PCDATA)>
<!ELEMENT void    (#PCDATA)>
<!ELEMENT text    (#PCDATA)>
<!ELEMENT title   (#PCDATA)>
<!ELEMENT description (
   (text)+)
 >

i don't know if this problem can be solved with a XML-DTD but perhapes someone
has an idea how to make it 'non-ambiguous'

thanx in advance
-- 
Eike Jordan  <jordan@f...>

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.