[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Namespace: what's the correct usage?
- From: Martin Gudgin <marting@develop.com>
- To: Martin Gudgin <marting@develop.com>, francis@redrice.com
- Date: Mon, 28 May 2001 22:35:29 +0100
----- Original Message -----
From: "Martin Gudgin" <marting@develop.com>
To: <francis@redrice.com>
Cc: "XML-Dev Mailing list" <xml-dev@lists.xml.org>
Sent: Monday, May 28, 2001 10:23 PM
Subject: Re: Namespace: what's the correct usage?
<SNIP>
> I tried to check against Xerces 1.4.0 but it always reports success even
if
> the instance has random elements in it so I must be doing something wrong
> when trying to set up the schema validation. I gave it xsi:schemaLocation
> and it is loading the docs but doesn't seem to be validating. I'll dig a
bit
> deeper and see what I can find...
Having dug deeper ( I read the docs :-) )...
I needed to register an error handler to get errors reported.
Xerces complains that;
Element type "person" must be declared.
which is the same as MSXML. I'm reading this as 'I found an element called
person that I was not expecting'. It's a pity that neither MSXML nor Xerces
give namespace information along with the local names in these error
messages.
Changing the instance to use prefix f for the 'friends' namespace give the
following error;
Datatype error: In element 'date' : Value '1990/09/28' is not legal value
for current datatype.
Fixing the instance to be;
<?xml version="1.0" encoding="UTF-8"?>
<f:friend xmlns:f="http://redrice.com/friends"
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://redrice.com/friends friend.xsd
http://redrice.com/birthdays birthday.xsd'>
<b:birthdays xmlns:b="http://redrice.com/birthdays">
<person>fred</person>
<date>1990-09-28</date>
</b:birthdays>
</f:friend>
and everything validates just fine which is what I would expect per the
spec.
Cheers
Gudge