[MEI-L] Stylesheet compilation: undeclared namespace prefix

Roland, Perry D. (pdr4h) pdr4h at eservices.virginia.edu
Tue Nov 24 21:41:16 CET 2015


Thanks, I see the errors now.

In the attached ODD, I moved the <constraintSpec> defining the MEI prefix from the <mei> element to the start of the <schemaSpec>.  As a result, the RNG contains the namespace definition for MEI as an immediate descendant of <grammar> (although, unlike the TEI namespace declaration, it occurs at the very end of the file) and the errors disappear.

I’ll fix this in the MEI source momentarily.

--
p.


From: mei-l [mailto:mei-l-bounces at lists.uni-paderborn.de] On Behalf Of Raffaele Viglianti
Sent: Tuesday, November 24, 2015 3:08 PM
To: Music Encoding Initiative
Subject: Re: [MEI-L] Stylesheet compilation: undeclared namespace prefix

Hi Perry,

To reproduce Anna's error, I associated the RNG schema with "additional association for embedded schematron rules" in Oxygen. When validating, I got an error on the @context of rules, because they use the "mei" prefix. The schematron engine complains because it doesn't know what the "mei" prefix is.

The mei prefix is set (for schematron) in the "mei" elementSpec:

<constraintSpec ident="set_ns" scheme="isoschematron">
    <constraint>
      <sch:ns prefix="mei" uri="http://www.music-encoding.org/ns/mei"/>
    </constraint>
</constraintSpec>

If the MEI element is not included, this declaration gets dropped.

There is another solution to this, now that I think about it: re-instating the namespace declaration on the new root element. For example in Anna's case one could add the constraintSpec above to the "expression"'s elementSpec (I just tested this and the error goes away).

I suspect you're right about the TEI stylesheet automagically adding the tei prefix to schematron. It doesn't hurt having it, however. We may still bring this up with TEI folks and see if it's possible to avoid that declaration in a non TEI context.

Raff

On Tue, Nov 24, 2015 at 2:45 PM, Roland, Perry D. (pdr4h) <pdr4h at eservices.virginia.edu<mailto:pdr4h at eservices.virginia.edu>> wrote:

Hmmmm.  I can’t reproduce the errors Anna is seeing.  But, forcing every customization to include the <mei> element seems like a ‘gotcha’ to me.  Moving the <constraintSpec>  that defines the mei prefix for schematron to be the first child of <schemaSpec> seems be the answer.  But I can’t test that properly since I get no errors either way.

I don’t see what effect the element --

<sch:ns xmlns:sch="http://purl.oclc.org/dsdl/schematron" prefix="tei" uri="http://www.tei-c.org/ns/1.0"/>

can have on schematron validation when every pattern and every rule is explicitly defined to be in the schematron namespace, e.g.,

<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
  id="mei-att.notationtype-notationsubtype-When_notationsubtype-constraint-1">
  <sch:rule xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
    xmlns="http://www.tei-c.org/ns/1.0" xmlns:rng="http://relaxng.org/ns/structure/1.0"
    xmlns:sch="http://purl.oclc.org/dsdl/schematron" context="mei:*[@notationsubtype]">
    <sch:assert test="@notationtype">An element with a notationsubtype attribute must have a notationtype attribute.</sch:assert>
  </sch:rule>
</pattern>

The @xmlns attribute on <rule> is superfluous since <rule> is explicitly placed in the schematron namespace by the use of the “sch:” prefix and the @xmlns:sch attribute.

It seems to me that the TEI namespace is an unnecessary and misleading artifact of using the TEI stylesheets to produce the RNG.  But perhaps there’s something I’m missing.

--
p.


From: mei-l [mailto:mei-l-bounces at lists.uni-paderborn.de<mailto:mei-l-bounces at lists.uni-paderborn.de>] On Behalf Of Anna Plaksin
Sent: Tuesday, November 24, 2015 10:55 AM
To: 'Music Encoding Initiative'
Subject: Re: [MEI-L] Stylesheet compilation: undeclared namespace prefix

Hi Raff,

you’re totally right, it works.
Now I can see how the schematron works properly in an MEI schema even with a TEI namespace.
Thank you very, very much for throwing light on this miracle. :-)

Regards,
Anna

Von: mei-l [mailto:mei-l-bounces at lists.uni-paderborn.de] Im Auftrag von Raffaele Viglianti
Gesendet: Dienstag, 24. November 2015 16:31
An: Music Encoding Initiative <mei-l at lists.uni-paderborn.de<mailto:mei-l at lists.uni-paderborn.de>>
Betreff: Re: [MEI-L] Stylesheet compilation: undeclared namespace prefix

Hi Anna,

The "mei" prefix is set by the mei element (see code here<https://github.com/music-encoding/music-encoding/blob/develop/source/specs/mei-source.xml#L15325>), therefore you have to make sure the element is included in your customization. By setting schemaSpec/@start to just "expression", I *think* the mei element gets excluded by the ODD processing (because it's not needed).

I would suggest to set schemaSpec/@start to "mei expression", which seems to fix the problem and makes the customization more conformant.

Hope this helps.

Best,
Raff

On Tue, Nov 24, 2015 at 10:19 AM, Anna Plaksin <annplaksin at gmx.net<mailto:annplaksin at gmx.net>> wrote:
Hello again,

I just added the wrong version of the file to the mail…

Sorry for that.

Anna

Von: mei-l [mailto:mei-l-bounces+annplaksin<mailto:mei-l-bounces%2Bannplaksin>=gmx.net at lists.uni-paderborn.de<mailto:gmx.net at lists.uni-paderborn.de>] Im Auftrag von Anna Plaksin
Gesendet: Dienstag, 24. November 2015 16:14
An: mei-l <mei-l at lists.uni-paderborn.de<mailto:mei-l at lists.uni-paderborn.de>>
Betreff: [MEI-L] Stylesheet compilation: undeclared namespace prefix

Hello all,

maybe the ODD experts could help me with this issue:
I’m working on a MEI customization and since yesterday I get pattern syntax errors complaining about an undeclared namespace prefix in the schematron rules after the compilation from ODD to Relax NG.
It seems to me a little bit weird because I didn’t make big changes in my ODD file and the errors occur both at my own schematron rules and the preexisting.
I’m using the TEI framework in Oxygen 17.1 with the driver.xml of the v2.1.1, but it occurs also with the customization web service. It is possible to correct the errors in the output file by changing the schematron <ns> from TEI to MEI but this cannot be a proper solution, because the namespace is always TEI even if the schema works fine.

I think it is most likely a mistake I’ve done but I just don’t find it. Is someone able to explain it to me?

Thanks,
Anna

_______________________________________________
mei-l mailing list
mei-l at lists.uni-paderborn.de<mailto:mei-l at lists.uni-paderborn.de>
https://lists.uni-paderborn.de/mailman/listinfo/mei-l


_______________________________________________
mei-l mailing list
mei-l at lists.uni-paderborn.de<mailto:mei-l at lists.uni-paderborn.de>
https://lists.uni-paderborn.de/mailman/listinfo/mei-l

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-paderborn.de/pipermail/mei-l/attachments/20151124/3d342a78/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mei-cmo-expression.odd
Type: application/octet-stream
Size: 23652 bytes
Desc: mei-cmo-expression.odd
URL: <http://lists.uni-paderborn.de/pipermail/mei-l/attachments/20151124/3d342a78/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mei-cmo-expression.rng
Type: application/octet-stream
Size: 440525 bytes
Desc: mei-cmo-expression.rng
URL: <http://lists.uni-paderborn.de/pipermail/mei-l/attachments/20151124/3d342a78/attachment-0001.obj>


More information about the mei-l mailing list