[Playlist] DTD for XSPF

Hans Engel engel at engel.uk.to
Sun Dec 9 16:21:24 UTC 2007


That sounds like a good idea.

On Sat, 2007-12-08 at 22:25 -0800, Lucas Gonze wrote:
> For places where DTD just can't do the job, would we help out people who 
> insist on using it by providing your DTD and documenting the 
> shortcomings of the approach?  There's quite a few !1 and !2 there --- 
> does the remainder cover enough turf to be more of a help than not?
> 
> Hans Engel wrote:
> > No, I have not yet done so, but I will right now. Here are the results,
> > checked with xmlstarlet and my DTD:
> > 
> > Pass:
> > playlist-empty-annotation.xspf					OK
> > playlist-empty-creator.xspf					OK
> > playlist-empty-meta.xspf					OK
> > playlist-empty-title.xspf					OK
> > playlist-extension.xspf						!1
> > playlist-extensive.xspf						!2
> > playlist-inverted-order.xspf					!3
> > playlist-namespace-nested-proper.xspf				!4
> > playlist-namespace-nondefault.xspf				!
> > playlist-namespace-two-additions.xspf				!
> > playlist-relative-paths.xspf					OK
> > playlist-whitespace-dateTime.xspf				OK
> > track-empty-album.xspf						OK
> > track-empty-annotation.xspf					OK
> > track-empty-creator.xspf					OK
> > track-empty-meta.xspf						OK
> > track-empty-title.xspf						OK
> > track-extension.xspf						OK
> > track-extensive.xspf						!2
> > track-inverted-order.xspf					!3
> > track-whitespace-anyURI.xspf					OK
> > track-whitespace-nonNegativeInteger.xspf			OK
> > ------------------------------------------------------------------
> > Fail (OK is good here):
> > playlist-attribute-forbidden-annotation.xspf			OK
> > playlist-baddate.xspf						!2
> > playlist-badversion.xspf					!2
> > playlist-broken-relative-paths.xspf				!2
> > playlist-element-forbidden-attribution.xspf			OK
> > playlist-markup-annotation.xspf					OK
> > playlist-markup-creator.xspf					OK
> > playlist-markup-meta.xspf					OK
> > playlist-markup-title.xspf					OK
> > playlist-missingtracklist.xspf					OK
> > playlist-missingversion.xspf					OK
> > playlist-namespace-missing.xspf					!
> > playlist-namespace-nested-broken.xspf				OK
> > playlist-namespace-wrong-string.xspf				!
> > playlist-nonleaf-content-attribution.xspf			OK
> > playlist-nonleaf-content-playlist.xspf				OK
> > playlist-nonleaf-content-trackList.xspf				OK
> > playlist-noturi-attribution-identifier.xspf			!2
> > playlist-noturi-attribution-location.xspf			!2
> > playlist-noturi-extension.xspf					!2
> > playlist-noturi-identifier.xspf					!2
> > playlist-noturi-image.xspf					!2
> > playlist-noturi-info.xspf					!2
> > playlist-noturi-license.xspf					!2
> > playlist-noturi-link-content.xspf				!2
> > playlist-noturi-link-rel.xspf					!2
> > playlist-noturi-location.xspf					!2
> > playlist-noturi-meta.xspf					!2
> > playlist-root-name.xspf						OK
> > playlist-toomany-annotation.xspf				OK
> > playlist-toomany-attribution.xspf				OK
> > playlist-toomany-creator.xspf					OK
> > playlist-toomany-date.xspf					OK
> > playlist-toomany-identifier.xspf				OK
> > playlist-toomany-image.xspf					OK
> > playlist-toomany-info.xspf					OK
> > playlist-toomany-license.xspf					OK
> > playlist-toomany-location.xspf					OK
> > playlist-toomany-title.xspf					OK
> > playlist-toomany-tracklist.xspf					OK
> > track-badint-duration.xspf					!2
> > track-badint-tracknum.xspf					!2
> > track-markup-album.xspf						OK
> > track-markup-annotation.xspf					OK
> > track-markup-creator.xspf					OK
> > track-markup-meta.xspf						OK
> > track-markup-title.xspf						OK
> > track-nonleaf-content.xspf					OK
> > track-noturi-extension.xspf					!2
> > track-noturi-identifier.xspf					!2
> > track-noturi-image.xspf						!2
> > track-noturi-info.xspf						!2
> > track-noturi-link-rel.xspf					!2
> > track-noturi-link.xspf						!2
> > track-noturi-location.xspf					!2
> > track-noturi-meta-rel.xspf					!2
> > track-toomany-album.xspf					OK
> > track-toomany-annotation.xspf					OK
> > track-toomany-creator.xspf					OK
> > track-toomany-duration.xspf					OK
> > track-toomany-image.xspf					OK
> > track-toomany-info.xspf						OK
> > track-toomany-title.xspf					OK
> > track-toomany-tracknum.xspf					OK
> > track-whitespace-in-between.xspf				!2
> > xml-error.xspf							OK
> > 
> > !1 - The inflexibility of DTDs has caused an error with this file,
> > because of the element <track> used inside the extension. <track> is
> > declared elsewhere, and it's confusing the parser.
> > 
> > !2 - Again, the inflexibility of DTDs are causing the problem here. I'll
> > try to figure out a way around this.
> > 
> > !3 - This one is my fault; I didn't pause to think that the elements
> > could be put in any random order.
> > 
> > !4 - I did not add the "xmlns" attribute to every element.
> > ------------------------------------------------------------------
> > Hm, well that really proved how bad DTDs are. I will fix with the DTD
> > what I can, but most of the problems here are due to the inflexibility
> > of the DTD format.. RNG is just better overall. I suppose that's why I'm
> > the first to make this DTD.
> > 
> > On Sat, 2007-12-08 at 16:36 -0800, Lucas Gonze wrote:
> >> Many thanks for making this, Engel.
> >>
> >> Have you tested it against the testcases at 
> >> https://trac.xiph.org/browser/trunk/xspf/testcase?  If so, how did it fare?
> >>
> >>
> >>
> >> Hans Engel wrote:
> >>> I forgot to add: This DTD was made from the Relax NG Schema on the XSPF
> >>> site.
> >>>
> >>> On Sat, 2007-12-08 at 14:44 -0700, Hans Engel wrote:
> >>>> Hi,
> >>>> I just finished developing a DTD (Document Type Definition) for XSPF to
> >>>> use. This way, a doctype can be declared in each XSPF file and be more
> >>>> easily validated.
> >>>>
> >>>> You can download the doctype here:
> >>>>
> >>>> http://engel.uk.to/etc/xspf.dtd
> >>>>
> >>>> To reference this doctype in your XSPF files, insert this line before
> >>>> "<?xml":
> >>>>
> >>>> <!DOCTYPE playlist PUBLIC "XSPF" "http://engel.uk.to/etc/xspf.dtd">
> >>>>
> >>>> Thanks,
> >>>> Engel
> >>>>
> >>>>
> >>>> _______________________________________________
> >>>> Playlist mailing list
> >>>> Playlist at lists.musicbrainz.org
> >>>> http://lists.musicbrainz.org/mailman/listinfo/playlist
> >>>
> >>> _______________________________________________
> >>> Playlist mailing list
> >>> Playlist at lists.musicbrainz.org
> >>> http://lists.musicbrainz.org/mailman/listinfo/playlist
> >>>
> >>>
> >>
> >> _______________________________________________
> >> Playlist mailing list
> >> Playlist at lists.musicbrainz.org
> >> http://lists.musicbrainz.org/mailman/listinfo/playlist
> > 
> > 
> 
> 
> _______________________________________________
> Playlist mailing list
> Playlist at lists.musicbrainz.org
> http://lists.musicbrainz.org/mailman/listinfo/playlist




More information about the Playlist mailing list