ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Making an XML Attribute Mandatory

Post new topic  Reply to topic
 Making an XML Attribute Mandatory « View previous topic :: View next topic » 
Author Message
smdavies99
PostPosted: Thu Jun 28, 2007 10:01 pm    Post subject: Making an XML Attribute Mandatory Reply with quote

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
View user's profile Send private message
marcin.kasinski
PostPosted: Thu Jun 28, 2007 11:16 pm    Post subject: Re: Making an XML Attribute Mandatory Reply with quote

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
View user's profile Send private message Visit poster's website
kimbert
PostPosted: Fri Jun 29, 2007 3:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
marcin.kasinski
PostPosted: Sat Jun 30, 2007 12:41 am    Post subject: Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

kimbert wrote:
You have to make it 'required'. ( you can't use min/maxOccurs on attributes).


You are right.
http://www.w3.org/TR/xmlschema-0/#OccurrenceConstraints
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
smdavies99
PostPosted: Sun Jul 01, 2007 12:01 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Making an XML Attribute Mandatory
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.