probably an obvious XML question

Date view Thread view Subject view Author view

From: John Klassa (klassa@mail.com)
Date: Wed Oct 04 2000 - 08:20:45 PDT


I'm slowly easing into the world of XML... In particular, I'm writing
the DTD for an importer that I'm writing, that'll use XML as its input
format.

I'm stuck on something that's probably obvious. I want to say that
element FOO can optionally contain other elements E1, E2, E3 and so on,
in any order. That is, I don't really want to say:

        <!ELEMENT FOO (E1?,E2?,E3?)>

because this implies that if E1 appears at all, it must come before E2,
does it not? I likewise don't want to write:

        <!ELEMENT FOO (E1|E2|E3)?>

because this allows for only one of them to appear. Likewise:

        <!ELEMENT FOO (E1|E2|E3)*>

allows E1 to appear sixty times if it wants to.

In my case, I don't care about the order in which they appear, so long
as I only get one of anything. I could just use my first example, and
require the elements in a particular order, but that seems unnecessarily
rigid. In my case, there are about twenty such E elements, so
enumerating all of the permutations is out. :-)

Anyone? Anyone? Buehler?

Again, I'm sure this is obvious to anyone whose spent time with XML.
I'm a newbie, so be gentle. :-)

Thanks,
John

-- 
John Klassa / klassa@mail.com


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Oct 04 2000 - 08:24:56 PDT