Lists Home |
Date Index |
Dear Mr. Ronald,
I just tried the code, dom.Counter
(http://xml.apache.org/xerces2-j/samples-dom.html#Counter). But some
problems puzzled me.
1) I wrote an XML file, note.xml, and its schema, note.xsd. Then I turned on
the option, -v. This option turns on validation. I got the following errors
[Error] note.xml:2:102: Document root element "note", must match DOCTYPE
[Error] note.xml:2:102: Document is invalid: no grammar found.
note.xml: 213;27;0 ms (4 elems, 2 attrs, 0 spaces, 20 chars)
That's the same as DTD-based parser, right?
2) Then, I turned off -v and turned on -s, which meant Schema validation
support. However, even if one element exists in XML doesn't exist in its
schema, there is any error! DTD parser should get error under this
3) I tried another option -f, which meant schema full checking. The
situation in 2) also occurred. Why?
4) Errors can happen when XML is not well-formed!
Schema-based parser works that way? It is quite different from DTD-based
Thanks so much!
----- Original Message -----
From: "Ronald Bourret" <firstname.lastname@example.org>
To: "Li Bing" <email@example.com>
Sent: Wednesday, April 17, 2002 11:03 PM
Subject: [xml-dev] Re: Why Can't I Find Java Codes About This? Re: [xml-dev]
How Can I KnowMy XML is Valid With XML Schema Without DTD?
> Oracle's XML parser:
> Sun MSV:
> -- Ron
> Li Bing wrote:
> > Dear Mr. Bourret,
> > Thanks so much for your help! But it is very strange that I can't find
> > Java codes about parsing XML according to XML Schemas on the Web or
> > books. Could you please provide me with information about this?
> > Best regards,
> > Li Bing
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> The list archives are at http://lists.xml.org/archives/xml-dev/
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>