aspose file tools*
The moose likes XML and Related Technologies and the fly likes XML Schema validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML Schema validation " Watch "XML Schema validation " New topic
Author

XML Schema validation

Vivek Saxena
Ranch Hand

Joined: Apr 24, 2002
Posts: 58
Hi,
As per my understanding following XML file is not valid (Missing Element) according to associated XML Schema. If I try to validate it in XMLSpy it says that it is a valid file. May be I am wrong, Please feel free to correct me.

I have been getting all sort of problem with XMLSpy. Could someone suggest me some other tool to validate a XML file against DTD or Schema.
Thanks
[ February 06, 2003: Message edited by: Vivek Saxena ]
[ February 06, 2003: Message edited by: Vivek Saxena ]
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Vivek Saxena:

I have been getting all sort of problem with XMLSpy. Could someone suggest me some other tool to validate a XML file against DTD or Schema.
Thanks

1.XSV tool is the best http://www.w3.org/2001/03/webdata/xsv
its available online and standalone as well.
2. topologo Schematron - http://www.topologi.com/products/validator/index.html
3. Sun MSV is also a good one
4. IBM Schema quality checker - for schema validation alone.


Spritle Software Blogs
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

.....XML file is not valid (Missing Element)....
<?xml version="1.0" encoding="UTF-8"?><head xmlns="test.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="test.com test.xsd"><title>Guidelines</title><abc /></head>


Maybe I am missing to see something obvious, but why do you say Missing Element....
Which element do you think is missing ?
regds.
- madhav
ps:
Vivek: Your posts here are definetly valid, but I was wondering if you could post them in the XML Cert. forum, in case you are a Cert. candidate. I am asking this out of selfishness. I am preparing for Cert. and would like to participate.
Kinda, fear that I am missing a lot if I check only the XML Cert forum. Again, this is just a personal request, nothing you "have to" do or anything like that.
- madhav


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Vivek Saxena
Ranch Hand

Joined: Apr 24, 2002
Posts: 58
Madhav,
Please look into my other post �Schema confusion�. I hope you see my point of confusion. This is just because in one tool my XML file is valid and other is saying �not valid�.
I am still looking for some help.
Note: If you want you can move both of my post in �XML Certification� forum. From now on I would do my posting over there.

Thanks
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
This is just because in one tool my XML file is valid and other is saying �not valid�.

Don't you agree that would be the tool problem then ?
I was confused by the Missing Element phrase in your post and thought that you implied there was a element missing in the XML file.
Not sure if that was what you intended.
I am preparing for the Cert and trying to stir the Cert forum, that's all.
Your participation in that forum would help if infact you are also preparing for Cert.
Thanks.
- madhav
Vivek Saxena
Ranch Hand

Joined: Apr 24, 2002
Posts: 58
Kenneth just solved the problem.

This is becoz when u declare an "all" as the model group, then it has to be the one and only one group declaration. In simple words, "all" cannot be nested in a "sequence" or "choice".
Pls refer to
XML Schema Spec Part 1: Structures
3.9.6 Constraints on Particle Schema Components
The table under Schema Component Constraint: Particle Valid (Restriction)
Cheers


I do agree that this is tool(XMLSpy) problem. In fact i am also preparing for the exam.
Thanks
[ February 07, 2003: Message edited by: Vivek Saxena ]
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
I will ask that this thread be closed.
We seem to be running into duplicate threads here.
Please continue the discussion in the Schema Validation thread, if I could suggest.
Thanks.
- m
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML Schema validation