Delimited Flat file problem
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server Applications Integration > Delimited Flat file problem




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Delimited Flat file problem  
pj


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-08-05 10:51 PM

Hi -
Here's my flat file

HR,PURC,1
AR,PURC,11
AR,PURC,12
AR,PURC,13
HR,SALE,2
AR,SALE,21
AR,SALE,22
AR,SALE,23

I have managed to get an XML that looks like this :

<LOOP xmlns="http://SWIFTSchemas.Schema3">
<HR Field1="PURC,1" xmlns="">
<AR Field2="PURC" Field3="11"></AR>
<AR Field2="PURC" Field3="12"></AR>
<AR Field2="PURC" Field3="13"></AR>
</HR>
</LOOP>

<LOOP xmlns="http://SWIFTSchemas.Schema3">
<HR Field1="SALE,2" xmlns="">
<AR Field2="SALE" Field3="21"></AR>
<AR Field2="SALE" Field3="22"></AR>
<AR Field2="SALE" Field3="23"></AR>
</HR>
</LOOP>

By following a post already on this site - but that was for positional files
.

Whatever I try I can't get the HR Field1 split into separate fields
i.e. I'd like (in the second message)
<HR Field1="SALE" Field1a="2" xmlns="">

Here's the schema I'm currently using ...Help Please!

<?xml version="1.0" encoding="utf-16" ?>
- <xs:schema xmlns="http://SWIFTSchemas.Schema3"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://SWIFTSchemas.Schema3"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xs:annotation>
- <xs:appinfo>
<b:schemaInfo count_positions_by_byte="false" parser_optimization="speed"
lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="true"
allow_early_termination="false" standard="Flat File" root_reference="LOOP" /
>
<schemaEditorExtension:schemaInfo namespaceAlias="b"
extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension"
standardName="Flat File"
xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/Schem
aEditorExtensions" />
</xs:appinfo>
</xs:annotation>
- <xs:element name="LOOP">
- <xs:annotation>
- <xs:appinfo>
<b:recordInfo structure="delimited"
preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false
"
sequence_number="1" child_delimiter_type="hex" child_delimiter="0x0D 0x0A"
child_order="infix" />
</xs:appinfo>
</xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:annotation>
- <xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
- <xs:element maxOccurs="1" name="HR">
- <xs:annotation>
- <xs:appinfo>
<b:recordInfo sequence_number="1" structure="delimited"
preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false
"
child_delimiter_type="hex" tag_name="HR," child_order="postfix"
child_delimiter="0x0D 0x0A" />
</xs:appinfo>
</xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:annotation>
- <xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
- <xs:element maxOccurs="unbounded" name="AR">
- <xs:annotation>
- <xs:appinfo>
<b:recordInfo structure="delimited"
preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false
"
child_delimiter_type="char" tag_name="AR," child_order="infix"
child_delimiter="," sequence_number="2" />
</xs:appinfo>
</xs:annotation>
- <xs:complexType>
- <xs:attribute name="Field2" type="xs:string">
- <xs:annotation>
- <xs:appinfo>
<b:fieldInfo sequence_number="1" justification="left" />
</xs:appinfo>
</xs:annotation>
</xs:attribute>
- <xs:attribute name="Field3" type="xs:string">
- <xs:annotation>
- <xs:appinfo>
<b:fieldInfo sequence_number="2" justification="left" />
</xs:appinfo>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
- <xs:attribute name="Field1" type="xs:string">
- <xs:annotation>
- <xs:appinfo>
<b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>





[ Post a follow-up to this message ]



    Re: Delimited Flat file problem  
Tomas Restrepo \(MVP\)


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-09-05 07:47 AM

Pj,

> Here's my flat file
>
> HR,PURC,1
> AR,PURC,11
> AR,PURC,12
> AR,PURC,13
> HR,SALE,2
> AR,SALE,21
> AR,SALE,22
> AR,SALE,23
>
> I have managed to get an XML that looks like this :
>
<snip/>

You need to do several changes to make it work. Here's one possible
solution:

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://SWIFTSchemas.Schema3"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://SWIFTSchemas.Schema3"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<b:schemaInfo count_positions_by_byte="false"
parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false"
generate_empty_nodes="true" allow_early_termination="false" standard="Flat
File" root_reference="LOOP" />
<schemaEditorExtension:schemaInfo namespaceAlias="b"
extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension"
standardName="Flat File"
xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/Schem
aEditorExtensions"
/>
</xs:appinfo>
</xs:annotation>
<xs:element name="LOOP">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited"
preserve_delimiter_for_empty_data="true"
suppress_trailing_delimiters="false" sequence_number="1" child_order="infix"
child_delimiter_type="hex" child_delimiter="0x0D 0x0A" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="1" maxOccurs="unbounded" name="RECORD">
<xs:annotation>
<xs:appinfo>
<b:recordInfo sequence_number="1" structure="delimited"
preserve_delimiter_for_empty_data="true"
suppress_trailing_delimiters="false" child_order="infix" tag_name="HR"
child_delimiter_type="hex" child_delimiter="0x0D 0x0A" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="HR">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited"
preserve_delimiter_for_empty_data="true"
suppress_trailing_delimiters="false" child_delimiter_type="char"
child_delimiter="," child_order="prefix" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="Name" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number="1"
justification="left" />
</xs:appinfo>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Value" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number="2"
justification="left" />
</xs:appinfo>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" maxOccurs="unbounded" name="AR">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited"
preserve_delimiter_for_empty_data="true"
suppress_trailing_delimiters="false" child_delimiter_type="char"
tag_name="AR" child_order="prefix" child_delimiter="," sequence_number="2"
repeating_delimiter_type="hex" repeating_delimiter="0x0D 0x0A" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="Field2" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number="1"
justification="left" />
</xs:appinfo>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Field3" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number="2"
justification="left" />
</xs:appinfo>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>


--
Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:30 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register