|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Validate XML for Empty Elements in FileInput Node |
« View previous topic :: View next topic » |
Author |
Message
|
WMBDeveloper |
Posted: Thu Aug 28, 2008 4:37 pm Post subject: Validate XML for Empty Elements in FileInput Node |
|
|
Newbie
Joined: 28 Aug 2008 Posts: 1
|
I'm using validation in a FileInput Node and I want XML messages with empty elements, e.g., <Name></Name>, to fail validation, not be processed and go to the backout folder.
In the FileInput Node, I've tried Input Message Parsing using both XMLNSC and MRM message domains.
In the Message Set, XML representation of null values is set to "NULLEmpty" for both Encoding Numeric/Non-Numeric Null.
Please advise. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Aug 29, 2008 12:51 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Hi,
Let me provide a couple of facts first:
- The XMLNSC domain does not use any information from the physical format. It uses only the schemas in the message set to validate the XML.
Aplogies if you knew that already.
- The null handling options in the MRM domain are independent of the validation logic. The point is, you won't fix the validation problem by altering the null handling options ( although you may want to set those options for other, valid reasons )
re: the validation, use XMLNSC. It is a very good implemenation of the W3C XML Schema standard. MRM has various non-standard behaviours.
XMLNSC will simply apply the rules in your schemas. So we could re-state your question as 'how do I design a schema which rejects an empty tag'.
The answer depends on what the elements should look like when they are not empty. If the element has child elements, set minOccurs > 0 on them. If it has a simple type with a limited range of values, put some enumerations on the simple type. Alternatively, set minLength to 1 on the simple type ( assuming that the simple type supports that ). As a last resort, all schema simple types support the Pattern facet. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|