按名称获取XML元素

本文关键字:XML 元素 获取 | 更新日期: 2023-09-27 18:12:25

我有一个似乎是由eConnect的传出服务生成的复杂xml文件,然后保存在MSMQ中。目标是在这个XML中获得一些指定的字段/元素。

例如,我试过:

XmlNode node = WordDoc.SelectSingleNode("Sales_History_Transaction/eConnect/SO_Hist_Trans/SOPNUMBE");

没有成功。下面是XML:

<?xml version="1.0"?>
<Sales_History_Transaction:root xmlns:Sales_History_Transaction="http://microsoft.com/eConnect/Sales_History_Transaction.xsd">
<eConnect ACTION="1" Requester_DOCTYPE="Sales_History_Transaction" DBNAME="TWO"  TABLENAME="SOP30200" DATE1="2013-05-03T09:24:09.970" SOPNUMBE="60747" SOPTYPE="3">
<SO_Hist_Trans>
    <SOPNUMBE>60747</SOPNUMBE>
    <SOPTYPE>3</SOPTYPE>
    <ORIGTYPE>2</ORIGTYPE>
    <ORIGNUMB>61626</ORIGNUMB>
    <DOCID>STDINV</DOCID>
    <DOCDATE>2013-05-02T00:00:00</DOCDATE>
    <GLPOSTDT>2013-05-02T00:00:00</GLPOSTDT>
    <QUOTEDAT>1900-01-01T00:00:00</QUOTEDAT>
    <QUOEXPDA>1900-01-01T00:00:00</QUOEXPDA>
    <ORDRDATE>2013-04-29T00:00:00</ORDRDATE>
    <INVODATE>2013-05-02T00:00:00</INVODATE>
    <BACKDATE>1900-01-01T00:00:00</BACKDATE>
    <RETUDATE>1900-01-01T00:00:00</RETUDATE>
    <ReqShipDate>2013-05-02T00:00:00</ReqShipDate>
    <FUFILDAT>2013-05-01T00:00:00</FUFILDAT>
    <ACTLSHIP>2013-05-01T00:00:00</ACTLSHIP>
    <DISCDATE>2013-05-02T00:00:00</DISCDATE>
    <DUEDATE>2013-07-01T00:00:00</DUEDATE>
    <REPTING>0</REPTING>
    <TRXFREQU>1</TRXFREQU>
    <TIMEREPD>0</TIMEREPD>
    <TIMETREP>0</TIMETREP>
    <DYSTINCR>0</DYSTINCR>
    <DTLSTREP>1900-01-01T00:00:00</DTLSTREP>
    <DSTBTCH1/>
    <DSTBTCH2/>
    <USDOCID1/>
    <USDOCID2/>
    <DISCFRGT>0.00000</DISCFRGT>
    <ORDAVFRT>0.00000</ORDAVFRT>
    <DISCMISC>0.00000</DISCMISC>
    <ORDAVMSC>0.00000</ORDAVMSC>
    <DISAVAMT>0.00000</DISAVAMT>
    <ORDAVAMT>0.00000</ORDAVAMT>
    <DISCRTND>0.00000</DISCRTND>
    <ORDISRTD>0.00000</ORDISRTD>
    <DISTKNAM>0.00000</DISTKNAM>
    <ORDISTKN>0.00000</ORDISTKN>
    <DSCPCTAM>0</DSCPCTAM>
    <DSCDLRAM>0.00000</DSCDLRAM>
    <ORDDLRAT>0.00000</ORDDLRAT>
    <DISAVTKN>0.00000</DISAVTKN>
    <ORDATKN>0.00000</ORDATKN>
    <PYMTRMID>NET 60</PYMTRMID>
    <PRCLEVEL>1</PRCLEVEL>
    <LOCNCODE>01</LOCNCODE>
    <BCHSOURC>Sales Entry</BCHSOURC>
    <BACHNUMB>GH 05022013 INV</BACHNUMB>
    <CUSTNMBR>USAIND</CUSTNMBR>
    <CUSTNAME>USA INDUSTRIES</CUSTNAME>
    <CSTPONBR>765096MP</CSTPONBR>
    <PROSPECT>0</PROSPECT>
    <MSTRNUMB>33837</MSTRNUMB>
    <PCKSLPNO>60747</PCKSLPNO>
    <PICTICNU/>
    <MRKDNAMT>0.00000</MRKDNAMT>
    <ORMRKDAM>0.00000</ORMRKDAM>
    <PRBTADCD>1034</PRBTADCD>
    <PRSTADCD>BAYSHORE</PRSTADCD>
    <CNTCPRSN/>
    <ShipToName>USA INDUSTRIES</ShipToName>
    <ADDRESS1>12 Wisconsin Court</ADDRESS1>
    <ADDRESS2/>
    <ADDRESS3/>
    <CITY>Bayshore</CITY>
    <STATE>NY</STATE>
    <ZIPCODE>11706</ZIPCODE>
    <COUNTRY>UNITED STATES</COUNTRY>
    <PHNUMBR1/>
    <PHNUMBR2/>
    <PHONE3/>
    <FAXNUMBR/>
    <COMAPPTO>0</COMAPPTO>
    <COMMAMNT>0.00000</COMMAMNT>
    <OCOMMAMT>0.00000</OCOMMAMT>
    <CMMSLAMT>950.00000</CMMSLAMT>
    <ORCOSAMT>950.00000</ORCOSAMT>
    <NCOMAMNT>0.00000</NCOMAMNT>
    <ORNCMAMT>0.00000</ORNCMAMT>
    <SHIPMTHD/>
    <TRDISAMT>0.00000</TRDISAMT>
    <ORTDISAM>0.00000</ORTDISAM>
    <TRDISPCT>0</TRDISPCT>
    <SUBTOTAL>950.00000</SUBTOTAL>
    <ORSUBTOT>950.00000</ORSUBTOT>
    <REMSUBTO>950.00000</REMSUBTO>
    <OREMSUBT>950.00000</OREMSUBT>
    <EXTDCOST>880.00000</EXTDCOST>
    <OREXTCST>880.00000</OREXTCST>
    <FRTAMNT>0.00000</FRTAMNT>
    <ORFRTAMT>0.00000</ORFRTAMT>
    <MISCAMNT>0.00000</MISCAMNT>
    <ORMISCAMT>0.00000</ORMISCAMT>
    <TXENGCLD>1</TXENGCLD>
    <TAXEXMT1/>
    <TAXEXMT2/>
    <TXRGNNUM/>
    <TAXSCHID/>
    <TXSCHSRC>0</TXSCHSRC>
    <BSIVCTTL>0</BSIVCTTL>
    <FRTSCHID/>
    <FRTTXAMT>0.00000</FRTTXAMT>
    <ORFRTTAX>0.00000</ORFRTTAX>
    <FRGTTXBL>2</FRGTTXBL>
    <MSCSCHID/>
    <MSCTXAMT>0.00000</MSCTXAMT>
    <ORMSCTAX>0.00000</ORMSCTAX>
    <MISCTXBL>2</MISCTXBL>
    <BKTFRTAM>0.00000</BKTFRTAM>
    <ORBKTFRT>0.00000</ORBKTFRT>
    <BKTMSCAM>0.00000</BKTMSCAM>
    <ORBKTMSC>0.00000</ORBKTMSC>
    <BCKTXAMT>0.00000</BCKTXAMT>
    <OBTAXAMT>0.00000</OBTAXAMT>
    <TXBTXAMT>0.00000</TXBTXAMT>
    <OTAXTAMT>0.00000</OTAXTAMT>
    <TAXAMNT>0.00000</TAXAMNT>
    <ORTAXAMT>0.00000</ORTAXAMT>
    <ECTRX>0</ECTRX>
    <DOCAMNT>950.00000</DOCAMNT>
    <ORDOCAMT>950.00000</ORDOCAMT>
    <PYMTRCVD>0.00000</PYMTRCVD>
    <ORPMTRVD>0.00000</ORPMTRVD>
    <DEPRECVD>0.00000</DEPRECVD>
    <ORDEPRVD>0.00000</ORDEPRVD>
    <CODAMNT>0.00000</CODAMNT>
    <ORCODAMT>0.00000</ORCODAMT>
    <ACCTAMNT>950.00000</ACCTAMNT>
    <ORACTAMT>950.00000</ORACTAMT>
    <SALSTERR>ALL</SALSTERR>
    <SLPRSNID>JMCGUINNESS</SLPRSNID>
    <UPSZONE/>
    <TIMESPRT>3</TIMESPRT>
    <PSTGSTUS>2</PSTGSTUS>
    <VOIDSTTS>0</VOIDSTTS>
    <ALLOCABY>1</ALLOCABY>
    <NOTEINDX>4454048.00000</NOTEINDX>
    <CURNCYID/>
    <CURRNIDX>1007</CURRNIDX>
    <RATETPID/>
    <EXGTBLID/>
    <XCHGRATE>0.0000000</XCHGRATE>
    <DENXRATE>0.0000000</DENXRATE>
    <EXCHDATE>1900-01-01T00:00:00</EXCHDATE>
    <TIME1>1900-01-01T00:00:00</TIME1>
    <RTCLCMTD>0</RTCLCMTD>
    <MCTRXSTT>0</MCTRXSTT>
    <TRXSORCE>SLSTE00005184</TRXSORCE>
    <COMMNTID/>
    <REFRENCE/>
    <POSTEDDT>2013-05-03T00:00:00</POSTEDDT>
    <PTDUSRID>reception</PTDUSRID>
    <USER2ENT>ghowlett</USER2ENT>
    <CREATDDT>2013-05-01T00:00:00</CREATDDT>
    <MODIFDT>2013-05-03T00:00:00</MODIFDT>
    <Tax_Date>2013-05-02T00:00:00</Tax_Date>
    <APLYWITH>0</APLYWITH>
    <WITHHAMT>0.00000</WITHHAMT>
    <SHPPGDOC>0</SHPPGDOC>
    <CORRCTN>0</CORRCTN>
    <SIMPLIFD>0</SIMPLIFD>
    <DOCNCORR/>
    <SEQNCORR>0</SEQNCORR>
    <SALEDATE>1900-01-01T00:00:00</SALEDATE>
    <EXCEPTIONALDEMAND>0</EXCEPTIONALDEMAND>
    <Flags>4</Flags>
    <Commissions>
        <SOPTYPE>3</SOPTYPE>
        <SOPNUMBE>60747</SOPNUMBE>
        <SEQNUMBR>16384</SEQNUMBR>
        <SLPRSNID>JMCGUINNESS</SLPRSNID>
        <SALSTERR>ALL</SALSTERR>
        <COMPRCNT>0</COMPRCNT>
        <COMMAMNT>0.00000</COMMAMNT>
        <OCOMMAMT>0.00000</OCOMMAMT>
        <NCOMAMNT>0.00000</NCOMAMNT>
        <ORNCMAMT>0.00000</ORNCMAMT>
        <PRCTOSAL>10000</PRCTOSAL>
        <ACTSLAMT>950.00000</ACTSLAMT>
        <ORSLSAMT>950.00000</ORSLSAMT>
        <CMMSLAMT>950.00000</CMMSLAMT>
        <ORCOSAMT>950.00000</ORCOSAMT>
        <CURRNIDX>1007</CURRNIDX>
        <TRXSORCE>SLSTE00005184</TRXSORCE>
    </Commissions>
    <Distribution>
        <SOPTYPE>3</SOPTYPE>
        <SOPNUMBE>60747</SOPNUMBE>
        <SEQNUMBR>16384</SEQNUMBR>
        <DISTTYPE>2</DISTTYPE>
        <DistRef/>
        <ACTINDX>5</ACTINDX>
        <DEBITAMT>950.00000</DEBITAMT>
        <ORDBTAMT>950.00000</ORDBTAMT>
        <CRDTAMNT>0.00000</CRDTAMNT>
        <ORCRDAMT>0.00000</ORCRDAMT>
        <CURRNIDX>1007</CURRNIDX>
        <TRXSORCE>SLSTE00005184</TRXSORCE>
        <POSTED>1</POSTED>
    </Distribution>
    <Distribution>
        <SOPTYPE>3</SOPTYPE>
        <SOPNUMBE>60747</SOPNUMBE>
        <SEQNUMBR>32768</SEQNUMBR>
        <DISTTYPE>1</DISTTYPE>
        <DistRef/>
        <ACTINDX>124</ACTINDX>
        <DEBITAMT>0.00000</DEBITAMT>
        <ORDBTAMT>0.00000</ORDBTAMT>
        <CRDTAMNT>390.00000</CRDTAMNT>
        <ORCRDAMT>390.00000</ORCRDAMT>
        <CURRNIDX>1007</CURRNIDX>
        <TRXSORCE>SLSTE00005184</TRXSORCE>
        <POSTED>1</POSTED>
    </Distribution>
    <Distribution>
        <SOPTYPE>3</SOPTYPE>
        <SOPNUMBE>60747</SOPNUMBE>
        <SEQNUMBR>49152</SEQNUMBR>
        <DISTTYPE>1</DISTTYPE>
        <DistRef/>
        <ACTINDX>125</ACTINDX>
        <DEBITAMT>0.00000</DEBITAMT>
        <ORDBTAMT>0.00000</ORDBTAMT>
        <CRDTAMNT>560.00000</CRDTAMNT>
        <ORCRDAMT>560.00000</ORCRDAMT>
        <CURRNIDX>1007</CURRNIDX>
        <TRXSORCE>SLSTE00005184</TRXSORCE>
        <POSTED>1</POSTED>
    </Distribution>
    <Distribution>
        <SOPTYPE>3</SOPTYPE>
        <SOPNUMBE>60747</SOPNUMBE>
        <SEQNUMBR>65536</SEQNUMBR>
        <DISTTYPE>15</DISTTYPE>
        <DistRef/>
        <ACTINDX>1390</ACTINDX>
        <DEBITAMT>0.00000</DEBITAMT>
        <ORDBTAMT>0.00000</ORDBTAMT>
        <CRDTAMNT>600.00000</CRDTAMNT>
        <ORCRDAMT>600.00000</ORCRDAMT>
        <CURRNIDX>1007</CURRNIDX>
        <TRXSORCE>SLSTE00005184</TRXSORCE>
        <POSTED>1</POSTED>
    </Distribution>
    <Distribution>
        <SOPTYPE>3</SOPTYPE>
        <SOPNUMBE>60747</SOPNUMBE>
        <SEQNUMBR>81920</SEQNUMBR>
        <DISTTYPE>14</DISTTYPE>
        <DistRef/>
        <ACTINDX>1390</ACTINDX>
        <DEBITAMT>600.00000</DEBITAMT>
        <ORDBTAMT>600.00000</ORDBTAMT>
        <CRDTAMNT>0.00000</CRDTAMNT>
        <ORCRDAMT>0.00000</ORCRDAMT>
        <CURRNIDX>1007</CURRNIDX>
        <TRXSORCE>SLSTE00005184</TRXSORCE>
        <POSTED>1</POSTED>
    </Distribution>
    <Distribution>
        <SOPTYPE>3</SOPTYPE>
        <SOPNUMBE>60747</SOPNUMBE>
        <SEQNUMBR>98304</SEQNUMBR>
        <DISTTYPE>15</DISTTYPE>
        <DistRef/>
        <ACTINDX>1394</ACTINDX>
        <DEBITAMT>0.00000</DEBITAMT>
        <ORDBTAMT>0.00000</ORDBTAMT>
        <CRDTAMNT>280.00000</CRDTAMNT>
        <ORCRDAMT>280.00000</ORCRDAMT>
        <CURRNIDX>1007</CURRNIDX>
        <TRXSORCE>SLSTE00005184</TRXSORCE>
        <POSTED>1</POSTED>
    </Distribution>
    <Distribution>
        <SOPTYPE>3</SOPTYPE>
        <SOPNUMBE>60747</SOPNUMBE>
        <SEQNUMBR>114688</SEQNUMBR>
        <DISTTYPE>14</DISTTYPE>
        <DistRef/>
        <ACTINDX>1394</ACTINDX>
        <DEBITAMT>280.00000</DEBITAMT>
        <ORDBTAMT>280.00000</ORDBTAMT>
        <CRDTAMNT>0.00000</CRDTAMNT>
        <ORCRDAMT>0.00000</ORCRDAMT>
        <CURRNIDX>1007</CURRNIDX>
        <TRXSORCE>SLSTE00005184</TRXSORCE>
        <POSTED>1</POSTED>
    </Distribution>
    <Payments/>
    <Holds/>
    <UserDefined>
        <SOPTYPE>3</SOPTYPE>
        <SOPNUMBE>60747</SOPNUMBE>
        <USRDAT01>2013-05-01T00:00:00</USRDAT01>
        <USRDAT02>1900-01-01T00:00:00</USRDAT02>
        <USRTAB01/>
        <USRTAB09/>
        <USRTAB03/>
        <USERDEF1>43179</USERDEF1>
        <USERDEF2>268</USERDEF2>
        <USRDEF03>84.76</USRDEF03>
        <USRDEF04/>
        <USRDEF05/>
        <COMMENT_1/>
        <COMMENT_2/>
        <COMMENT_3/>
        <COMMENT_4/>
    </UserDefined>
    <Deposit/>
    <Notes>
        <NOTEINDX>4454048.00000</NOTEINDX>
        <DATE1>2013-05-01T00:00:00</DATE1>
        <TIME1>1900-01-01T12:19:00</TIME1>
        <TXTFIELD>16, 17, 18, 19</TXTFIELD>
    </Notes>
    <Line>
        <SOPNUMBE>60747</SOPNUMBE>
        <SOPTYPE>3</SOPTYPE>
        <CMPNTSEQ>0</CMPNTSEQ>
        <LNITMSEQ>16384</LNITMSEQ>
        <ITEMNMBR>17-2000</ITEMNMBR>
        <ITEMDESC>K34-51 K40, K41 95 MAX REAR LOOKS LIKE 1801/2 BUT</ITEMDESC>
        <NONINVEN>0</NONINVEN>
        <DROPSHIP>0</DROPSHIP>
        <UOFM>Each</UOFM>
        <LOCNCODE>01</LOCNCODE>
        <UNITCOST>0.00000</UNITCOST>
        <ORUNTCST>0.00000</ORUNTCST>
        <UNITPRCE>6.00000</UNITPRCE>
        <ORUNTPRC>6.00000</ORUNTPRC>
        <XTNDPRCE>180.00000</XTNDPRCE>
        <OXTNDPRC>180.00000</OXTNDPRC>
        <REMPRICE>180.00000</REMPRICE>
        <OREPRICE>180.00000</OREPRICE>
        <EXTDCOST>0.00000</EXTDCOST>
        <OREXTCST>0.00000</OREXTCST>
        <MRKDNAMT>0.00000</MRKDNAMT>
        <ORMRKDAM>0.00000</ORMRKDAM>
        <MRKDNPCT>0</MRKDNPCT>
        <MRKDNTYP>0</MRKDNTYP>
        <INVINDX>1390</INVINDX>
        <CSLSINDX>1390</CSLSINDX>
        <SLSINDX>124</SLSINDX>
        <MKDNINDX>124</MKDNINDX>
        <RTNSINDX>1390</RTNSINDX>
        <INUSINDX>0</INUSINDX>
        <INSRINDX>0</INSRINDX>
        <DMGDINDX>0</DMGDINDX>
        <ITMTSHID/>
        <IVITMTXB>2</IVITMTXB>
        <BKTSLSAM>0.00000</BKTSLSAM>
        <ORBKTSLS>0.00000</ORBKTSLS>
        <TAXAMNT>0.00000</TAXAMNT>
        <ORTAXAMT>0.00000</ORTAXAMT>
        <TXBTXAMT>0.00000</TXBTXAMT>
        <OTAXTAMT>0.00000</OTAXTAMT>
        <BSIVCTTL>0</BSIVCTTL>
        <TRDISAMT>0.00000</TRDISAMT>
        <ORTDISAM>0.00000</ORTDISAM>
        <DISCSALE>0.00000</DISCSALE>
        <ORDAVSLS>0.00000</ORDAVSLS>
        <QUANTITY>30.00000</QUANTITY>
        <ATYALLOC>30.00000</ATYALLOC>
        <QTYINSVC>0.00000</QTYINSVC>
        <QTYINUSE>0.00000</QTYINUSE>
        <QTYDMGED>0.00000</QTYDMGED>
        <QTYRTRND>0.00000</QTYRTRND>
        <QTYONHND>0.00000</QTYONHND>
        <QTYCANCE>0.00000</QTYCANCE>
        <QTYCANOT>0.00000</QTYCANOT>
        <QTYORDER>30.00000</QTYORDER>
        <QTYPRBAC>0.00000</QTYPRBAC>
        <QTYPRBOO>0.00000</QTYPRBOO>
        <QTYPRINV>0.00000</QTYPRINV>
        <QTYPRORD>0.00000</QTYPRORD>
        <QTYPRVRECVD>0.00000</QTYPRVRECVD>
        <QTYRECVD>0.00000</QTYRECVD>
        <QTYREMAI>30.00000</QTYREMAI>
        <QTYREMBO>0.00000</QTYREMBO>
        <QTYTBAOR>0.00000</QTYTBAOR>
        <QTYTOINV>30.00000</QTYTOINV>
        <QTYTORDR>0.00000</QTYTORDR>
        <QTYFULFI>30.00000</QTYFULFI>
        <QTYSLCTD>30.00000</QTYSLCTD>
        <QTYBSUOM>1.00000</QTYBSUOM>
        <EXTQTYAL>0.00000</EXTQTYAL>
        <EXTQTYSEL>0.00000</EXTQTYSEL>
        <ReqShipDate>2013-05-01T00:00:00</ReqShipDate>
        <FUFILDAT>2013-05-01T00:00:00</FUFILDAT>
        <ACTLSHIP>2013-05-01T00:00:00</ACTLSHIP>
        <SHIPMTHD/>
        <SALSTERR>ALL</SALSTERR>
        <SLPRSNID>JMCGUINNESS</SLPRSNID>
        <PRCLEVEL>1</PRCLEVEL>
        <COMMNTID>CUSTNUMBER</COMMNTID>
        <BRKFLD1>0</BRKFLD1>
        <BRKFLD2>0</BRKFLD2>
        <BRKFLD3>0</BRKFLD3>
        <CURRNIDX>1007</CURRNIDX>
        <TRXSORCE>SLSTE00005184</TRXSORCE>
        <ORGSEQNM>0</ORGSEQNM>
        <ITEMCODE/>
        <PURCHSTAT>1</PURCHSTAT>
        <DECPLQTY>1</DECPLQTY>
        <DECPLCUR>3</DECPLCUR>
        <ODECPLCU>3</ODECPLCU>
        <EXCEPTIONALDEMAND>0</EXCEPTIONALDEMAND>
        <TAXSCHID/>
        <TXSCHSRC>0</TXSCHSRC>
        <PRSTADCD>BAYSHORE</PRSTADCD>
        <ShipToName>USA INDUSTRIES</ShipToName>
        <CNTCPRSN/>
        <ADDRESS1>12 Wisconsin Court</ADDRESS1>
        <ADDRESS2/>
        <ADDRESS3/>
        <CITY>Bayshore</CITY>
        <STATE>NY</STATE>
        <ZIPCODE>11706</ZIPCODE>
        <COUNTRY>UNITED STATES</COUNTRY>
        <PHONE1/>
        <PHONE2/>
        <PHONE3/>
        <FAXNUMBR/>
        <Flags>0</Flags>
        <CONTNBR/>
        <CONTLNSEQNBR>0.00000</CONTLNSEQNBR>
        <CONTSTARTDTE>1900-01-01T00:00:00</CONTSTARTDTE>
        <CONTENDDTE>1900-01-01T00:00:00</CONTENDDTE>
        <CONTITEMNBR/>
        <CONTSERIALNBR/>
        <Line_Tax/>
    </Line>
    <Line>
        <SOPNUMBE>60747</SOPNUMBE>
        <SOPTYPE>3</SOPTYPE>
        <CMPNTSEQ>0</CMPNTSEQ>
        <LNITMSEQ>32768</LNITMSEQ>
        <ITEMNMBR>17-2068</ITEMNMBR>
        <ITEMDESC>9CLP14S HONDA ACCORD  R/REAR  1998              
    </ITEMDESC>
    <NONINVEN>0</NONINVEN>
    <DROPSHIP>0</DROPSHIP>
    <UOFM>Each</UOFM>
    <LOCNCODE>01</LOCNCODE>
    <UNITCOST>20.00000</UNITCOST>
    <ORUNTCST>20.00000</ORUNTCST>
    <UNITPRCE>7.00000</UNITPRCE>
    <ORUNTPRC>7.00000</ORUNTPRC>
    <XTNDPRCE>210.00000</XTNDPRCE>
    <OXTNDPRC>210.00000</OXTNDPRC>
    <REMPRICE>210.00000</REMPRICE>
    <OREPRICE>210.00000</OREPRICE>
    <EXTDCOST>600.00000</EXTDCOST>
    <OREXTCST>600.00000</OREXTCST>
    <MRKDNAMT>0.00000</MRKDNAMT>
    <ORMRKDAM>0.00000</ORMRKDAM>
    <MRKDNPCT>0</MRKDNPCT>
    <MRKDNTYP>0</MRKDNTYP>
    <INVINDX>1390</INVINDX>
    <CSLSINDX>1390</CSLSINDX>
    <SLSINDX>124</SLSINDX>
    <MKDNINDX>124</MKDNINDX>
    <RTNSINDX>1390</RTNSINDX>
    <INUSINDX>0</INUSINDX>
    <INSRINDX>0</INSRINDX>
    <DMGDINDX>0</DMGDINDX>
    <ITMTSHID/>
    <IVITMTXB>2</IVITMTXB>
    <BKTSLSAM>0.00000</BKTSLSAM>
    <ORBKTSLS>0.00000</ORBKTSLS>
    <TAXAMNT>0.00000</TAXAMNT>
    <ORTAXAMT>0.00000</ORTAXAMT>
    <TXBTXAMT>0.00000</TXBTXAMT>
    <OTAXTAMT>0.00000</OTAXTAMT>
    <BSIVCTTL>0</BSIVCTTL>
    <TRDISAMT>0.00000</TRDISAMT>
    <ORTDISAM>0.00000</ORTDISAM>
    <DISCSALE>0.00000</DISCSALE>
    <ORDAVSLS>0.00000</ORDAVSLS>
    <QUANTITY>30.00000</QUANTITY>
    <ATYALLOC>30.00000</ATYALLOC>
    <QTYINSVC>0.00000</QTYINSVC>
    <QTYINUSE>0.00000</QTYINUSE>
    <QTYDMGED>0.00000</QTYDMGED>
    <QTYRTRND>0.00000</QTYRTRND>
    <QTYONHND>0.00000</QTYONHND>
    <QTYCANCE>0.00000</QTYCANCE>
    <QTYCANOT>0.00000</QTYCANOT>
    <QTYORDER>30.00000</QTYORDER>
    <QTYPRBAC>0.00000</QTYPRBAC>
    <QTYPRBOO>0.00000</QTYPRBOO>
    <QTYPRINV>0.00000</QTYPRINV>
    <QTYPRORD>0.00000</QTYPRORD>
    <QTYPRVRECVD>0.00000</QTYPRVRECVD>
    <QTYRECVD>0.00000</QTYRECVD>
    <QTYREMAI>30.00000</QTYREMAI>
    <QTYREMBO>0.00000</QTYREMBO>
    <QTYTBAOR>0.00000</QTYTBAOR>
    <QTYTOINV>30.00000</QTYTOINV>
    <QTYTORDR>0.00000</QTYTORDR>
    <QTYFULFI>30.00000</QTYFULFI>
    <QTYSLCTD>30.00000</QTYSLCTD>
    <QTYBSUOM>1.00000</QTYBSUOM>
    <EXTQTYAL>0.00000</EXTQTYAL>
    <EXTQTYSEL>0.00000</EXTQTYSEL>
    <ReqShipDate>2013-05-01T00:00:00</ReqShipDate>
    <FUFILDAT>2013-05-01T00:00:00</FUFILDAT>
    <ACTLSHIP>2013-05-01T00:00:00</ACTLSHIP>
    <SHIPMTHD/>
    <SALSTERR>ALL</SALSTERR>
    <SLPRSNID>JMCGUINNESS</SLPRSNID>
    <PRCLEVEL>1</PRCLEVEL>
    <COMMNTID>CUSTNUMBER</COMMNTID>
    <BRKFLD1>0</BRKFLD1>
    <BRKFLD2>0</BRKFLD2>
    <BRKFLD3>0</BRKFLD3>
    <CURRNIDX>1007</CURRNIDX>
    <TRXSORCE>SLSTE00005184</TRXSORCE>
    <ORGSEQNM>0</ORGSEQNM>
    <ITEMCODE/>
    <PURCHSTAT>1</PURCHSTAT>
    <DECPLQTY>1</DECPLQTY>
    <DECPLCUR>3</DECPLCUR>
    <ODECPLCU>3</ODECPLCU>
    <EXCEPTIONALDEMAND>0</EXCEPTIONALDEMAND>
    <TAXSCHID/>
    <TXSCHSRC>0</TXSCHSRC>
    <PRSTADCD>BAYSHORE</PRSTADCD>
    <ShipToName>USA INDUSTRIES</ShipToName>
    <CNTCPRSN/>
    <ADDRESS1>12 Wisconsin Court</ADDRESS1>
    <ADDRESS2/>
    <ADDRESS3/>
    <CITY>Bayshore</CITY>
    <STATE>NY</STATE>
    <ZIPCODE>11706</ZIPCODE>
    <COUNTRY>UNITED STATES</COUNTRY>
    <PHONE1/>
    <PHONE2/>
    <PHONE3/>
    <FAXNUMBR/>
    <Flags>0</Flags>
    <CONTNBR/>
    <CONTLNSEQNBR>0.00000</CONTLNSEQNBR>
    <CONTSTARTDTE>1900-01-01T00:00:00</CONTSTARTDTE>
    <CONTENDDTE>1900-01-01T00:00:00</CONTENDDTE>
    <CONTITEMNBR/>
    <CONTSERIALNBR/>
    <Line_Tax/>
</Line>
<Line>
    <SOPNUMBE>60747</SOPNUMBE>
    <SOPTYPE>3</SOPTYPE>
    <CMPNTSEQ>0</CMPNTSEQ>
    <LNITMSEQ>49152</LNITMSEQ>
    <ITEMNMBR>18-5046</ITEMNMBR>
    <ITEMDESC>160181501, 1 PIST CAST IRON REAR</ITEMDESC>
    <NONINVEN>0</NONINVEN>
    <DROPSHIP>0</DROPSHIP>
    <UOFM>Each</UOFM>
    <LOCNCODE>01</LOCNCODE>
    <UNITCOST>18.00000</UNITCOST>
    <ORUNTCST>18.00000</ORUNTCST>
    <UNITPRCE>35.00000</UNITPRCE>
    <ORUNTPRC>35.00000</ORUNTPRC>
    <XTNDPRCE>280.00000</XTNDPRCE>
    <OXTNDPRC>280.00000</OXTNDPRC>
    <REMPRICE>280.00000</REMPRICE>
    <OREPRICE>280.00000</OREPRICE>
    <EXTDCOST>144.00000</EXTDCOST>
    <OREXTCST>144.00000</OREXTCST>
    <MRKDNAMT>0.00000</MRKDNAMT>
    <ORMRKDAM>0.00000</ORMRKDAM>
    <MRKDNPCT>0</MRKDNPCT>
    <MRKDNTYP>0</MRKDNTYP>
    <INVINDX>1394</INVINDX>
    <CSLSINDX>1394</CSLSINDX>
    <SLSINDX>125</SLSINDX>
    <MKDNINDX>125</MKDNINDX>
    <RTNSINDX>1394</RTNSINDX>
    <INUSINDX>0</INUSINDX>
    <INSRINDX>0</INSRINDX>
    <DMGDINDX>0</DMGDINDX>
    <ITMTSHID/>
    <IVITMTXB>2</IVITMTXB>
    <BKTSLSAM>0.00000</BKTSLSAM>
    <ORBKTSLS>0.00000</ORBKTSLS>
    <TAXAMNT>0.00000</TAXAMNT>
    <ORTAXAMT>0.00000</ORTAXAMT>
    <TXBTXAMT>0.00000</TXBTXAMT>
    <OTAXTAMT>0.00000</OTAXTAMT>
    <BSIVCTTL>0</BSIVCTTL>
    <TRDISAMT>0.00000</TRDISAMT>
    <ORTDISAM>0.00000</ORTDISAM>
    <DISCSALE>0.00000</DISCSALE>
    <ORDAVSLS>0.00000</ORDAVSLS>
    <QUANTITY>8.00000</QUANTITY>
    <ATYALLOC>8.00000</ATYALLOC>
    <QTYINSVC>0.00000</QTYINSVC>
    <QTYINUSE>0.00000</QTYINUSE>
    <QTYDMGED>0.00000</QTYDMGED>
    <QTYRTRND>0.00000</QTYRTRND>
    <QTYONHND>0.00000</QTYONHND>
    <QTYCANCE>0.00000</QTYCANCE>
    <QTYCANOT>0.00000</QTYCANOT>
    <QTYORDER>8.00000</QTYORDER>
    <QTYPRBAC>0.00000</QTYPRBAC>
    <QTYPRBOO>0.00000</QTYPRBOO>
    <QTYPRINV>0.00000</QTYPRINV>
    <QTYPRORD>0.00000</QTYPRORD>
    <QTYPRVRECVD>0.00000</QTYPRVRECVD>
    <QTYRECVD>0.00000</QTYRECVD>
    <QTYREMAI>8.00000</QTYREMAI>
    <QTYREMBO>0.00000</QTYREMBO>
    <QTYTBAOR>0.00000</QTYTBAOR>
    <QTYTOINV>8.00000</QTYTOINV>
    <QTYTORDR>0.00000</QTYTORDR>
    <QTYFULFI>8.00000</QTYFULFI>
    <QTYSLCTD>8.00000</QTYSLCTD>
    <QTYBSUOM>1.00000</QTYBSUOM>
    <EXTQTYAL>0.00000</EXTQTYAL>
    <EXTQTYSEL>0.00000</EXTQTYSEL>
    <ReqShipDate>2013-05-01T00:00:00</ReqShipDate>
    <FUFILDAT>2013-05-01T00:00:00</FUFILDAT>
    <ACTLSHIP>2013-05-01T00:00:00</ACTLSHIP>
    <SHIPMTHD/>
    <SALSTERR>ALL</SALSTERR>
    <SLPRSNID>JMCGUINNESS</SLPRSNID>
    <PRCLEVEL>1</PRCLEVEL>
    <COMMNTID>CUSTNUMBER</COMMNTID>
    <BRKFLD1>0</BRKFLD1>
    <BRKFLD2>0</BRKFLD2>
    <BRKFLD3>0</BRKFLD3>
    <CURRNIDX>1007</CURRNIDX>
    <TRXSORCE>SLSTE00005184</TRXSORCE>
    <ORGSEQNM>0</ORGSEQNM>
    <ITEMCODE/>
    <PURCHSTAT>1</PURCHSTAT>
    <DECPLQTY>1</DECPLQTY>
    <DECPLCUR>3</DECPLCUR>
    <ODECPLCU>3</ODECPLCU>
    <EXCEPTIONALDEMAND>0</EXCEPTIONALDEMAND>
    <TAXSCHID/>
    <TXSCHSRC>0</TXSCHSRC>
    <PRSTADCD>BAYSHORE</PRSTADCD>
    <ShipToName>USA INDUSTRIES</ShipToName>
    <CNTCPRSN/>
    <ADDRESS1>12 Wisconsin Court</ADDRESS1>
    <ADDRESS2/>
    <ADDRESS3/>
    <CITY>Bayshore</CITY>
    <STATE>NY</STATE>
    <ZIPCODE>11706</ZIPCODE>
    <COUNTRY>UNITED STATES</COUNTRY>
    <PHONE1/>
    <PHONE2/>
    <PHONE3/>
    <FAXNUMBR/>
    <Flags>0</Flags>
    <CONTNBR/>
    <CONTLNSEQNBR>0.00000</CONTLNSEQNBR>
    <CONTSTARTDTE>1900-01-01T00:00:00</CONTSTARTDTE>
    <CONTENDDTE>1900-01-01T00:00:00</CONTENDDTE>
    <CONTITEMNBR/>
    <CONTSERIALNBR/>
    <Line_Tax/>
</Line>
<Line>
    <SOPNUMBE>60747</SOPNUMBE>
    <SOPTYPE>3</SOPTYPE>
    <CMPNTSEQ>0</CMPNTSEQ>
    <LNITMSEQ>65536</LNITMSEQ>
    <ITEMNMBR>18-5047</ITEMNMBR>
    <ITEMDESC>160181501, 1 PIST CAST IRON REAR</ITEMDESC>
    <NONINVEN>0</NONINVEN>
    <DROPSHIP>0</DROPSHIP>
    <UOFM>Each</UOFM>
    <LOCNCODE>01</LOCNCODE>
    <UNITCOST>17.00000</UNITCOST>
    <ORUNTCST>17.00000</ORUNTCST>
    <UNITPRCE>35.00000</UNITPRCE>
    <ORUNTPRC>35.00000</ORUNTPRC>
    <XTNDPRCE>280.00000</XTNDPRCE>
    <OXTNDPRC>280.00000</OXTNDPRC>
    <REMPRICE>280.00000</REMPRICE>
    <OREPRICE>280.00000</OREPRICE>
    <EXTDCOST>136.00000</EXTDCOST>
    <OREXTCST>136.00000</OREXTCST>
    <MRKDNAMT>0.00000</MRKDNAMT>
    <ORMRKDAM>0.00000</ORMRKDAM>
    <MRKDNPCT>0</MRKDNPCT>
    <MRKDNTYP>0</MRKDNTYP>
    <INVINDX>1394</INVINDX>
    <CSLSINDX>1394</CSLSINDX>
    <SLSINDX>125</SLSINDX>
    <MKDNINDX>125</MKDNINDX>
    <RTNSINDX>1394</RTNSINDX>
    <INUSINDX>0</INUSINDX>
    <INSRINDX>0</INSRINDX>
    <DMGDINDX>0</DMGDINDX>
    <ITMTSHID/>
    <IVITMTXB>2</IVITMTXB>
    <BKTSLSAM>0.00000</BKTSLSAM>
    <ORBKTSLS>0.00000</ORBKTSLS>
    <TAXAMNT>0.00000</TAXAMNT>
    <ORTAXAMT>0.00000</ORTAXAMT>
    <TXBTXAMT>0.00000</TXBTXAMT>
    <OTAXTAMT>0.00000</OTAXTAMT>
    <BSIVCTTL>0</BSIVCTTL>
    <TRDISAMT>0.00000</TRDISAMT>
    <ORTDISAM>0.00000</ORTDISAM>
    <DISCSALE>0.00000</DISCSALE>
    <ORDAVSLS>0.00000</ORDAVSLS>
    <QUANTITY>8.00000</QUANTITY>
    <ATYALLOC>8.00000</ATYALLOC>
    <QTYINSVC>0.00000</QTYINSVC>
    <QTYINUSE>0.00000</QTYINUSE>
    <QTYDMGED>0.00000</QTYDMGED>
    <QTYRTRND>0.00000</QTYRTRND>
    <QTYONHND>0.00000</QTYONHND>
    <QTYCANCE>0.00000</QTYCANCE>
    <QTYCANOT>0.00000</QTYCANOT>
    <QTYORDER>8.00000</QTYORDER>
    <QTYPRBAC>0.00000</QTYPRBAC>
    <QTYPRBOO>0.00000</QTYPRBOO>
    <QTYPRINV>0.00000</QTYPRINV>
    <QTYPRORD>0.00000</QTYPRORD>
    <QTYPRVRECVD>0.00000</QTYPRVRECVD>
    <QTYRECVD>0.00000</QTYRECVD>
    <QTYREMAI>8.00000</QTYREMAI>
    <QTYREMBO>0.00000</QTYREMBO>
    <QTYTBAOR>0.00000</QTYTBAOR>
    <QTYTOINV>8.00000</QTYTOINV>
    <QTYTORDR>0.00000</QTYTORDR>
    <QTYFULFI>8.00000</QTYFULFI>
    <QTYSLCTD>8.00000</QTYSLCTD>
    <QTYBSUOM>1.00000</QTYBSUOM>
    <EXTQTYAL>0.00000</EXTQTYAL>
    <EXTQTYSEL>0.00000</EXTQTYSEL>
    <ReqShipDate>2013-05-01T00:00:00</ReqShipDate>
    <FUFILDAT>2013-05-01T00:00:00</FUFILDAT>
    <ACTLSHIP>2013-05-01T00:00:00</ACTLSHIP>
    <SHIPMTHD/>
    <SALSTERR>ALL</SALSTERR>
    <SLPRSNID>JMCGUINNESS</SLPRSNID>
    <PRCLEVEL>1</PRCLEVEL>
    <COMMNTID>CUSTNUMBER</COMMNTID>
    <BRKFLD1>0</BRKFLD1>
    <BRKFLD2>0</BRKFLD2>
    <BRKFLD3>0</BRKFLD3>
    <CURRNIDX>1007</CURRNIDX>
    <TRXSORCE>SLSTE00005184</TRXSORCE>
    <ORGSEQNM>0</ORGSEQNM>
    <ITEMCODE/>
    <PURCHSTAT>1</PURCHSTAT>
    <DECPLQTY>1</DECPLQTY>
    <DECPLCUR>3</DECPLCUR>
    <ODECPLCU>3</ODECPLCU>
    <EXCEPTIONALDEMAND>0</EXCEPTIONALDEMAND>
    <TAXSCHID/>
    <TXSCHSRC>0</TXSCHSRC>
    <PRSTADCD>BAYSHORE</PRSTADCD>
    <ShipToName>USA INDUSTRIES</ShipToName>
    <CNTCPRSN/>
    <ADDRESS1>12 Wisconsin Court</ADDRESS1>
    <ADDRESS2/>
    <ADDRESS3/>
    <CITY>Bayshore</CITY>
    <STATE>NY</STATE>
    <ZIPCODE>11706</ZIPCODE>
    <COUNTRY>UNITED STATES</COUNTRY>
    <PHONE1/>
    <PHONE2/>
    <PHONE3/>
    <FAXNUMBR/>
    <Flags>0</Flags>
    <CONTNBR/>
    <CONTLNSEQNBR>0.00000</CONTLNSEQNBR>
    <CONTSTARTDTE>1900-01-01T00:00:00</CONTSTARTDTE>
    <CONTENDDTE>1900-01-01T00:00:00</CONTENDDTE>
    <CONTITEMNBR/>
    <CONTSERIALNBR/>
    <Line_Tax/>
</Line>
</SO_Hist_Trans>
</eConnect>
</Sales_History_Transaction:root>

如何获取指定元素的值?

按名称获取XML元素

使用Linq To Xml

var xDoc = XDocument.Parse(xml);
var lines = xDoc.Descendants("Line")
            .Select(l=>l.Elements().ToDictionary(e => e.Name.LocalName, 
                                                 e => e.Value))
            .ToList();

编辑

var val = xDoc.Descendants("SOPNUMBE").First().Value;