document to XML conversion

Ding, Suli (GEIS) Suli.Ding at geis.ge.com
Sat Dec 5 03:54:44 GMT 1998


Philipp,

I modified the template files (both the original and the XML one) to make
the LIN segment and the related segments a new HEADER. The output comes out
just the way you want it. The template files are attached with this e-mail.

Thanks,

Suli 
(P.s. I will make the change to the template files in my page at
	http://www.geocities.com/SiliconValley/Platform/4871/
to reflect the changes)
 <<unb.tbl>>  <<unb.tbl.xml>> 

From:	"Philipp Schaumann" <Philipp.Schaumann at cdc.com>	
To:	<suliding at yahoo.com>	
Cc:	"Soo TuckYan" <TuckYan.Soo at cdc.com>,	
	"Jacob Morrison" <Jacob.Morrison at cdc.com>	
Subject:	document to XML conversion	
Date:	Fri, 4 Dec 1998 11:47:32 +0800	

HI,

I looked at your document-to-XML converter, quite interesting and very
smartly done.  :-)

However, the problem that I had been thinking about seems not (yet ?)
implemented in this. The challenge that I see is how to get a
hierarchical
structure into the documents when converting from EDI (which contains an
implicit hierarchy, e.g. for line item loops, but is basically
syntactically
flat). XML can support hierarchies very nicely.

What I mean is the following: In EDIFACT (and X.12) you have various
repeating groups, e.g. in your sample ORDERS document the line items. In
EDIFACT, you recognize that you are in the second instance of the line
items
loop when you encounter the second LIN segment.

In XML, I would hope for a <LIN>, which is ended by </LIN> and which
includes all the information for this line item. Your converter does not
seem to allow this. Looking at your sample output, the <LIN> bracket
for the
first item does not contain the other segments that also belong to the
first
line item.

What I was hoping for was output that looks like this:

                          <LIN>
                               <LINSEG>
                                   <LinNum>1</LinNum>
                                   <LIN02></LIN02>
                                   <ItemNum>136-804-086</ItemNum>
                                   <ItemTy>BP</ItemTy>
                                   <SLInd>CM316X7R474K16AT</SLInd>
                                   <LinItemNum>MG</LinItemNum>
                                   <LIN05>21:9000:PK</LIN05>
                                   <LIN06>0.053:CT:1:PK</LIN06>
                               </LINSEG>
                               <PIA>
                                   <ProdID>4</ProdID>
                                   <ItemNoID>AVX</ItemNoID>
                                   <ItemNoTy>MF</ItemNoTy>
                               </PIA>
                               <SCC>
                                   <DlvCode>1</DlvCode>
                                   <DlvInst></DlvInst>
                                   </SCC>
                               <QTY>
                                   <QtyQfr>21</QtyQfr>
                                   <Qty>9000</Qty>
                                   <Unit>PK</Unit>
                               </QTY>
                               <DTM>
                                   <DTQfr>002</DTQfr>
                                   <DTPrd></DTPrd>
                               </DTM>
                               <SCC>
                                   <DlvCode>1</DlvCode>
                                   <DlvInst></DlvInst>
                               </SCC>
                               <QTY>
                                   <QtyQfr>21</QtyQfr>
                                   <Qty>2000</Qty>
                                   <Unit>PK</Unit>
                               </QTY>
                               <DTM>
                                   <DTQfr>002</DTQfr>
                                   <DTPrd></DTPrd>
                               </DTM>
                          </LIN>
                          <LIN>
                               <LINSEG>
                                   <LinNum>2</LinNum>
                               .....

The idea is that everything that belongs to 1 line item is group
together.
Would that be possible using your syntax.

Thanks
Philipp



begin 600 unb.tbl
M2$146%0]/#]X;6P@=F5R<VEO;CTB,2XP(C\^/$1/0U5-14Y4/@T*5$Q46%0]
M/"]$3T-5345.5#X@("`@(`T*(PT*(R!F;W(@141)1D%#5"!D;V-U;65N=',-
M"B,-"FAE861E<CU53D(L(%1I;64]*#0L,7,I+"!S97`]2U5.0BLP+"!354(]
M2U5.3T$K,"P@=&5R;3U+54Y(+3`L($1A=&4]*#0L,',I+"!697)S:6]N/2 at Q
M+#%S*2P at 5&5S=#UF,3$L($%#2SUF.2`-"E))1#U53D(L(%-E;F1E<CU;475A
M;&EF:65R/2 at R+#%S*2Q396YD97))1#TH,BPP<RE=+"!296-E:79E<CU;475A
M;&EF:65R/2 at S+#%S*2Q296-E:79E<DE$/2 at S+#!S*5TL($EX0W1L4F5F/68U
M+"!0<W=D/68V+"!!<'!2968]9C<-"E1R86EL97(]54Y:#0HC#0IH96%D97(]
M54Y(+"!-<V=2968]9C$L($US9U1Y240]*#(L,',I+"!-<V=4>59E<G-I;VX]
M*#(L,7,I+"!-<V=4>5)E;#TH,BPR<RD-"E))1#U53D at L($US9U1Y240]*#(L
M,',I#0I2240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19G(^*#$L,',I/"]1='E19G(^#0H)
M"3Q1='D^*#$L,7,I/"]1='D^#0H)"3Q5;FET/B at Q+#)S*3PO56YI=#X-"@D\
M+U))1#X-"@D\4DE$(&UA=&-H/2)30T,B/@T*"0D\1&QV0V]D93YF,3PO1&QV
M0V]D93X-"@D)/$1L=DEN<W0^9C(\+T1L=DEN<W0^"0T*"3PO4DE$/@T*"3Q2
M240@;6%T8V@](D1432(^#0H)"3Q$5%%F<CXH,2PP<RD\+T14469R/@T*"0D\
M1%10<F0^*#$L,7,I/"]$5%!R9#X-"@D\+U))1#X-"CPO2$5!1$52/@T*#0H\
,+U1%35!,051%/@T*
`
end

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list