Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

Validate xml schema with digester.

Thread view: 
shayhazan@gmail.com - 20 Jul 2006 05:35 GMT
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,
Andrew Thompson - 20 Jul 2006 06:28 GMT
> I'm using digester..

As in
<http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/tomcat/util
/digester/Digester.html
>
?

>....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.
hazan - 20 Jul 2006 09:28 GMT
> > I'm using digester..
>
[quoted text clipped - 25 lines]
>
> 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 !


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.