|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
Validating XML against external xml schema |
« View previous topic :: View next topic » |
Author |
Message
|
martinrydman |
Posted: Wed Apr 06, 2005 12:39 am Post subject: |
|
|
 Centurion
Joined: 30 Jan 2004 Posts: 139 Location: Gothenburg, Sweden
|
Hi,
In the MQInput node there is a Timing parameter that can be set to Immediate. Is there a similar parameter to the PARSE clause?
If not, you could force validation by climbing the entire tree and copy it to Environment. My understanding is that validation works 'on demand' (it's an IBM product, after all ) i.e. it's only when you actually access a field that it gets validated.
/Martin |
|
Back to top |
|
 |
JLRowe |
Posted: Wed Apr 06, 2005 2:01 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
This is the code I used to force validation of the message tree:
Code: |
CREATE PROCEDURE WalkValidate(IN Input REFERENCE) BEGIN
DECLARE Ref REFERENCE TO Input;
-- Get the value of this field first
IF Ref IS NULL THEN
END IF;
-- Walk through the first child
MOVE Ref FIRSTCHILD;
IF LASTMOVE(Ref) THEN
CALL WalkValidate(Ref);
END IF;
-- Walk through the next sibling
MOVE Input TO Ref;
MOVE Ref NEXTSIBLING;
IF LASTMOVE(Ref) THEN
CALL WalkValidate(Ref);
END IF;
END; |
|
|
Back to top |
|
 |
martinrydman |
Posted: Wed Apr 06, 2005 4:00 am Post subject: |
|
|
 Centurion
Joined: 30 Jan 2004 Posts: 139 Location: Gothenburg, Sweden
|
OK, so the IF Ref IS NULL accesses the field and thus validates it. No need for Environment then...
/Martin |
|
Back to top |
|
 |
sri |
Posted: Wed Apr 06, 2005 5:34 am Post subject: |
|
|
 Apprentice
Joined: 14 Mar 2004 Posts: 32 Location: Chennai - India
|
hi
thanks for ur help, it works with the following statement
CREATE LASTCHILD OF OutputRoot DOMAIN('MRM') PARSE(InMsgBlob SET MsgSetChr OPTIONS BITOR(ValidateValue, ValidateContent, ValidateImmediate, ValidateException));
The only clause that I missed earliear was 'ValidateImmediate'. As per document, this is the default option that will be used, but I think, it does not happen.
Now I included this 'ValidateImmediate', it is working fine. The flow raises exception at this stage itself (immediately) for invalid XML.
thanks |
|
Back to top |
|
 |
|
|
|
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
|
|
|
|