XPATH 2.0 matches function in embedded ISO Schematron
Posted: Wed Oct 10, 2007 5:26 pm
I'm embedding ISO Schematron rules in my RelaxNG schema (TEIP5 with local extensions) using oXygen 8.2 with Schematron XPath Version set to 2.0;
Given this element definition with embedded Schematron assertion:
<element name="chronList">
<a:documentation xmlns:a="http://relaxng.org/ns/compatibility/ann ... 1.0">Local
Extension: "chronList"--a "non-TEI" element contains the model "eventLike" for use in
timeline feature of EV.</a:documentation>
<sch:pattern name="chronlist key attribute values">
<sch:rule context="//tei:chronList/tei:event">
<sch:assert test="@key[contains(., 'cl')]">You must begin your event key value with the letters "cl"!</sch:assert>
</sch:rule>
</sch:pattern>
</element>
Everything runs fine. However, if I change the assert test to:
<sch:assert test="@key[matches(., 'cl([0-9]+)')]">You must begin your event key value with the letters "cl" followed by one or more numbers!</sch:assert>
I get the following error:
Description: Error in expression @key[matches(., 'cl([0-9]+)')]: Unknown system function: matches
Am I using the matches function incorrectly here? Or is something else going on? Any help would be great thanks!
Matthew
Given this element definition with embedded Schematron assertion:
<element name="chronList">
<a:documentation xmlns:a="http://relaxng.org/ns/compatibility/ann ... 1.0">Local
Extension: "chronList"--a "non-TEI" element contains the model "eventLike" for use in
timeline feature of EV.</a:documentation>
<sch:pattern name="chronlist key attribute values">
<sch:rule context="//tei:chronList/tei:event">
<sch:assert test="@key[contains(., 'cl')]">You must begin your event key value with the letters "cl"!</sch:assert>
</sch:rule>
</sch:pattern>
</element>
Everything runs fine. However, if I change the assert test to:
<sch:assert test="@key[matches(., 'cl([0-9]+)')]">You must begin your event key value with the letters "cl" followed by one or more numbers!</sch:assert>
I get the following error:
Description: Error in expression @key[matches(., 'cl([0-9]+)')]: Unknown system function: matches
Am I using the matches function incorrectly here? Or is something else going on? Any help would be great thanks!
Matthew