[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Namespace: what's the correct usage?

  • From: Martin Gudgin <marting@d...>
  • To: Martin Gudgin <marting@d...>, francis@r...
  • Date: Mon, 28 May 2001 22:35:29 +0100

top

----- Original Message -----
From: "Martin Gudgin" <marting@d...>
To: <francis@r...>
Cc: "XML-Dev Mailing list" <xml-dev@l...>
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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.