File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes New tool for validate XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "New tool for validate XML" Watch "New tool for validate XML" New topic

New tool for validate XML

Isaac Ferguson
Ranch Hand

Joined: Jun 22, 2012
Posts: 752

I am interested in develop a validator for automatize several task.

The first step is read an XML and find the URL tag. Then get that URL(which is a call to a webService) and call notepad ++(or other tool)
in order to validate the webService XML agains a .xsd.

After that if there is any error in the validations I would like write it in a report and generate a PDF else there are another steps which I will let you know later

I have been adviced using groovy because it works properly with XML I have no knowledge about it but if it is needed I would learn it. But maybe is easy do it in java.

I would like open a discussion about this.

What do you think is the best approach?

Is there any open source tool which is already making this?

Any advice, please?


Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33113

Yes, it can be done in Java. The idea of proposing Groovy was so that you could learn something new. And it is less code in Groovy.

Here is how to parse XML is groovy. For the PDF part, you can use iText.

Also, remember Groovy can call Java code. Which means you can do anything in Groovy that you can do in Java.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
chris webster

Joined: Mar 01, 2009
Posts: 2289

Groovy makes a lot of XML processing *much* easier than Java. Go ahead and try it out. And as Jeanne says, you can always drop back to Java if necessary.

No more Blub for me, thank you, Vicar.
Isaac Ferguson
Ranch Hand

Joined: Jun 22, 2012
Posts: 752

I am developing a validation tool which validates xml again xsd. But at some point the xml contains fiedls which are optional like maxOccurs="0"/>

In that cases I donĀ“t know if the field has been populated in the XML. Because it is not mandatory.

I need to provide more information about it. In the meantime can you give any advice, please?

I agree. Here's the link:
subject: New tool for validate XML
It's not a secret anymore!