[Playlist] Schema files and element order

Tim Mccune tmccune at yahoo-inc.com
Tue Feb 20 19:06:46 UTC 2007


On Sun, 2007-02-18 at 17:16 +0100, Sebastian Pipping wrote:

> Lucas Gonze wrote:
> > Ok, so it's really not possible to do an XML Schema where the element
> > order doesn't matter.  That's significant.
> > 
> > In that case I'm leaning towards abolishing or at least aggressively
> > deprecating the XSD, since it declares stuff invalid which is really
> > legal, and that will end up creating a separate dialect where element
> > order matters.
> 
> --------------------------------------------------------------------------
> I agree. I think we should
>  * leave the old XSD (0.2, which allowed to little) online
>    and mark it deprecated
>  * update the Relax NG file to the new one (0.5) if it fully passes
>    the current testsuite. I will have to check this.
> --------------------------------------------------------------------------



Seriously, guys, the Schema shouldn't be as complicated as Sebastian
makes it sound.


> > However, performance is a critical issue.  Yahoo is using the schema to
> > validate input files before storing them, which is (1) totally
> > reasonable and (2) performance intensive.  To switch over to RNG the
> > performance would have to be comparable.
> 
> --------------------------------------------------------------------------
> It depends on how Yahoo is matching the schema against the XSPF file.
> If they call an external tool they could see if switching to
> Relax NG and XMLStarlet is fast enough. Otherwise if their application
> is written in C++ they could use libSpiff for validation when the next
> version (which will BSD not LGPL) comes out.


The Music Web Services are written in Java.

SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema
("xspf.xsd").newValidator().validate(document);

XML Schema validation is built into the JDK, so it's that easy.  RelaxNG
validation, however, is not.  I just got it working and it was a pain in
the ass.  I'm using jing, and found a JAXP adaptor that someone wrote
for it.  Then I fixed a bug in jing that was throwing
NullPointerExceptions every time I tried to use it.  End result is that
RelaxNG validation is 30% slower than XML Schema validation.

Please don't throw out the XML Schema.  Just fix it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.musicbrainz.org/pipermail/playlist/attachments/20070220/14349c3c/attachment.htm


More information about the Playlist mailing list