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

Re: DTD question

Subject: Re: DTD question
From: "W. Eliot Kimber" <eliot@xxxxxxxxxx>
Date: Fri, 24 Jan 2003 15:52:00 -0600
baz bar foo
Hubert Holtz wrote:
Hy,

I know that this is not a real XSL question, but it's connected with this topic :-)

I have an element adress with several elements in it(prename, name, fax, phone,street...)
and I want that these elements only may appear once, but the order is not important, and that prename and name have to appear, the rest
don't have to but if they appear then just once of course.

How do I tell the dtd to do this?

Without SGML's "&" (and) operator, XML requires you to explicitly state each possible combination of elements. This is, in theory, always possible, but it usually results in such a large OR group of OR groups that it's not done. Easier to just state the rule in the DTD's documentation and enforce it in a separate validation application (which might be your main data processing application or something like Schematron).


For example, given this desired constraint: (foo & bar & baz) you can declare this content model:

((foo, bar, baz) |
 (foo, baz, bar) |
 (bar, foo, baz) |
 (bar, baz, foo) |
 (baz, foo, bar) |
 (baz, bar, foo))

Cheers,

Eliot
--
W. Eliot Kimber, eliot@xxxxxxxxxx
Consultant, ISOGEN International

1016 La Posada Dr., Suite 240
Austin, TX  78752 Phone: 512.656.4139


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

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
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.