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

RE: content model question

  • To: "Morgan V. Cundiff" <mcundiff@l...>,<xml-dev@l...>
  • Subject: RE: content model question
  • From: "Tom Gaven" <tgaven@v...>
  • Date: Fri, 5 Apr 2002 09:16:27 -0800
  • Thread-index: AcHcw1fUmBdf45qJRX2ELTKJ2MGmWwAAiWKg
  • Thread-topic: content model question

model question
Morgan, 
   I don't think XML Schema schemas can constrain text this way. I believe XML Schema is similar
to DTD 'mixed content' in this regards.  However, RELAX NG does have this capability:

This RELAX NG schema: (compact syntax)

start = myelement
myelement = element myelement { text, mysubelement1, mysubelement2 }
mysubelement1 = element mysubelement1 { text }
mysubelement2 = element mysubelement2 { text }

should validate your document, and only allow 'text' prior to element mysubelementt.

tom

-----Original Message-----
From: Morgan V. Cundiff [mailto:mcundiff@l...]
Sent: Friday, April 05, 2002 11:57 AM
To: xml-dev@l...
Subject:  content model question



Is is possible to create an XML Schema content model for an element
containing mixed content (i.e. text and subelements) and to also specify
the sequence of the text and the subelements? For example an instance
might look like this:

<myelement>textblob
<mysubelement1>textblob1</mysubelement1>
<mysubelement2>textblob2</mysubelement2>
</myelement>

The goal is to constrain the content of <myelement> so that the textblob
must occur first and then be followed by <mysubelement1> and
<mysubelement2>

Thank you for your help.

Morgan Cundiff
Library of Congress




-----------------------------------------------------------------
The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://lists.xml.org/ob/adm.pl>


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.