Create a dynamic schema design for Flat Files CSV
i have issue. have sample csv file this
"planid","cardid","person","enrid","subid"
"000144 ","0098563 ","albert jhon ","","3650896 "
"000145 ","0098563 ","","3650896 "
"000146 ","0098563 ","albert jhon ","","3650896 "
so client sending such files each record dont have value option fields. person field optional. record 2 contain no value it. have created flat schema. when tried validate instance, generates following output.
<claims xmlns="http://test.flatfileschema4">
- <claims_child1 xmlns="">
<claims_child1_child1>"planid"</claims_child1_child1>
<claims_child1_child2>"cardid"</claims_child1_child2>
<claims_child1_child3>"person"</claims_child1_child3>
<claims_child1_child4>"enrid"</claims_child1_child4>
<claims_child1_child5>"subid"</claims_child1_child5>
</claims_child1>
- <claims_child1 xmlns="">
<claims_child1_child1>"000144 "</claims_child1_child1>
<claims_child1_child2>"0098563 "</claims_child1_child2>
<claims_child1_child3>"albert jhon "</claims_child1_child3>
<claims_child1_child4>""</claims_child1_child4>
<claims_child1_child5>"3650896 "</claims_child1_child5>
</claims_child1>
- <claims_child1 xmlns="">
<claims_child1_child1>"000145 "</claims_child1_child1>
<claims_child1_child2>"0098563 "</claims_child1_child2>
<claims_child1_child3>""</claims_child1_child3>
<claims_child1_child4>"3650896 " "000146 "</claims_child1_child4>
<claims_child1_child5>"0098563 ","albert jhon ","","3650896 "</claims_child1_child5>
</claims_child1>
</claims>
in output 2nd record not correct , third record, added values second record.
please guide create schema handle these design.
hi bilal,
this xsd work.
<?xml version="1.0" encoding="utf-16"?><xs:schema xmlns:b="http://schemas.microsoft.com/biztalk/2003" xmlns="http://test" targetnamespace="http://test" xmlns:xs="http://www.w3.org/2001/xmlschema">
<xs:annotation>
<xs:appinfo>
<schemaeditorextension:schemainfo namespacealias="b" extensionclass="microsoft.biztalk.flatfileextension.flatfileextension" standardname="flat file" xmlns:schemaeditorextension="http://schemas.microsoft.com/biztalk/2003/schemaeditorextensions" />
<b:schemainfo standard="flat file" codepage="65001" default_pad_char=" " pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="true" allow_early_termination="false" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" root_reference="claims" />
</xs:appinfo>
</xs:annotation>
<xs:element name="claims">
<xs:annotation>
<xs:appinfo>
<b:recordinfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xd 0xa" child_order="infix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
</xs:appinfo>
</xs:annotation>
<xs:complextype>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<groupinfo sequence_number="0" xmlns="http://schemas.microsoft.com/biztalk/2003" />
</xs:appinfo>
</xs:annotation>
<xs:element minoccurs="1" maxoccurs="unbounded" name="claims_record">
<xs:annotation>
<xs:appinfo>
<b:recordinfo structure="delimited" child_delimiter_type="char" child_delimiter="," child_order="infix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
</xs:appinfo>
</xs:annotation>
<xs:complextype>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<groupinfo sequence_number="0" xmlns="http://schemas.microsoft.com/biztalk/2003" />
</xs:appinfo>
</xs:annotation>
<xs:element minoccurs="0" maxoccurs="1" name="planid" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldinfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minoccurs="0" maxoccurs="1" name="carduid" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldinfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minoccurs="0" maxoccurs="1" name="person" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldinfo justification="left" sequence_number="3" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minoccurs="0" maxoccurs="1" name="enrid" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldinfo justification="left" sequence_number="4" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minoccurs="0" maxoccurs="1" name="subid" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldinfo justification="left" sequence_number="5" />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complextype>
</xs:element>
</xs:sequence>
</xs:complextype>
</xs:element>
</xs:schema>
best regards
rasmus jaeger
BizTalk Server > BizTalk Server General
Comments
Post a Comment