[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
default namespaces in Schematron
- From: trubliphone <trubliphone@googlemail.com>
- To: xml-dev@lists.xml.org
- Date: Thu, 21 Oct 2010 10:52:02 -0700
Hello.
Does anybody know how to specify default namespaces in Schematron?
Given the following sort of XML:
<root>
<foo/>
</root>
And the following sort of SCH:
<schema xmlns="http://purl.oclc.org/dsdl/schematron">
<pattern>
<rule context="foo">
<assert test="bar">foo must have bar</assert>
</rule>
</pattern>
</schema>
A Schematron validator correctly asserts that <foo> is missing a child <bar>.
However, as soon as I assign a namespace to the XML:
<root xmlns="http://my.server.com">
the Schematron rule fails to match. Presumably, this is because the element <foo> is now in the "http://my.server.com" namespace.
Schematron allows a <ns> element to solve just this problem. But it requires a uri and a prefix. The above, being a default namespace, has no prefix.
Any ideas?
Thanks
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]