[relaxng-user] Re: Recursive structure with restrictions
Tor Helland
tor at helland.org
Sat Jul 3 10:29:21 ICT 2004
> > Playing with grammars, I found a solution demoed in the three documents
> > at the end of this email. I like the control I get over the structure,
> > and not repeating it.
> >
> > Is there a better way to achieve this, preferrably with one schema file?
> > Is there a simpler way, something obvious I have overlooked?
>
> Summer is here, and this list takes a dive, so I thought I had to answer
> myself.
>
> Using a general entity from the old xml and dtd world, I could replace the
> include element.
Summing up this monologue, just for the record :-)
And I still don't know if there are any better solutions.
Using the entity, I lose error reporting line numbers inside the entity
(using jing/xmlbuddy), and when I'm still coding the entity this is a
nuisance.
But the entity solution also allows me to include a pattern without
enclosing it
within a grammar, thus allowing easier access to global defines as well as
the
defines of the grammar containing the entity reference.
Using the include element, error reporting is good. But I don't like
splitting a structure across two files just for the mechanics of the schema
language. I like such splitting to reflect a separation of logic. (And in
the actual schema I was working on, not this demo, I ended up using two
entities.)
-tor
(a simple programmer who likes Relax NG for documenting his file format.)
More information about the relaxng-user
mailing list