on 07-11-2011 2:26 PM
Hello experts,
I have a file to file scenario in PI 7.1. I am using xml validation to validate the incoming source file. There are various types of fields in the incoming file including int, decimal and string. They can have a certain enumeration of values but can also have a blank value.
For example field 'Num' of type int can have values 1,2,3 or a blank value.
But I am not able to define a blank value for the field in the enumeration during definition. Therefore a blank value in the input file fails during the validation stage.
Is there any workaround for this?
Thanks!
RR
Hi,
I think that if an integer field may contains blank values is not a correctly populated integer field.
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is a basic problem. When you define a field as integer you cannot declare blank space which represents String type.
So for your case make the value 'zero' instead of blank, if you want do declare the field as integer and as below...
<xs:element name="Num">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:pattern value="[0-3]"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Also refer this page for further reference.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Bhaskar,
My understanding is that the above declaration will only include the value 0 in the enumeration but will not cater to the requirement of including blank value in the enumeration. I have tried changing the type to string and included hexa value 0x00(null) and 0x20(space) in the enumeration. It is still not accepting the empty values in the input file.
Thanks,
RR
@Fabio,
Regular expression can be ideal when there is a pattern to the values coming in. Since in this case, it is a set of random values that the field can have, i will have to write a regular expression with many 'OR'. Can be done but a little roundabout. I ll probably go for that if nothing else works out.
@Bhaskar
The link indicates adding '' as a enumeration value. I tried this as well but did not exactly work out. I ll probably edit the xsd manually and try to add this value as an enumeration.
Thanks guys!
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.