[Schematron] validate the default namespace of a instance document

DMS Lists lists at d-m-s.co.nz
Tue Dec 1 18:26:35 EST 2009


Great. A simple, elegant solution. Many thanks for helping out.
Sorry if I blurred the question by mentioning the default namespace.

Juerg

>-----Original Message-----
>From: schematron-bounces at eccnet.com [mailto:schematron-
>bounces at eccnet.com] On Behalf Of G. Ken Holman
>Sent: Wednesday, 2 December 2009 11:47 a.m.
>To: schematron at eccnet.com
>Subject: Re: [Schematron] validate the default namespace of a instance
>document
>
>At 2009-12-02 11:01 +1300, DMS Lists wrote:
>>It is not the prefix that seems to cause the issue. For example:
>>- We have two XML schema versions with namespaces ExampleSchemaNS-1 and
>>ExampleSchemaNS-2
>>- We have also two Schematron versions Schematron-1.sch and
>>Schematron-2.sch, each written for its counterpart schema version.
>>- When by accident a incoming instance document with namespace
>>ExampleSchemaNS-1 is validated using Schematron-2.sch, it appears that
>the
>>Schematron will execute, but with unreliable outputs.
>>- It would be preferable to have an error message indicating that the
>>namespaces are not matching.
>
>The solution is far simpler than you've been thinking.
>
>All you need in Schematron-1.sch is a rule:
>
>  context: /*
>  assert:  namespace-uri(.)="ExampleSchemaNS-1"
>
>All you need in Schematron-2.sch is a rule:
>
>  context: /*
>  assert:  namespace-uri(.)="ExampleSchemaNS-2"
>
>The issue has nothing to do with the default namespace.
>
>I hope this helps.
>
>. . . . . . . . Ken
>
>--
>Vote for your XML training:   http://www.CraneSoftwrights.com/d/i/
>Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/d/
>Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
>Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18
>Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18
>G. Ken Holman                 mailto:gkholman at CraneSoftwrights.com
>Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/d/bc
>Legal business disclaimers:  http://www.CraneSoftwrights.com/legal
>
>_______________________________________________
>Schematron mailing list
>Schematron at eccnet.com
>http://www.eccnet.com/mailman/listinfo/schematron



More information about the Schematron mailing list