Search code examples
xmldtdmixed-content

DTD Mixed Content with AND operator


I created a .dtd with a Framemaker .edd. I did this with a old script but it creates some mistakes...

I don't know if it's possible because I was searching for a long time without success.

The script creates a Element definition like this:

<!ELEMENT BodyText 
      ((#PCDATA | Bold | Data | Link | Subscript | Graphic | SpecialCharacter |
      SpecialTerm | Superscript | Italic | E_Norm | H_Norm | WebCable | fm:Linefeed | 
      fm:UserVar)*, Index*, CCN*) >

I think its clear what I'd like to produce:

The Elements in the first brackets can occur as often as its supposed to. The other Elements (index and CCN) have to occur in that order and after those elements it shouldn't be possible to add one of the other ones.

Could anyone provide a solution?


Solution

  • Your desired content model cannot be expressed using XML content models, because XML requires content models with #PCDATA (mixed content models) to have either the form (#PCDATA) or (#PCDATA | element1 | ...) according to the Extensible Markup Specification, section 3.2.2. FrameMaker EDDs/FrameMaker SGML can use unrestricted, full SGML which doesn't have this limitation (along with all the other restrictions imposed on the XML subset/profile of SGML such as lack of tag inference in XML, and others).