tags:

views:

15

answers:

1

I can't seem to find any documentation on it that makes any kind of sense to me. I've noticed that it seems to relate to the xmlns attribute of the schema that is being validated.

It looks like if the ns of the schema grammar tag and the xmlns of the root node of schema to validate don't match, I get a validation error.

What is the ns attribute and how is it different from xmlns?

A: 

In this example

<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="...."

xmlns defines the namespace of the grammar itself. The ns attributes defines the namespace of instances of the document type defined by the grammar.

So, is ns is set to - say - "http://foo.bar/", then an instance of this document would have to reference that namespace in order to be valid according to the schema:

<foo xmlns="http://foo.bar/"&gt;&lt;bar/&gt;&lt;/foo&gt;

Wilfred Springer