Srini...
Torch your Thoughts....
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Srini...
Torch your Thoughts....
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Originally posted by kiran manohar:
In the xml file there is an order like client-->order--->orderitem.now i want to track the sequence in which the schema file is written and in that order input the data in to my java object.
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Srini...
Torch your Thoughts....
Unrecognized error (SAXNotRecognizedException):
"http://apache.org/xml/features/validation/schema"
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
i will do it like that, but in the xml schema the elements tag type and name attributes values i need to retrieve . u know any api which does this.
I still insist that if the validation step doesn't complain, the elements in your XML document are in the exact same order as described by your schema document. Thus, you can just parse the XML document and handle elements in whatever order they are.also first validating the xml schema and then parsing the xml file solves my problem. but i need to store the data found in the xml file in the same sequence.
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Srini...
Torch your Thoughts....
According to this page, the support for a feature switching schema validation on/off was only added in version 1.1.2 of Xerces. On the other hand, this would imply that schema validation is on by default so you might want to just catch the exception, comment that your version of Xerces is expected to throw it and that it's ok because ...we have xerces 1.0.4, i think it has validation for schema
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
What do you have to say for yourself? Hmmm? Anything? And you call yourself a tiny ad.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|