Skip to content

Changing the .xsd schematron file

Phencys edited this page May 27, 2025 · 2 revisions

The DASH Conformance Validator uses a .xsd file for the validation of the DASH MPD.

What is an XSD file

An XSD file is a file used to define what elements and attributes may appear in an XML document. It also defines the relationship of the elements and what data may be stored in them. XSD files are written in the W3C XML Schema language.

Source: https://fileinfo.com/extension/xsd

Configuration

The default schema is located in DASH/mpdvalidator/schemas/DASH-MPD.xsd. Based on the enabled module the validator switches to a different schema:

if ($dvbEnabled) {
    if ($dvbVersion == "2019") {
        $schemaLocation = 'schemas/DASH-MPD-4th-amd1.xsd';
    } else {
      //Default to 2018 xsd
        $schemaLocation = 'schemas/DASH-MPD-2nd.xsd';
    }
} elseif ($llEnabled) {
    $schemaLocation = 'schemas/DASH-MPD-4th-amd1.xsd';
}

It is also possible to enable the useLatestXsd flag via the REST interface or the CLI. In this case, the validator uses the following URL: https://raw.githubusercontent.com/MPEGGroup/DASHSchema/5th-Ed/DASH-MPD.xsd

By changing the logic in Utils/impl/MPDHandler/findOrDownloadSchema.php the existing logic can be overwritten and adjusted.

Running the Schematron separately:

As per PR 722, the instructions to run the schematron as a standalone system are:

create_val_schema.sh contains command lines to convert schematron code into XSLT, a three step process involving XSLT transforms to create an XSLT transform val_schema.xsl out of the input schematron.sch:

java -jar ../saxon9he.jar -versionmsg:off -s:schematron.sch -o:tmp/new_schema1.sch -xsl:schematron/iso_dsdl_include.xsl
java -jar ../saxon9he.jar -versionmsg:off -s:tmp/new_schema1.sch -o:tmp/new_schema2.sch -xsl:schematron/iso_abstract_expand.xsl
java -jar ../saxon9he.jar -versionmsg:off -s:tmp/new_schema2.sch -o:output/val_schema.xsl -xsl:schematron/iso_svrl_for_xslt2.xsl

Then, run_samples.sh shows how to run the XSLT transform on a file:

java -jar ../saxon9he.jar -versionmsg:off -s:manifest-to-test.mpd -o:results.xml -xsl:output/val_schema.xsl

Another option is if you have access to OxygenXML which has schematron support built-in.

Clone this wiki locally