Author |
Message
|
rajmq |
Posted: Fri Jul 18, 2008 1:38 am Post subject: XML Validation |
|
|
 Partisan
Joined: 29 Sep 2002 Posts: 331 Location: USA
|
All,
I have requirement to validate the incoming xml message using XSD
I have created the MsgSet using XSD but if I have multiple enumeration values
Q1. Is it possible to validate more than one vale?
Q2. Is it any specific configuration required in the msgset etc?
<xs:simpleType name="res-cd-type">
<xs:restriction base="xs:string">
<xs:enumeration value="vaild"/>
<xs:enumeration value="Invalid"/> </xs:restriction>
</xs:simpleType>
TIA
 _________________ IBM Certified System Administrator - WebSphere MQ V6.0
IBM Certified System Administrator - WebSphere Business Integration Message Broker V6.0 |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jul 18, 2008 2:39 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
|
Back to top |
|
 |
rajmq |
Posted: Fri Jul 18, 2008 3:01 am Post subject: |
|
|
 Partisan
Joined: 29 Sep 2002 Posts: 331 Location: USA
|
Broker version is : 6.0.3 and using XML parser.
 _________________ IBM Certified System Administrator - WebSphere MQ V6.0
IBM Certified System Administrator - WebSphere Business Integration Message Broker V6.0 |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jul 18, 2008 4:43 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
- The XML domain cannot validate, and is deprecated
- In v6, if you need XML validation you must use the MRM parser with an XML physical format
- Please update to the latest fix pack
- For XML flows which do not require validation, I suggest that you use XMLNSC. It is the recommended XML parser for new message flows, so using it now will make migration to v6.1 easier. |
|
Back to top |
|
 |
rajmq |
Posted: Fri Jul 18, 2008 5:55 am Post subject: |
|
|
 Partisan
Joined: 29 Sep 2002 Posts: 331 Location: USA
|
Quote: |
In v6, if you need XML validation you must use the MRM parser with an XML physical format |
At the moment I planning to use MsgSet for validating the XML but i would like know feasibility for the below
Q1. Is it possible to validate more than one value for a particular tag?
Q2. Is it any specific configuration required in the msgset to handle multiple enumerations?
TIA _________________ IBM Certified System Administrator - WebSphere MQ V6.0
IBM Certified System Administrator - WebSphere Business Integration Message Broker V6.0 |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jul 18, 2008 7:01 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
At the moment I planning to use MsgSet for validating the XML |
You mean you are planning to use the MRM parser for validating the XML. The message set is just a description of the message, and it does not 'validate' anything.
( Sorry if that sounds picky )
Q1 : Yes
Q2 : No |
|
Back to top |
|
 |
rajmq |
Posted: Fri Jul 18, 2008 12:30 pm Post subject: |
|
|
 Partisan
Joined: 29 Sep 2002 Posts: 331 Location: USA
|
I have mentioned wrongly
But when I import xsd schema to MsgSet and able to see definition & attributes but i don't see the tag values
<xs:enumeration value="vaild"/>
<xs:enumeration value="Invalid"/> </xs:restriction>
I have doubt, how the incoming xml message will be validated against the xsd enumeration value?
 _________________ IBM Certified System Administrator - WebSphere MQ V6.0
IBM Certified System Administrator - WebSphere Business Integration Message Broker V6.0 |
|
Back to top |
|
 |
sridhsri |
Posted: Fri Jul 18, 2008 1:07 pm Post subject: |
|
|
Master
Joined: 19 Jun 2008 Posts: 297
|
If I am not mistakes, when the XMLNSC parser validates for content and value, it does check for enum too.
The way you create enums is
1) Create element. When assigning the type, select "New Simple Type Restriction" base type as string (for your example). This will create the element with a '+' sign. If you expand it you will find xs:string
2) When you click on properties of xs:string, you will find "Value Constraints". Here you can specify the enums.
In your case, since you are not doing this by hand, you only need to follow step 2 to locate the enum value constraints. |
|
Back to top |
|
 |
kimbert |
Posted: Sat Jul 19, 2008 2:30 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
But when I import xsd schema to MsgSet and able to see definition & attributes but i don't see the tag values |
sridhsri is correct.When you import an XML Schema to create a Message Definition File, any facets in the xsd become 'Value Constraints' in the Message Definition File.
Quote: |
I have doubt, how the incoming xml message will be validated against the xsd enumeration value? |
Have you tried it to see what happens?
sridhsri said:
Quote: |
If I am not mistaken, when the XMLNSC parser validates for content and value, it does check for enum too. |
That's true. XMLNSC is close to being a perfect implementation of the XSD specification. But rajmq is using MRM, not XMLNSC. |
|
Back to top |
|
 |
|