[Playlist] portability, application page, schema files
Sebastian Pipping
webmaster at hartwork.org
Sat Jan 6 21:20:24 UTC 2007
Matthias Friedrich wrote:
>> Yes. I think we need to have one file per version
>> unless the scheme language is powerful enough
>> for stuff like "extension tags not for version zero".
>> can XSD and RNG do this?
>
> I don't think this is possible, so I changed the version to 1.
---------------------------------------------------------------------
I wrote a Bash script for Cygwin to test both new schema files
against the libSpiff test suite using xmlstarlet.
This way I found out that the RNG schema says "valid" much
too often. What irritates me is that this is also the case
where version is set to "0" although the RNG file
reads <param name="pattern">1</param> for version.
Is this a problem in the RNG file or in xmlstarlet?
Both bash script and output are attached.
Sebastian
-------------- next part --------------
#!/bin/bash
# ---------------------------------------------------------
# Written by Sebastian Pipping <webmaster at hartwork.org>
# License is Public Domain.
#
# 2007-01-06
# ---------------------------------------------------------
# ---------------------------------------------------------
# Reset log
# ---------------------------------------------------------
LOG_FILE="log.txt"
rm ${LOG_FILE} &> /dev/null
# ---------------------------------------------------------
# Init
# ---------------------------------------------------------
RNG_FILE=xspf-1_0.2.rng
XSD_FILE=xspf-1_0.2.xsd
FAIL_FILES=`ls fail/*.xspf`
PASS_FILES=`ls pass/*.xspf`
# ---------------------------------------------------------
# Test RNG
# ---------------------------------------------------------
echo "== RNG - Should have failed ==" >> ${LOG_FILE}
for fail_file in ${FAIL_FILES}; do
./xml validate --list-good --relaxng ${RNG_FILE} ${fail_file} >> ${LOG_FILE}
done
echo "" >> ${LOG_FILE}
echo "== RNG - Should have passed ==" >> ${LOG_FILE}
for pass_file in ${PASS_FILES}; do
./xml validate --list-bad --relaxng ${RNG_FILE} ${pass_file} >> ${LOG_FILE}
done
echo "" >> ${LOG_FILE}
# ---------------------------------------------------------
# Test XSD
# ---------------------------------------------------------
echo "== XSD - Should have failed ==" >> ${LOG_FILE}
for fail_file in ${FAIL_FILES}; do
./xml validate --list-good --xsd ${XSD_FILE} ${fail_file} >> ${LOG_FILE}
done
echo "" >> ${LOG_FILE}
echo "== XSD - Should have passed ==" >> ${LOG_FILE}
for pass_file in ${PASS_FILES}; do
./xml validate --list-bad --xsd ${XSD_FILE} ${pass_file} >> ${LOG_FILE}
done
# ---------------------------------------------------------
# Show log
# ---------------------------------------------------------
cat ${LOG_FILE}
-------------- next part --------------
== RNG - Should have failed ==
fail/libspiff_playlist_annotation_attribute_forbidden.xspf
fail/libspiff_playlist_attribution_element_forbidden.xspf
fail/libspiff_playlist_extension_in_v0.xspf
fail/libspiff_tracklist_empty_in_v0.xspf
fail/playlist_baddate.xspf
fail/playlist_badversion.xspf
fail/playlist_containshtml_annotation.xspf
fail/playlist_containshtml_creator.xspf
fail/playlist_containshtml_title.xspf
fail/playlist_missingtracklist.xspf
fail/playlist_missingversion.xspf
fail/playlist_noturi_attribution_identifier.xspf
fail/playlist_noturi_attribution_location.xspf
fail/playlist_noturi_extension.xspf
fail/playlist_noturi_identifier.xspf
fail/playlist_noturi_image.xspf
fail/playlist_noturi_info.xspf
fail/playlist_noturi_license.xspf
fail/playlist_noturi_link_content.xspf
fail/playlist_noturi_link_rel.xspf
fail/playlist_noturi_location.xspf
fail/playlist_noturi_meta.xspf
fail/playlist_toomany_annotation.xspf
fail/playlist_toomany_attribution.xspf
fail/playlist_toomany_creator.xspf
fail/playlist_toomany_date.xspf
fail/playlist_toomany_identifier.xspf
fail/playlist_toomany_image.xspf
fail/playlist_toomany_info.xspf
fail/playlist_toomany_license.xspf
fail/playlist_toomany_location.xspf
fail/playlist_toomany_title.xspf
fail/playlist_toomany_tracklist.xspf
fail/track_badint_duration.xspf
fail/track_badint_tracknum.xspf
fail/track_markup_album.xspf
fail/track_markup_annotation.xspf
fail/track_markup_creator.xspf
fail/track_markup_title.xspf
fail/track_noturi_extension.xspf
fail/track_noturi_identifier.xspf
fail/track_noturi_image.xspf
fail/track_noturi_info.xspf
fail/track_noturi_link.xspf
fail/track_noturi_link_rel.xspf
fail/track_noturi_location.xspf
fail/track_noturi_meta_rel.xspf
fail/track_toomany_album.xspf
fail/track_toomany_annotation.xspf
fail/track_toomany_creator.xspf
fail/track_toomany_duration.xspf
fail/track_toomany_image.xspf
fail/track_toomany_info.xspf
fail/track_toomany_title.xspf
fail/track_toomany_tracknum.xspf
== RNG - Should have passed ==
== XSD - Should have failed ==
== XSD - Should have passed ==
More information about the Playlist
mailing list