Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
now i created flat file schema( for positional file) and my complexity is, For a scenario 10segments will be avaliable in the schema file all are optional elements so i fixed as min occur as 0, max occurs 36, 
For e.g: Generated instance to be like this 
<pre><Header>
<SEG1>
<SEG1_child1>111</SEG1_child1>
</SEG1>
<SEG2>
<SEG2_child1>222</SEG2_child1>
</SEG2>
<SEG3>
<SEG3_child1>333</SEG3_child1>
</SEG3><!-- upto SEG10-->
</Header>
</pre>

this can be generated while validating instance.(input: 111222333444555666777888999000),

now the input file like this (111222444555666888) means the output like this 
<pre>
<Header>
<SEG1>
<SEG1_child1>111</SEG1_child1>
</SEG1>
<SEG2>
<SEG2_child1>222</SEG2_child1>
</SEG2>
<SEG3>
<SEG3_child1>444</SEG3_child1>
</SEG3><!-- upto SEG10-->
</Header>
</pre>


My Question is: i want the output instance like this,
<pre>&lt;Header>
<SEG1>
<SEG1_child1>111</SEG1_child1>
</SEG1>
<SEG2>
<SEG2_child1>222</SEG2_child1>
</SEG2>
<SEG4>
<SEG4_child1>444</SEG4_child1>
</SEG4>
<SEG5>
<SEG5_child1>555</SEG5_child1>
</SEG5>
<SEG6>
<SEG6_child1>666</SEG6_child1>
</SEG6>
<SEG8>
<SEG8_child1>888</SEG8_child1>
</SEG8>
</Header>
</pre>


even i used  here as tag identifier concept means looking for so& so tag name,
offset concept also not working here,
:~


What I have tried:

i have tired using flat file schema wizard creation as wel as manually created flat file schema, now am getting this type of problem, while validate the instance file.
Posted
Updated 28-Sep-16 11:52am

1 solution

now i created flat file schema( for positional file) and my complexity is, For a scenario 10segments will be avaliable in the schema file all are optional elements so i fixed as min occur as 0, max occurs 36,
For e.g: Generated instance to be like this
<Header>
<seg1>
<seg1_child1>111</seg1_child1>
</seg1>
<seg2>
<seg2_child1>222</seg2_child1>
</seg2>
<seg3>
<seg3_child1>333</seg3_child1>
</seg3><!-- upto SEG10-->
</Header>


this can be generated while validating instance.(input: 111222333444555666777888999000),

now the input file like this (111222444555666888) means the output like this
<Header>
<seg1>
<seg1_child1>111</seg1_child1>
</seg1>
<seg2>
<seg2_child1>222</seg2_child1>
</seg2>
<seg3>
<seg3_child1>444</seg3_child1>
</seg3><!-- upto SEG10-->
</Header>



My Question is: i want the output instance like this,
<Header>
<seg1>
<seg1_child1>111</seg1_child1>
</seg1>
<seg2>
<seg2_child1>222</seg2_child1>
</seg2>
<seg4>
<seg4_child1>444</seg4_child1>
</seg4>
<seg5>
<seg5_child1>555</seg5_child1>
</seg5>
<seg6>
<seg6_child1>666</seg6_child1>
</seg6>
<seg8>
<seg8_child1>888</seg8_child1>
</seg8>
</Header>



even i used here as tag identifier concept means looking for so& so tag name,
offset concept also not working here,
:~
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900