Brian

Brian

  • NA
  • 9
  • 0

XML Reader

Jan 20 2009 9:39 AM
Hello I am new programmer

I have an xml file. I need to write a program that will read the xml file and its node export to database and format to cvs file as a complete order. I need some to help how should i do it. here is part of my xml.
- <X12_4010_856>
  <BSN BSN01="00" BSN02="193515" BSN03="2007-05-31" BSN04="11:59:38" BSN05="0001" />
- <HLLoop1>
  <HL HL01="1" HL02="0" HL03="S" />
  <TD1 TD101="CTN25" TD102="105" TD106="G" TD107="581.16" TD108="KG" />
  <DTM_2 DTM01="011" DTM02="2007-05-31" />
  <FOB FOB01="CC" />
- <N1Loop1>
  <N1 N101="ST" N102="WALMART 3135 - BRAMPTON" N103="UL" N104="0681131001359" />
  </N1Loop1>
- <N1Loop1>
  <N1 N101="SF" N102="Vantage Foods (MC)" />
  </N1Loop1>
  </HLLoop1>
- <HLLoop1>
  <HL HL01="2" HL02="1" HL03="O" />
  <PRF PRF01="9300101243" PRF04="2007-05-31" />
  <REF REF01="IA" REF02="028372930" />
  <REF REF01="DP" REF02="00093" />
  <REF REF01="MR" REF02="0037" />
  <REF REF01="IV" REF02="679319" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="3" HL02="1" HL03="P" />
  <MAN MAN01="GM" MAN02="00008731256900027718" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="4" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="221029000004" LIN04="IN" LIN05="009304481" LIN06="VN" LIN07="9304481" />
  <SN1 SN102="24.61" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="5" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="221005000004" LIN04="IN" LIN05="009303977" LIN06="VN" LIN07="9303977" />
  <SN1 SN102="4.11" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="6" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220011000008" LIN04="IN" LIN05="009306413" LIN06="VN" LIN07="9306413" />
  <SN1 SN102="2.85" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="7" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220060000004" LIN04="IN" LIN05="009308142" LIN06="VN" LIN07="9308142" />
  <SN1 SN102="2.3" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="8" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220042000008" LIN04="IN" LIN05="009303928" LIN06="VN" LIN07="9303928" />
  <SN1 SN102="7.02" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="9" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220021000005" LIN04="IN" LIN05="009306483" LIN06="VN" LIN07="9306483" />
  <SN1 SN102="2.67" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="10" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220038000005" LIN04="IN" LIN05="009303900" LIN06="VN" LIN07="9303900" />
  <SN1 SN102="3.17" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="11" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220059000008" LIN04="IN" LIN05="009307659" LIN06="VN" LIN07="9307659" />
  <SN1 SN102="6.68" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="12" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="605388183781" LIN04="IN" LIN05="009307596" LIN06="VN" LIN07="9307596" />
  <SN1 SN102="24" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="13" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="221039000001" LIN04="IN" LIN05="009307666" LIN06="VN" LIN07="9307666" />
  <SN1 SN102="40.76" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="14" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="605388183767" LIN04="IN" LIN05="009307589" LIN06="VN" LIN07="9307589" />
  <SN1 SN102="36" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="15" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220010000009" LIN04="IN" LIN05="009306406" LIN06="VN" LIN07="9306406" />
  <SN1 SN102="3.67" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="16" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="221021000002" LIN04="IN" LIN05="009304607" LIN06="VN" LIN07="9304607" />
  <SN1 SN102="3.08" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="17" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="221028000005" LIN04="IN" LIN05="009307813" LIN06="VN" LIN07="9307813" />
  <SN1 SN102="26.56" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="18" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220039000004" LIN04="IN" LIN05="009303907" LIN06="VN" LIN07="9303907" />
  <SN1 SN102="14.25" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="19" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220065000009" LIN04="IN" LIN05="009308674" LIN06="VN" LIN07="9308674" />
  <SN1 SN102="3.96" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="20" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="221011000005" LIN04="IN" LIN05="009307764" LIN06="VN" LIN07="9307764" />
  <SN1 SN102="4.17" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="21" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220066000008" LIN04="IN" LIN05="009308681" LIN06="VN" LIN07="9308681" />
  <SN1 SN102="4.21" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="22" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220005000007" LIN04="IN" LIN05="009306371" LIN06="VN" LIN07="9306371" />
  <SN1 SN102="2.14" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="23" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220041000009" LIN04="IN" LIN05="009303921" LIN06="VN" LIN07="9303921" />
  <SN1 SN102="3" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="24" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220022000004" LIN04="IN" LIN05="009306490" LIN06="VN" LIN07="9306490" />
  <SN1 SN102="4.36" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="25" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220001000001" LIN04="IN" LIN05="009306343" LIN06="VN" LIN07="9306343" />
  <SN1 SN102="4.13" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="26" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220030000003" LIN04="IN" LIN05="009303844" LIN06="VN" LIN07="9303844" />
  <SN1 SN102="2.77" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="27" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="221020000003" LIN04="IN" LIN05="009307785" LIN06="VN" LIN07="9307785" />
  <SN1 SN102="10.23" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="28" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220008000004" LIN04="IN" LIN05="009306392" LIN06="VN" LIN07="9306392" />
  <SN1 SN102="3.32" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="29" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220055000002" LIN04="IN" LIN05="009306679" LIN06="VN" LIN07="9306679" />
  <SN1 SN102="3.18" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="30" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220007000005" LIN04="IN" LIN05="009306385" LIN06="VN" LIN07="9306385" />
  <SN1 SN102="10.36" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="31" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="605388183699" LIN04="IN" LIN05="009307561" LIN06="VN" LIN07="9307561" />
  <SN1 SN102="12" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="32" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220018000001" LIN04="IN" LIN05="009306462" LIN06="VN" LIN07="9306462" />
  <SN1 SN102="2.41" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="33" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220002000000" LIN04="IN" LIN05="009308149" LIN06="VN" LIN07="9308149" />
  <SN1 SN102="8.97" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="34" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="605388183651" LIN04="IN" LIN05="009307540" LIN06="VN" LIN07="9307540" />
  <SN1 SN102="36" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="35" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="605388183637" LIN04="IN" LIN05="009307533" LIN06="VN" LIN07="9307533" />
  <SN1 SN102="12" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="36" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="605388183729" LIN04="IN" LIN05="009307568" LIN06="VN" LIN07="9307568" />
  <SN1 SN102="8" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="37" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220017000002" LIN04="IN" LIN05="009306455" LIN06="VN" LIN07="9306455" />
  <SN1 SN102="3.47" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="38" HL02="3" HL03="I" />
  <LIN LIN02="UP" LIN03="220031000002" LIN04="IN" LIN05="009303851" LIN06="VN" LIN07="9303851" />
  <SN1 SN102="3.98" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="39" HL02="1" HL03="P" />
  <MAN MAN01="GM" MAN02="00008731256900027817" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="40" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221013000003" LIN04="IN" LIN05="009307771" LIN06="VN" LIN07="9307771" />
  <SN1 SN102="17.93" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="41" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221001000008" LIN04="IN" LIN05="009303949" LIN06="VN" LIN07="9303949" />
  <SN1 SN102="3.76" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="42" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221026000007" LIN04="IN" LIN05="009307799" LIN06="VN" LIN07="9307799" />
  <SN1 SN102="12.31" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="43" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="605388183750" LIN04="IN" LIN05="009307582" LIN06="VN" LIN07="9307582" />
  <SN1 SN102="8" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="44" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221006000003" LIN04="IN" LIN05="009303984" LIN06="VN" LIN07="9303984" />
  <SN1 SN102="20.28" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="45" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="605388183620" LIN04="IN" LIN05="009307526" LIN06="VN" LIN07="9307526" />
  <SN1 SN102="24" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="46" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221020000003" LIN04="IN" LIN05="009307785" LIN06="VN" LIN07="9307785" />
  <SN1 SN102="5.09" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="47" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="605388183668" LIN04="IN" LIN05="009307547" LIN06="VN" LIN07="9307547" />
  <SN1 SN102="24" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="48" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221031000009" LIN04="IN" LIN05="009307820" LIN06="VN" LIN07="9307820" />
  <SN1 SN102="2.64" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="49" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221030000000" LIN04="IN" LIN05="009304684" LIN06="VN" LIN07="9304684" />
  <SN1 SN102="4.77" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="50" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221003000006" LIN04="IN" LIN05="009303963" LIN06="VN" LIN07="9303963" />
  <SN1 SN102="6.23" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="51" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="220048000002" LIN04="IN" LIN05="009306616" LIN06="VN" LIN07="9306616" />
  <SN1 SN102="4.63" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="52" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221024000009" LIN04="IN" LIN05="009304621" LIN06="VN" LIN07="9304621" />
  <SN1 SN102="5.22" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="53" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="605388183682" LIN04="IN" LIN05="009307554" LIN06="VN" LIN07="9307554" />
  <SN1 SN102="4" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="54" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221019000007" LIN04="IN" LIN05="009304418" LIN06="VN" LIN07="9304418" />
  <SN1 SN102="7.98" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="55" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221002000007" LIN04="IN" LIN05="009303956" LIN06="VN" LIN07="9303956" />
  <SN1 SN102="25.45" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="56" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221036000004" LIN04="IN" LIN05="009307638" LIN06="VN" LIN07="9307638" />
  <SN1 SN102="5.49" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="57" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221012000004" LIN04="IN" LIN05="009304544" LIN06="VN" LIN07="9304544" />
  <SN1 SN102="5.1" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="58" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221038000002" LIN04="IN" LIN05="009307652" LIN06="VN" LIN07="9307652" />
  <SN1 SN102="4.49" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="59" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="220015000004" LIN04="IN" LIN05="009306441" LIN06="VN" LIN07="9306441" />
  <SN1 SN102="3.32" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="60" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="220028000008" LIN04="IN" LIN05="009303830" LIN06="VN" LIN07="9303830" />
  <SN1 SN102="2.81" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="61" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="220027000009" LIN04="IN" LIN05="009303823" LIN06="VN" LIN07="9303823" />
  <SN1 SN102="2.69" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="62" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="220040000000" LIN04="IN" LIN05="009303914" LIN06="VN" LIN07="9303914" />
  <SN1 SN102="6.53" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="63" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="220029000007" LIN04="IN" LIN05="009303837" LIN06="VN" LIN07="9303837" />
  <SN1 SN102="9.05" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="64" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221010000006" LIN04="IN" LIN05="009304495" LIN06="VN" LIN07="9304495" />
  <SN1 SN102="7.82" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="65" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221008000001" LIN04="IN" LIN05="009304523" LIN06="VN" LIN07="9304523" />
  <SN1 SN102="7.1" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="66" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="605388183798" LIN04="IN" LIN05="009307603" LIN06="VN" LIN07="9307603" />
  <SN1 SN102="8" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="67" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="605388183736" LIN04="IN" LIN05="009307575" LIN06="VN" LIN07="9307575" />
  <SN1 SN102="4" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="68" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="220049000001" LIN04="IN" LIN05="009306623" LIN06="VN" LIN07="9306623" />
  <SN1 SN102="12.08" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="69" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221041000006" LIN04="IN" LIN05="009307883" LIN06="VN" LIN07="9307883" />
  <SN1 SN102="10.74" SN103="EA" />
  </HLLoop1>
- <HLLoop1>
  <HL HL01="70" HL02="39" HL03="I" />
  <LIN LIN02="UP" LIN03="221027000006" LIN04="IN" LIN05="009307806" LIN06="VN" LIN07="9307806" />
  <SN1 SN102="10.35" SN103="EA" />
  </HLLoop1>
  <CTT CTT01="70" />
  </X12_4010_856>

should i create console program
please help


Answers (1)