Namespace validation error

hooker

Usenet Archive
Joined
Oct 24, 2003
Messages
3
Reaction score
0
I'm building an XML file and associated schema using Roger Costello's excellent reference and various online resources. The XML validates fine as long as I don't turn on name space validation (i.e. the XML itself is well formed as long as the schema is ignored).

I downloaded Sun's freestanding java validator so that I could work locally instead of hitting the validation sites quite as much as I was doing. Hitting my head against the wall however, hasn't stopped :)

The first few lines of the XML file look like this :

<?xml version="1.0"?>
<ConstellationNames
xmlns="http://www.hooksprogress.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.hooksprogress.org C.xs">

Running the Sun validator I get :

start parsing a grammar.
element "ConstellationNames" is not allowed here
5:68@http://www.hooksprogress.org/C.xml perhaps namespace URI "http://www.hooksprogress.org" is incorrect? 5:68@http://www.hooksprogress.org/C.xml failed to load a grammar.

and it hasn't tried to fetch the stylesheet. According to the online examples that I can find (as well as Costello's powerpoint doc) what I've done looks correct, although it clearly isn't.

Ideas? Please ?
 

Richard Tobin

Usenet Archive
Joined
Jan 6, 2000
Messages
4,251
Reaction score
0
You have xsi:noNamespaceSchemaLocation where you mean xsi:schemaLocation.
[/QUOTE]
'Fraid not Richard - I've tried that (and done it again just now as a check).
Same errors.

Well, that *does* need to be changed, but evidently you have some other problem too.

The messages:

start parsing a grammar.
element "ConstellationNames" is not allowed here
5:68@http://www.hooksprogress.org/C.xml perhaps namespace URI "http://www.hooksprogress.org" is incorrect? 5:68@http://www.hooksprogress.org/C.xml failed to load a grammar.

suggest that maybe it is trying to read the document itself as a schema. Have you checked the arguments to the validator?

-- Richard
 

hooker

Usenet Archive
Joined
Oct 24, 2003
Messages
3
Reaction score
0
Richard Tobin said:
Well, that *does* need to be changed, but evidently you have some other problem too.
The messages:
start parsing a grammar.
element "ConstellationNames" is not allowed here
5:68@http://www.hooksprogress.org/C.xml perhaps namespace URI "http://www.hooksprogress.org" is incorrect? 5:68@http://www.hooksprogress.org/C.xml failed to load a grammar.
suggest that maybe it is trying to read the document itself as a schema. Have you checked the arguments to the validator?

Aaarrrrgggghhh ! Thank you Richard, you're right.

You either give the validator a single parameter (which must be the schema) or 2, the schema first followed by the XML file.

Sorry for wasting peoples time, and in future I'll RTFM a little better :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,798
Members
249,594
Latest member
henrywalsh

Latest Threads

Top