OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] default namespaces in Schematron

Aha.  You're right.  Thanks very much for your help.

On Thu, Oct 21, 2010 at 11:06 AM, George Cristian Bina <george@oxygenxml.com> wrote:
It does not matter how the namespace is specified in the XML instance. Just declare the namespace with an ns element in Schematron and use that prefix to refer to elements from that namespace.

Best Regards,
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

On 10/21/10 8:52 PM, trubliphone wrote:

Does anybody know how to specify default namespaces in Schematron?

Given the following sort of XML:


And the following sort of SCH:

<schema xmlns="http://purl.oclc.org/dsdl/schematron">
<rule context="foo">
<assert test="bar">foo must have bar</assert>

A Schematron validator correctly asserts that <foo> is missing a child

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?


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS