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 ]
|