Author |
Message
|
smdavies99 |
Posted: Thu Jun 28, 2007 10:01 pm Post subject: Making an XML Attribute Mandatory |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Is there a way in a Message Model to make an attribute mandatory.
For example, if I define a Type as Quantity and I have an attribute to that called Units (eg dozen, gross, each etc) I need to make sure that the message data has both a Quantity and its Units attribute.
/S _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Thu Jun 28, 2007 11:16 pm Post subject: Re: Making an XML Attribute Mandatory |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
smdavies99 wrote: |
Is there a way in a Message Model to make an attribute mandatory.
For example, if I define a Type as Quantity and I have an attribute to that called Units (eg dozen, gross, each etc) I need to make sure that the message data has both a Quantity and its Units attribute.
/S |
You can try with minOccurs=1; _________________ Marcin |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jun 29, 2007 3:35 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You have to make it 'required'. ( you can't use min/maxOccurs on attributes).
And if you want it to be checked by the runtime you must
a) use the MRM parser
b) enable validation in your message flow |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Sat Jun 30, 2007 12:41 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
|
Back to top |
|
 |
smdavies99 |
Posted: Sun Jul 01, 2007 12:01 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Thanks Kimbert.
We will switch do as you suggest. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
|