Thanks for the help.
Now, I am trying to validate my xml file, but it said it is missing the declaration of 'Rsp'.
my xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<Rsp xmlns="url of my schema">
<Version>5.3.0</Version>
<MessageID>20040223</MessageID>
</Rsp>
And I check the url of my schema, it is valid.
Here is the error message:
[Error] mm7.xml:2:96: cvc-elt.1: Cannot find the declaration of element 'Rsp'.
Here is the schema:
<xs:schema targetNamespace="url of the schema" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
- <xs:element name="Rsp" type="tns:RspType">
</xs:element>
...
</xs:schema>
Thanks in advance for any help.
-----Original Message-----
From: Michael Glavassevich [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 23, 2004 10:49 AM
To: '[EMAIL PROTECTED]'
Subject: Re: Validate xml file using xml schema
Hi Samuel,
You need use the -s option as well (this corresponds to the feature
http://apache.org/xml/features/validation/schema). This will turn on
schema validation. When you don't supply the parser will attempt to
validate against a DTD, hence the error messages you received.
On Mon, 23 Feb 2004, Samuel Cheung wrote:
>
> I am trying to use the Counter example to validate (I use the "-v" option)
> the personal-schema.xml in the data directory in the sample.
>
> But I get these errors instead, could someone please tell me why?
>
> [Error] personal-schema.xml:2:11: Document is invalid: no grammar found.
> [Error] personal-schema.xml:2:11: Document root element "personnel", must
> match DOCTYPE root "null".
> personal-schema.xml: 187;16;0 ms (37 elems, 14 attrs, 0 spaces, 268 chars)
---------------------------
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
