Re: [xsl] DTD question

Subject: Re: [xsl] DTD question
From: "W. Eliot Kimber" <eliot@xxxxxxxxxx>
Date: Fri, 24 Jan 2003 15:52:00 -0600
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