Author |
Message
|
doll |
Posted: Fri Dec 24, 2010 4:53 am Post subject: Trimming and justification settings are available using MRM |
|
|
Novice
Joined: 04 Dec 2010 Posts: 19
|
Hi,
I'm using wmb version 7.
I need to validate and trim the incoming xml message using message set.
I gave whitespace as collapse.
But i get an warning message as:
MRM domain: Simple Type Definition 'string-' contains a whiteSpace facet, which is not supported and will be ignored by the broker. Trimming and justification settings are available using MRM physical format properties.
Is there any way to trim the incoming xml message using message set ?
Thanks in advance  |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Dec 24, 2010 5:07 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
The XMLNSC parser supports the full range of options available in XML Schema. So you just need to set the necessary XML Schema restrictions. |
|
Back to top |
|
 |
doll |
Posted: Fri Dec 24, 2010 9:10 am Post subject: Trimming and justification settings are available using MRM |
|
|
Novice
Joined: 04 Dec 2010 Posts: 19
|
Hi,
Thanks for the reply
I tried with the XMLNSC parser and gave the whitespace option collapse
but still i get the output xml without space trimmed
Thanks in advance! |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Dec 24, 2010 9:11 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
that only handles whitespace *between* elements. If you wish to apply length restrictions to the contents of fields, you must apply restrictions therefore. |
|
Back to top |
|
 |
doll |
Posted: Sat Dec 25, 2010 10:51 pm Post subject: Trimming and justification settings are available using MRM |
|
|
Novice
Joined: 04 Dec 2010 Posts: 19
|
Thanks for the reply
I have applied length restrictions to the contents of fields such as string minlength as 3 and maxlength as 9.
But i need the content to be without leading and trailing spaces even if the maxlength of the content is 9.
eg: "BIC0123 "
I need the output to be "BIC0123" after i validate the ouput with the message set.
 |
|
Back to top |
|
 |
smdavies99 |
Posted: Sun Dec 26, 2010 12:44 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Have you experimented with the Padding Characters (=NULL)? _________________ 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 |
|
 |
doll |
Posted: Sun Dec 26, 2010 1:41 am Post subject: Trimming and justification settings are available using MRM |
|
|
Novice
Joined: 04 Dec 2010 Posts: 19
|
Thanks for the reply
As for as i know,Padding Characters (=NULL) is available in CWF OR TDS wire format but i'm working on XML message that can have either MRM or XMLNSC parser in the message set to validate. |
|
Back to top |
|
 |
mqjeff |
Posted: Sun Dec 26, 2010 7:19 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Okay, so I think I was misreading your initial statement.
You set WhiteSpace which is a logical property on a String. I thought you had set the options that control whether XMLNSC will retain the spaces between elements or not.
As you saw from the error, this logical property of string elements does not apply to the MRM parser, it only applies to XMLNSC. You should only be using MRM parser for NON-XML data anyway.
So don't use MRM and don't use an XML Physical layer in MRM. Just use XMLNSC and make sure the input node is set to validate Content and Value and to Build Tree using XML Schema Data Types. |
|
Back to top |
|
 |
doll |
Posted: Mon Dec 27, 2010 1:51 am Post subject: Trimming and justification settings are available using MRM |
|
|
Novice
Joined: 04 Dec 2010 Posts: 19
|
Thanks for the reply
As you said,"Build Tree using XML Schema Data Types" is the cause of this error.
But i need to include this thru esql as i'm validating output message.
I'm searching for that
Thanks for your help
 |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Dec 27, 2010 2:56 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I'm not sure that the XMLNSC parser will automatically truncate fields on output.
But since you're already executing a SET statement to construct the field, you can easily use an ESQL function to trim leading and trailing whitespace. |
|
Back to top |
|
 |
doll |
Posted: Mon Dec 27, 2010 3:19 am Post subject: Trimming and justification settings are available using MRM |
|
|
Novice
Joined: 04 Dec 2010 Posts: 19
|
thanks for your reply
As of now i have used trim function to trim the output message tree upto two level.
Disadvantages are:
1. One field can have space
2. They may include additional fields in future
If the change can be done by using a simple option that depends on message set properties,that will be easier to maintain.
Just dont want to change the code many times  |
|
Back to top |
|
 |
kimbert |
Posted: Mon Dec 27, 2010 5:00 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
XMLNSC does not trim fields on output when the whitespace facet is specified. This is a known limitation.
Glad you found a workaround. |
|
Back to top |
|
 |
doll |
Posted: Mon Dec 27, 2010 9:21 am Post subject: Trimming and justification settings are available using MRM |
|
|
Novice
Joined: 04 Dec 2010 Posts: 19
|
Thanks for your reply
Sorry,i'm little late to know this limitation.
Special thanks mqjeff, for your patience to explain the cause of this error
 |
|
Back to top |
|
 |
|