Validate xml schema with digester.

S

shayhazan

I'm using digester to parse xml and I want to validate the xml with
xsd file.

I didn't find an example of how to do it :(
I tried to use:

digester.register("\\adasdascvcvcvc\\ssss\\XMLSchema","//WEB-NF//classes//schema.xsd");
String strXSDPath = "//WEB-INF//classes// schema.xsd";
digester.setSchema(strXSDPath);
digester.setValidating(true);

anybody know what is the problem ? ? ?

By the way, my xml doesn't have namespace.

Thanks in advance,
 
A

Andrew Thompson

I'm using digester..

As in
....to parse xml and I want to validate the xml with
xsd file. ....
digester.register("\\adasdascvcvcvc\\ssss\\XMLSchema","//WEB-NF//classes//schema.xsd");

What are those '\\' doing in there? Why have you doubled
the '//'?

As far as I understand,

1. The '\' is only relevant to Windows, and only relevant
to files - not URL's.

2. The '//' is not needed - it should be '/'

3. WEB-INF is usually spelt WEB-INF, rather than WEB-NF
anybody know what is the problem ? ? ?

With your repeating '?' key?
It might be sticky jam in the keyboard...

Andrew T.
 
H

hazan

Andrew said:
As in


What are those '\\' doing in there? Why have you doubled
the '//'?

As far as I understand,

1. The '\' is only relevant to Windows, and only relevant
to files - not URL's.

2. The '//' is not needed - it should be '/'

3. WEB-INF is usually spelt WEB-INF, rather than WEB-NF


With your repeating '?' key?
It might be sticky jam in the keyboard...

Andrew T.

10x

but I still want to understand something.

In which step will I get the error if the xml is not with the right
schema ?

when I perform "digester.register(... " ? if not, then when ?

thank you vary much !
 

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
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top