[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to use groups with mixed content models
Hi, I am trying to use the following declarations to give me a content model that would be expressed as <!ELEMENT title (#PCDATA|emph|note|target|xref)*> in an XML DTD but I would like to use element groups to get the same benefits as parameter entities. Here are the definitions: <xsd:element name="title"> <xsd:annotation> <xsd:documentation>a descriptive title</xsd:documentation> </xsd:annotation> <xsd:complexType mixed="true"> <xsd:group ref="text-model"/> </xsd:complexType> </xsd:element> <xsd:group name="text-model"> <xsd:annotation> <xsd:documentation>the group of elements that are used inside a text or paragraph element</xsd:documentation> </xsd:annotation> <xsd:choice minOccurs="0" maxOccurs="unbounded"> <xsd:element ref="emph"/> <xsd:element ref="note"/> <xsd:element ref="target"/> <xsd:element ref="xref"/> <xsd:any namespace="##other"/> </xsd:choice> </xsd:group> The following fragments illustrate the problem: OK <title>A test title for checking a schema definition</title> <title><emph>A test title for checking</emph><note>a schema definition</note></title> <title>A test title for <emph>checking</emph><note>a schema</note>definition</title> BAD <title><emph>A test title for checking</emph><note>a schema</note>definition</title> <title>A test title for <emph>checking</emph> a <note>schema</note>definition</title> I assume that it is that the group is not mixed in the sense that a complex type is or am I completely in the wrong direction? Any help would be appreciated. Regards, Ben -- *************************** Dr Benjamin Ryan Senior Technical Consultant C-Elect Tel: +(44) 1484 517077 Fax: +(44) 1484 517068 ***************************
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|