Re: Relaxing package.xml v2 XSD
| From: | Brett Bieber | Date: | Sat, 10 May 2008 10:49:16 +0000 |
| Subject: | Re: Relaxing package.xml v2 XSD | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-50058@lists.php.net to get a copy of this message | ||
Hey Philippe,
On Thu, May 1, 2008 at 11:09 AM, Philippe Jausions
<Philippe.Jausions@11abacus.com> wrote:
> Hi,
>
> The current XSD for package.xml version 2
> (http://pear.php.net/dtd/package-2.0.xsd), doesn't allow simple nested
> folder structures without files in them.
You're right. The current XSD has some known issues when strictly
validating package.xml files.
>
> Anyone has any suggestions to remedy this trouble?
I think we should relax it. I recently conducted a survey on over 4922
PEAR package releases (all available from pear.php.net, and latest
releases from all channels listed on http://pear.php.net/channels/)
and found that 67% of releases don't validate against the package xml
schema. (Both 1 and 2)
We can look at this two ways I suppose -
1. the xsd is too strict
2. packages need better tools to handle package.xml validation
And a couple solutions...?
1. relax the schema
2. validate package.xml and reject releases that do not validate..?
Given that we have so many releases out in the wild that do not
validate, I think our efforts should focus on relaxing the schema.
The numbers should make it obvious that strict validation does not
matter to the current PEAR installer. But, this will change with
Pyrus, as strict validation for package files is checked using
DOMDocument::schemaValidate
> Would it be huge deal breaker to anyone to allow <dir> to not contain
> files, but just sub-<dir>?
I don't have any major objections to this... but I think it may be
hard to figure out a way to require a file at the end of it - to
prevent a package that just contains directories and no files. Is this
a concern we should be worried about?
But there are other issues that I think need to be addressed.
Specifically, the ordering of elements should be a little more
flexible directly under the package element. Here there is a very long
sequence requiring every element be present. While I'm fine with
requiring the presence of the elements, I think it should allow
flexible ordering.
I believe the best way is to change from sequence to choice - and
enumerate all the possible sequences. This would allow us to still
require that all elements be present, but allow more flexible
ordering. Although this would give us a very large schema file, and
would make it more difficult to make modifications to the file in the
future.
I think we should work up some patches for the package schema, and run
some tests to see what it looks like. As for your changes Philippe, I
think that sounds fine. I see no reason to not allow directories with
only subdirectories as the content, as long as there's a file at the
end of it.
--
Brett Bieber
http://saltybeagle.com/