Posted: Thu May 09, 2013 5:55 am Post subject: Parsing Errors Entire XML Message
Newbie
Joined: 09 May 2013 Posts: 9
Hi
Is there a way to get all parsing exception in following scenario
CREATE LASTCHILD OF InputLocalEnvironment.tempData[I] DOMAIN('XMLNSC')
PARSE(xmlString CCSID 1208 SET 'XMLExamplesMessageSet' TYPE 'Application'
OPTIONS parserOptions);
I got Text:CHARACTER:cvc-complex-type.2.4.e: Unexpected element. Element "MiddleName" is not one of the choices.
But there also other xml validation errors. How can I get a "list" of all those in one pass - is it possible and how?
When the document has started to diverge from the rules in the xsd, it is ( in general ) impossible to know which errors to issue. I know there are XML parsers that will do this - but when the xsd is complex they are making a bunch of assumptions about what the 'correct' errors should be.
Posted: Thu May 09, 2013 10:44 pm Post subject: Re: Parsing Errors Entire XML Message
Chevalier
Joined: 05 Nov 2005 Posts: 401
dianmushkov wrote:
Hi
Is there a way to get all parsing exception in following scenario
CREATE LASTCHILD OF InputLocalEnvironment.tempData[I] DOMAIN('XMLNSC')
PARSE(xmlString CCSID 1208 SET 'XMLExamplesMessageSet' TYPE 'Application'
OPTIONS parserOptions);
I got Text:CHARACTER:cvc-complex-type.2.4.e: Unexpected element. Element "MiddleName" is not one of the choices.
But there also other xml validation errors. How can I get a "list" of all those in one pass - is it possible and how?
You probably have to do your own [business] validation before you parse. By *business* I mean all of the validation rules that allow you to confirm that the message is business process able (not just that it conforms to the brittle and limited constraint model of XML schema). You could do this in a number of ways, such as, in Java, in XSLT (possibly using schematron), in ESQL.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum