Re: cvs: php4 /pear package.dtd
| From: | Stig S. Bakken | Date: | Sun, 24 Feb 2002 22:14:09 +0000 |
| Subject: | Re: cvs: php4 /pear package.dtd | ||
| References: | 1 2 | Groups: | php.pear.cvs |
| Request: | Send a blank email to pear-cvs+get-2603@lists.php.net to get a copy of this message | ||
On Sun, 2002-02-24 at 14:00, Tomas V.V.Cox wrote:
> Stig Bakken wrote:
> >
> > ssb Sun Feb 24 05:45:29 2002 EDT
> >
> > Modified files:
> > /php4/pear package.dtd
> > Log:
> > * fix broken dtd
> > # Tomas, there is no way to do what you want in the DTD without switching
> > # from XML to SGML. Sorry :-)
> >
>
> Well, I'm not a DTD guru (yesterday was the first day I read the SPECS
> from http://www.w3.org/TR/REC-xml). There says:
>
> "The optional character following a name or list governs whether the
> element or the content particles in the list may occur one or more (+),
> zero or more (*), or zero or one times (?). The absence of such an
> operator means that the element or content particle must appear exactly
> once.
>
> Examples of element-content models:
>
> <!ELEMENT spec (front, body, back?)>
> <!ELEMENT div1 (head, (p | list | note)*, div2*)>
> <!ELEMENT dictionary-body (%div.mix; | %dict.mix;)*>
> "
>
> What am I missing?
In SGML DTDs you can do:
<!ELEMENT a (b & c & d)>
meaning <a> must contain <b>, <c> and <d>. In XML there is no
"&"
anymore, only "," and "|". That means you can not, in the DTD, specify
that a set of element may contain a specific number of times in any
order, only in a specific order, or like package.dtd is now, at least
one element has to occur at least once.
IMHO validating package.xml files requires more than the DTD can give
you. XML and DTDs are only about syntax and structure, while we need to
validate some logic too. I was thinking about using XML_Tree or a DOM
thingie.
But a DTD parser/validator is great anyway!
- Stig