Link to home
Start Free TrialLog in
Avatar of chima
chima

asked on

Xml Schema parser

Hello,
Given the following line of code;
SchemaParser sparser = new SchemaParser(schemaParserFile.toURI().toURL());
The URL points to an xml file.

How could one print/show the content of sparser?  
I have tried; System.out.print(sparser.getConstraints()); but nothing get printed. it could be that it is empty.
Also, if the xml file does not have "constraints" then the method getContraints might have nothing to get.
I was hoping it would read/get the tags, but it does not seem like it does.
Any suggestions?
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

If you are using SchemaParser from this package:
http://oodt.jpl.nasa.gov/metadata-service/apidocs/jpl/eda/metadata/validation/package-summary.html

Then it appears you get the constraints that the Schema defines as a Map.  The API for the Constraint object itself can be found on same link above.

Otherwise, please provide the package you are using SchemaParser from.
Avatar of chima
chima

ASKER

mwvisa1, while I got the code from here; http://www.javaworld.com/jw-11-2000/Validation/src.zip 
I have debugged it some.  If you need to see the debugged version, please let me know.
Avatar of chima

ASKER

mwvisa1, I looked at the link that you provided and it is the package I am using.  How then could I look at the Map?  The xml file I am working with does not provide constraints.  It provides tags and it is these tags information that I am hoping to parse.
ASKER CERTIFIED SOLUTION
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chima

ASKER

Thanks, more to come.