469,645 Members | 1,137 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

embedded schematron and chameleon design

I have a modular set of xml schemas that are being <include/>d
into a master schema. The modules have no target namespace,
but `inherit' the namespace of the master schema -- this is
the so called Chameleon design. The master schema in its turn
is <import/>ed into other schemas with different namespaces.

Now, in the modules I'd like to use Schematron rules. Problem
is, these do not seem to inherit the target namespace of the
master schema. The way out is to define the context namespace
in the Schematron rules themselves with for example
<sch:ns uri="http://www.kb.se" prefix="kb"/>.
But, this goes counter against the idea with the Chameleon design.

So my question is, is there a way for the Schematron rules to
inherit the target namespace of the including schema?
(Hope this is clear.)

Below are sample code snippets.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

<xs:complexType name="type.person" mixed="true">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:group ref="group.personElements"/>

<xs:element name="person" type="type.person">
<sch:pattern name="Test">
<sch:rule context="person">
<sch:assert test="count(persName) &gt; 1">
You can have only one persName element within a person
<!-- ... -->

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

<xs:include schemaLocation="kb-names.xsd"/>
<xs:include schemaLocation="kb-identifiers.xsd"/>
<!-- ... -->

/Patrik Nyman
Nov 16 '07 #1
0 1513

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Samuel Sagan | last post: by
reply views Thread by disteve | last post: by
1 post views Thread by shaun roe | last post: by
reply views Thread by jean-gert nesselbosch | last post: by
2 posts views Thread by Tom Gugger | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.