ZVON > Tutorials > XML Schema and Relax NG Tutorial
Index | >> Example 2 / 3 << | Prev | Next |
Contents > Associating schema with document > Document root element from some particular namespace

Document root element from some particular namespace

  1. XML Schema

1. XML Schema

Now, let's have the same document as in previous example, but the "root" element must be from some concrete namespace, let's say "http://foo".

Valid document


<root xmlns="http://foo" >aaa</root>

Valid document
If the root element is from some particular namespace, you associate the Schema using "schemaLocation" attribute. The first part of this attribute is the target namespace, the second one the URL of the Schema file.


<f:root xsi:schemaLocation="http://foo correct_0.xsd" xmlns:f="http://foo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > test </f:root>