[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: How to use groups with mixed content models

  • From: Nicolas LEHUEN <nicolas.lehuen@u...>
  • To: 'xml-dev' <xml-dev@l...>
  • Date: Tue, 03 Jul 2001 16:50:08 +0200

xsd group
That's very interesting since I have exactly the same problem and tried the
same solution, with the same results. I'm using the XML Spy schema
validator, and I am suspecting a bug in the validator. So I have to confess
that I threw the whole schema and wrote it in RELAX NG. It was a breeze.
Funny to see how DTD are cool, finally :)

So let's be a little bit more constructive. Maybe it could be written using
a substitution group or inheritance ? We would have each element such as
title, emph, b, i and so on inheriting from the text-model complex type.
Have you tried this ? Or better, maybe someone has solved the whole problem
!

Regards,
-----------------------------------------------------------
Nicolas Lehuen
Responsable R&D - Head of R&D
Ubicco - Multi Access Software Solutions
http://www.ubicco.com/

>-----Message d'origine-----
>De : Ben Ryan [mailto:b_ryan@c...]
>Envoye : mardi 3 juillet 2001 16:18
>A : xml-dev
>Objet : 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
>***************************
>
>------------------------------------------------------------------
>The xml-dev list is sponsored by XML.org, an initiative of OASIS
><http://www.oasis-open.org>
>
>The list archives are at http://lists.xml.org/archives/xml-dev/
>
>To unsubscribe from this elist send a message with the single word
>"unsubscribe" in the body to: xml-dev-request@l...
>

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.