Hi Allison,

For validating schemata themselves you can use this sample:
http://xerces.apache.org/xerces2-j/samples-xni.html#XMLGrammarBuilder

For the -va option see:
http://xerces.apache.org/xerces2-j/features.html#validate-annotations

(Note also that oXygen includes Xerces 2.7.1 in case you want to perform the validations from a GUI.)

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Allison Bloodworth wrote:
OK, I got it now. I had tried using "java sax.Counter MyDocument", but ended
up returning just what it seemed it said in the documentation it would: "the
time and count of elements, attributes, ignorable whitespaces, and
characters appearing in the document." I see that when I add the -v and -s
options, I get the errors in my documents. Is it possible to use this
program to validate schemas? I'm getting the following error when I try to
validate a schema:

[Error] Events_1.7.xsd:2:397: cvc-elt.1: Cannot find the declaration of
element 'xs:schema'.

It would be really helpful to add the fact that sax.Counter can be used as a
validator using the options below to the instructions if someone has the
time. I'm not sure if I need the -n, -np, and -f options, but I turned them
on just in case...does anyone know what the -va (validation of schema
annotations) option is looking for? I got a whole bunch of errors like this
on imported reused elements when I turned it on:

UBL-UnspecializedDatatypes-1.0.xsd:6:36: cvc-complex-type.2.4.a: Invalid
content was found starting with element 'ccts:RepresentationTerm'. One of
'{"urn:oasis:names:specification:ubl:schema:xsd:CoreComponentParameters-1.0"
:Version,
"urn:oasis:names:specification:ubl:schema:xsd:CoreComponentParameters-1.0":D
efinition}' is expected.
-----Original Message-----
From: Allison Bloodworth [mailto:[EMAIL PROTECTED] Sent: Monday, November 28, 2005 4:20 PM
To: [email protected]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Invoking schema validator from the command line

Thanks to Paul & George for pointing me to this page, but I am still lost on
how to validate an XML instance against a schema! I tried to find out what
the examples on this page
(http://xerces.apache.org/xerces2-j/samples-sax.html#Counter) corresponded
to in the API Documentation
(http://xerces.apache.org/xerces-j/apiDocs/index.html) in hopes that would
shed some light on things, but I think I'm missing some basic java knowledge
here. I assume the classes in the API documents NOT something you can invoke
from the command line? Where is the info on what can be invoked on the
command line?

Is there a simple command I can use to do this validation at the command
line? Or do I have to write an actual program which instantiates objects
using the classes in the API documentation in order to accomplish this? If
so, has someone who has done this already be willing to share their program
with me?

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, November 28, 2005 2:25 PM
To: [email protected]
Cc: [email protected]; [EMAIL PROTECTED]
Subject: RE: Invoking schema validator from the command line

Actually, I misspoke. I'm trying to validate an instance document
against a
schema I created. I'm getting errors in XML Spy that don't make sense
and
the xml-dev list recommended I use Xerces to check it since it was a
better
implementation of the spec. So any pointers would be welcome
here...thanks!

Have a look at:

        http://xerces.apache.org/xerces2-j/samples-sax.html#Counter

pvb

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to