|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Value Constraints/Length Constraints not wrkg 4 xsd:string |
« View previous topic :: View next topic » |
Author |
Message
|
Rodeo |
Posted: Wed Oct 03, 2007 8:49 pm Post subject: Value Constraints/Length Constraints not wrkg 4 xsd:string |
|
|
Apprentice
Joined: 11 Apr 2007 Posts: 30
|
I imported an XML schema for one of my message definitions. The physical format is XML and for one of the XML elements, the value is xsd:string type. In the value constraints/Length constraints, I have set the Max to 4. However, when a value with length >4 shows up in this element, it is not being truncated and the full length element is showing up in the output XML (based on message definition). What could be causing this issue? Am I missing something that I should be setting anywhere else?
Any thoughts/suggestions? |
|
Back to top |
|
 |
AkankshA |
Posted: Wed Oct 03, 2007 8:54 pm Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
|
Back to top |
|
 |
Rodeo |
Posted: Wed Oct 03, 2007 9:19 pm Post subject: |
|
|
Apprentice
Joined: 11 Apr 2007 Posts: 30
|
Thanks for the link and I am pasting the info from that link on value constraints below.
My point/concern however is that though I set the xsd:string type to length 4, why is the element still allowing values of length greater than 4?
Am I trying to use xsd:string in an illegal way as mentioned in:
Length constraints are inherited from ancestor types, and any length constraints defined for a simple type must not relax the constraints imposed by any of its ancestor types. For example, it would be illegal to derive a type 'longString' (Max Length=100) from a type 'shortString' (Max Length=10).
Elements in the XML that show up before this element are also of the xsd:string type and I set the max length to different values for those elements. Could that be causing the issue?
Length Constraints : Length, Min Length, Max Length
Using length constraints, the length of all elements based on the simple type can be constrained or even limited to a single value.
Length constraints can be applied to simple types which are derived from xsd:hexBinary, xsd:base64Binary or xsd:string (including built in schema types such as xsd:normalisedString).
Length constraints are inherited from ancestor types, and any length constraints defined for a simple type must not relax the constraints imposed by any of its ancestor types. For example, it would be illegal to derive a type 'longString' (Max Length=100) from a type 'shortString' (Max Length=10).
Note: For WebSphere Message Broker by default, Length value constraints are converted to Max Length constraints when a message set is added to a BAR file. This avoids WebSphere Message Broker raising spurious validation errors for fixed-length data structures, where the strings tend to be padded to fit a fixed-width field. If strict length validation is required, this default can be changed in the message set properties by changing the flag Broker treats Length facet as MaxLength. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Oct 04, 2007 12:42 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Enable validation on your input node ( or Compute node, or Output node, as required ). |
|
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
|
|
|
|