Array
(
)

Editar xml em c sharp

João Flávio
   - 18 abr 2013

Olá Pessoal !
Tenho um arquivo xml e nesse arquivo tenho um trecho como o que segue abaixo:
<det nItem="1">
<prod>
<cProd>SP520</cProd>
<cEAN>7894798280002</cEAN>
<xProd>DESCRICAO DO PRODUTO</xProd>
<NCM>55081000</NCM>
</prod>
</det>
<det nItem="2">
<prod>
<cProd>SP221</cProd>
<cEAN>7894798951896</cEAN>
<xProd>DESCRICAO DE OUTRO PRODUTO</xProd>
<NCM>55081000</NCM>
Preciso percorrer esse XML em todas as TAGS '<det nItem' o valor que estiver na tag <cEAN> colocar dentro da tag <cProd>. Preciso fazer isso em C#, alguem poderia me ajudar ???
Vlw

Joel Rodrigues
   - 18 abr 2013

Mostre a estrutura do XML todo para eu já te passar o exemeplo completo.

0
|
0

Leonardo Carvalho
   - 18 abr 2013

NFe né João?

0
|
0

João Flávio
   - 18 abr 2013


Citação:
NFe né João?


Sim é um XML de NFE

0
|
0

João Flávio
   - 18 abr 2013


Citação:
Mostre a estrutura do XML todo para eu já te passar o exemeplo completo.


This XML file does not appear to have any style information associated with it. The document tree is shown below.
<nfeProc xmlns="http://www.portalfiscal.inf.br/nfe" versao="2.00">
<NFe xmlns="http://www.portalfiscal.inf.br/nfe">
<infNFe Id="NFe31130400139737000270550080000390991232629005" versao="2.00">
<ide>
<cUF>31</cUF>
<cNF>23262900</cNF>
<natOp>VENDA DE PRODUCAO DO ESTABELECIMENTO</natOp>
<indPag>1</indPag>
<mod>55</mod>
<serie>8</serie>
<nNF>39099</nNF>
<dEmi>2013-04-03</dEmi>
<tpNF>1</tpNF>
<cMunFG>3147204</cMunFG>
<tpImp>2</tpImp>
<tpEmis>1</tpEmis>
<cDV>5</cDV>
<tpAmb>1</tpAmb>
<finNFe>1</finNFe>
<procEmi>0</procEmi>
<verProc>5.0</verProc>
</ide>
<emit>
<CNPJ>00139737000270</CNPJ>
<xNome>LINHANYL PARAGUACU S/A - PARAGUACU</xNome>
<xFant>PARAGUAC PAR</xFant>
<enderEmit>
<xLgr>AV. ORLANDO ALVES PEREIRA</xLgr>
<nro>194</nro>
<xBairro>DISTRITO INDL.</xBairro>
<cMun>3147204</cMun>
<xMun>PARAGUACU</xMun>
<UF>MG</UF>
<CEP>37120000</CEP>
<cPais>1058</cPais>
<xPais>BRASIL</xPais>
<fone>03532674800</fone>
</enderEmit>
<IE>4729088590016</IE>
<CRT>3</CRT>
</emit>
<dest>
<CNPJ>10586513000180</CNPJ>
<xNome>LUCIANO VALERIO DE CASTILHO ME</xNome>
<enderDest>
<xLgr>R LUIZ SEPINI</xLgr>
<nro>100</nro>
<xBairro>VILA CARDOSO</xBairro>
<cMun>3147204</cMun>
<xMun>PARAGUACU</xMun>
<UF>MG</UF>
<CEP>37120000</CEP>
<cPais>1058</cPais>
<xPais>BRASIL</xPais>
<fone>3599519463</fone>
</enderDest>
<IE>0011062340078</IE>
<email>lucianolinhas@gmail.com</email>
</dest>
<det nItem="1">
<prod>
<cProd>SP520</cProd>
<cEAN>7894798280002</cEAN>
<xProd>LINHA100%POLIESTER120 4570mTEX 30 Cor:PTA</xProd>
<NCM>55081000</NCM>
<EXTIPI>00</EXTIPI>
<CFOP>5101</CFOP>
<uCom>Un</uCom>
<qCom>350.00</qCom>
<vUnCom>3.54012</vUnCom>
<vProd>1239.04</vProd>
<cEANTrib>7894798280002</cEANTrib>
<uTrib>Un</uTrib>
<qTrib>350.00</qTrib>
<vUnTrib>3.54012</vUnTrib>
<indTot>1</indTot>
</prod>
<imposto>
<ICMS>
<ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>3</modBC>
<vBC>1239.04</vBC>
<pICMS>12.00</pICMS>
<vICMS>148.78</vICMS>
</ICMS00>
</ICMS>
<IPI>
<cEnq>999</cEnq>
<IPINT>
<CST>51</CST>
</IPINT>
</IPI>
<PIS>
<PISAliq>
<CST>01</CST>
<vBC>1239.04</vBC>
<pPIS>1.65</pPIS>
<vPIS>20.44</vPIS>
</PISAliq>
</PIS>
<COFINS>
<COFINSAliq>
<CST>01</CST>
<vBC>1239.04</vBC>
<pCOFINS>7.60</pCOFINS>
<vCOFINS>94.17</vCOFINS>
</COFINSAliq>
</COFINS>
</imposto>
</det>
<det nItem="2">
<prod>
<cProd>SP221</cProd>
<cEAN>7894798951896</cEAN>
<xProd>LINHA100%POLIESTER120 1828mTEX 30 Cor:PTA</xProd>
<NCM>55081000</NCM>
<EXTIPI>00</EXTIPI>
<CFOP>5101</CFOP>
<uCom>Un</uCom>
<qCom>270.00</qCom>
<vUnCom>1.55332</vUnCom>
<vProd>419.40</vProd>
<cEANTrib>7894798951896</cEANTrib>
<uTrib>Un</uTrib>
<qTrib>270.00</qTrib>
<vUnTrib>1.55332</vUnTrib>
<indTot>1</indTot>
</prod>
<imposto>
<ICMS>
<ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>3</modBC>
<vBC>419.40</vBC>
<pICMS>12.00</pICMS>
<vICMS>50.32</vICMS>
</ICMS00>
</ICMS>
<IPI>
<cEnq>999</cEnq>
<IPINT>
<CST>51</CST>
</IPINT>
</IPI>
<PIS>
<PISAliq>
<CST>01</CST>
<vBC>419.40</vBC>
<pPIS>1.65</pPIS>
<vPIS>6.92</vPIS>
</PISAliq>
</PIS>
<COFINS>
<COFINSAliq>
<CST>01</CST>
<vBC>419.40</vBC>
<pCOFINS>7.60</pCOFINS>
<vCOFINS>31.87</vCOFINS>
</COFINSAliq>
</COFINS>
</imposto>
</det>
<det nItem="3">
<prod>
<cProd>SP221</cProd>
<cEAN>7894798980094</cEAN>
<xProd>LINHA100%POLIESTER120 1828mTEX 30 Cor:201</xProd>
<NCM>55081000</NCM>
<EXTIPI>00</EXTIPI>
<CFOP>5101</CFOP>
<uCom>Un</uCom>
<qCom>100.00</qCom>
<vUnCom>1.55332</vUnCom>
<vProd>155.33</vProd>
<cEANTrib>7894798980094</cEANTrib>
<uTrib>Un</uTrib>
<qTrib>100.00</qTrib>
<vUnTrib>1.55332</vUnTrib>
<indTot>1</indTot>
</prod>
<imposto>
<ICMS>
<ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>3</modBC>
<vBC>155.33</vBC>
<pICMS>12.00</pICMS>
<vICMS>18.63</vICMS>
</ICMS00>
</ICMS>
<IPI>
<cEnq>999</cEnq>
<IPINT>
<CST>51</CST>
</IPINT>
</IPI>
<PIS>
<PISAliq>
<CST>01</CST>
<vBC>155.33</vBC>
<pPIS>1.65</pPIS>
<vPIS>2.56</vPIS>
</PISAliq>
</PIS>
<COFINS>
<COFINSAliq>
<CST>01</CST>
<vBC>155.33</vBC>
<pCOFINS>7.60</pCOFINS>
<vCOFINS>11.81</vCOFINS>
</COFINSAliq>
</COFINS>
</imposto>
</det>
<det nItem="4">
<prod>
<cProd>SP221</cProd>
<cEAN>7894798011064</cEAN>
<xProd>LINHA100%POLIESTER120 1828mTEX 30 Cor:48</xProd>
<NCM>55081000</NCM>
<EXTIPI>00</EXTIPI>
<CFOP>5101</CFOP>
<uCom>Un</uCom>
<qCom>30.00</qCom>
<vUnCom>1.55332</vUnCom>
<vProd>46.60</vProd>
<cEANTrib>7894798011064</cEANTrib>
<uTrib>Un</uTrib>
<qTrib>30.00</qTrib>
<vUnTrib>1.55332</vUnTrib>
<indTot>1</indTot>
</prod>
<imposto>
<ICMS>
<ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>3</modBC>
<vBC>46.60</vBC>
<pICMS>12.00</pICMS>
<vICMS>5.59</vICMS>
</ICMS00>
</ICMS>
<IPI>
<cEnq>999</cEnq>
<IPINT>
<CST>51</CST>
</IPINT>
</IPI>
<PIS>
<PISAliq>
<CST>01</CST>
<vBC>46.60</vBC>
<pPIS>1.65</pPIS>
<vPIS>0.77</vPIS>
</PISAliq>
</PIS>
<COFINS>
<COFINSAliq>
<CST>01</CST>
<vBC>46.60</vBC>
<pCOFINS>7.60</pCOFINS>
<vCOFINS>3.54</vCOFINS>
</COFINSAliq>
</COFINS>
</imposto>
</det>
<det nItem="5">
<prod>
<cProd>SP520</cProd>
<cEAN>7894798281375</cEAN>
<xProd>LINHA100%POLIESTER120 4570mTEX 30 Cor:1549</xProd>
<NCM>55081000</NCM>
<EXTIPI>00</EXTIPI>
<CFOP>5101</CFOP>
<uCom>Un</uCom>
<qCom>15.00</qCom>
<vUnCom>3.54012</vUnCom>
<vProd>53.10</vProd>
<cEANTrib>7894798281375</cEANTrib>
<uTrib>Un</uTrib>
<qTrib>15.00</qTrib>
<vUnTrib>3.54012</vUnTrib>
<indTot>1</indTot>
</prod>
<imposto>
<ICMS>
<ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>3</modBC>
<vBC>53.10</vBC>
<pICMS>12.00</pICMS>
<vICMS>6.37</vICMS>
</ICMS00>
</ICMS>
<IPI>
<cEnq>999</cEnq>
<IPINT>
<CST>51</CST>
</IPINT>
</IPI>
<PIS>
<PISAliq>
<CST>01</CST>
<vBC>53.10</vBC>
<pPIS>1.65</pPIS>
<vPIS>0.88</vPIS>
</PISAliq>
</PIS>
<COFINS>
<COFINSAliq>
<CST>01</CST>
<vBC>53.10</vBC>
<pCOFINS>7.60</pCOFINS>
<vCOFINS>4.04</vCOFINS>
</COFINSAliq>
</COFINS>
</imposto>
</det>
<det nItem="6">
<prod>
<cProd>SP520</cProd>
<cEAN>7894798282846</cEAN>
<xProd>LINHA100%POLIESTER120 4570mTEX 30 Cor:836</xProd>
<NCM>55081000</NCM>
<EXTIPI>00</EXTIPI>
<CFOP>5101</CFOP>
<uCom>Un</uCom>
<qCom>35.00</qCom>
<vUnCom>3.54012</vUnCom>
<vProd>123.90</vProd>
<cEANTrib>7894798282846</cEANTrib>
<uTrib>Un</uTrib>
<qTrib>35.00</qTrib>
<vUnTrib>3.54012</vUnTrib>
<indTot>1</indTot>
</prod>
<imposto>
<ICMS>
<ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>3</modBC>
<vBC>123.90</vBC>
<pICMS>12.00</pICMS>
<vICMS>14.86</vICMS>
</ICMS00>
</ICMS>
<IPI>
<cEnq>999</cEnq>
<IPINT>
<CST>51</CST>
</IPINT>
</IPI>
<PIS>
<PISAliq>
<CST>01</CST>
<vBC>123.90</vBC>
<pPIS>1.65</pPIS>
<vPIS>2.04</vPIS>
</PISAliq>
</PIS>
<COFINS>
<COFINSAliq>
<CST>01</CST>
<vBC>123.90</vBC>
<pCOFINS>7.60</pCOFINS>
<vCOFINS>9.42</vCOFINS>
</COFINSAliq>
</COFINS>
</imposto>
</det>
<det nItem="7">
<prod>
<cProd>SP520</cProd>
<cEAN>7894798280699</cEAN>
<xProd>LINHA100%POLIESTER120 4570mTEX 30 Cor:4035</xProd>
<NCM>55081000</NCM>
<EXTIPI>00</EXTIPI>
<CFOP>5101</CFOP>
<uCom>Un</uCom>
<qCom>15.00</qCom>
<vUnCom>3.54012</vUnCom>
<vProd>53.10</vProd>
<cEANTrib>7894798280699</cEANTrib>
<uTrib>Un</uTrib>
<qTrib>15.00</qTrib>
<vUnTrib>3.54012</vUnTrib>
<indTot>1</indTot>
</prod>
<imposto>
<ICMS>
<ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>3</modBC>
<vBC>53.10</vBC>
<pICMS>12.00</pICMS>
<vICMS>6.37</vICMS>
</ICMS00>
</ICMS>
<IPI>
<cEnq>999</cEnq>
<IPINT>
<CST>51</CST>
</IPINT>
</IPI>
<PIS>
<PISAliq>
<CST>01</CST>
<vBC>53.10</vBC>
<pPIS>1.65</pPIS>
<vPIS>0.88</vPIS>
</PISAliq>
</PIS>
<COFINS>
<COFINSAliq>
<CST>01</CST>
<vBC>53.10</vBC>
<pCOFINS>7.60</pCOFINS>
<vCOFINS>4.04</vCOFINS>
</COFINSAliq>
</COFINS>
</imposto>
</det>
<det nItem="8">
<prod>
<cProd>SP520</cProd>
<cEAN>7894798280699</cEAN>
<xProd>LINHA100%POLIESTER120 4570mTEX 30 Cor:4035</xProd>
<NCM>55081000</NCM>
<EXTIPI>00</EXTIPI>
<CFOP>5101</CFOP>
<uCom>Un</uCom>
<qCom>35.00</qCom>
<vUnCom>3.54012</vUnCom>
<vProd>123.90</vProd>
<cEANTrib>7894798280699</cEANTrib>
<uTrib>Un</uTrib>
<qTrib>35.00</qTrib>
<vUnTrib>3.54012</vUnTrib>
<indTot>1</indTot>
</prod>
<imposto>
<ICMS>
<ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>3</modBC>
<vBC>123.90</vBC>
<pICMS>12.00</pICMS>
<vICMS>14.86</vICMS>
</ICMS00>
</ICMS>
<IPI>
<cEnq>999</cEnq>
<IPINT>
<CST>51</CST>
</IPINT>
</IPI>
<PIS>
<PISAliq>
<CST>01</CST>
<vBC>123.90</vBC>
<pPIS>1.65</pPIS>
<vPIS>2.04</vPIS>
</PISAliq>
</PIS>
<COFINS>
<COFINSAliq>
<CST>01</CST>
<vBC>123.90</vBC>
<pCOFINS>7.60</pCOFINS>
<vCOFINS>9.42</vCOFINS>
</COFINSAliq>
</COFINS>
</imposto>
</det>
<det nItem="9">
<prod>
<cProd>SP520</cProd>
<cEAN>7894798281375</cEAN>
<xProd>LINHA100%POLIESTER120 4570mTEX 30 Cor:1549</xProd>
<NCM>55081000</NCM>
<EXTIPI>00</EXTIPI>
<CFOP>5101</CFOP>
<uCom>Un</uCom>
<qCom>70.00</qCom>
<vUnCom>3.54012</vUnCom>
<vProd>247.81</vProd>
<cEANTrib>7894798281375</cEANTrib>
<uTrib>Un</uTrib>
<qTrib>70.00</qTrib>
<vUnTrib>3.54012</vUnTrib>
<indTot>1</indTot>
</prod>
<imposto>
<ICMS>
<ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>3</modBC>
<vBC>247.81</vBC>
<pICMS>12.00</pICMS>
<vICMS>29.73</vICMS>
</ICMS00>
</ICMS>
<IPI>
<cEnq>999</cEnq>
<IPINT>
<CST>51</CST>
</IPINT>
</IPI>
<PIS>
<PISAliq>
<CST>01</CST>
<vBC>247.81</vBC>
<pPIS>1.65</pPIS>
<vPIS>4.09</vPIS>
</PISAliq>
</PIS>
<COFINS>
<COFINSAliq>
<CST>01</CST>
<vBC>247.81</vBC>
<pCOFINS>7.60</pCOFINS>
<vCOFINS>18.83</vCOFINS>
</COFINSAliq>
</COFINS>
</imposto>
</det>
<det nItem="10">
<prod>
<cProd>TP100</cProd>
<cEAN>7894798025757</cEAN>
<xProd>FIO 100%POLIESTER150 100gTEX 18 Cor:1001</xProd>
<NCM>54023300</NCM>
<EXTIPI>00</EXTIPI>
<CFOP>5101</CFOP>
<uCom>Un</uCom>
<qCom>30.00</qCom>
<vUnCom>1.85676</vUnCom>
<vProd>55.70</vProd>
<cEANTrib>7894798025757</cEANTrib>
<uTrib>Un</uTrib>
<qTrib>30.00</qTrib>
<vUnTrib>1.85676</vUnTrib>
<indTot>1</indTot>
</prod>
<imposto>
<ICMS>
<ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>3</modBC>
<vBC>55.70</vBC>
<pICMS>12.00</pICMS>
<vICMS>6.68</vICMS>
</ICMS00>
</ICMS>
<IPI>
<cEnq>999</cEnq>
<IPINT>
<CST>51</CST>
</IPINT>
</IPI>
<PIS>
<PISAliq>
<CST>01</CST>
<vBC>55.70</vBC>
<pPIS>1.65</pPIS>
<vPIS>0.92</vPIS>
</PISAliq>
</PIS>
<COFINS>
<COFINSAliq>
<CST>01</CST>
<vBC>55.70</vBC>
<pCOFINS>7.60</pCOFINS>
<vCOFINS>4.23</vCOFINS>
</COFINSAliq>
</COFINS>
</imposto>
</det>
<det nItem="11">
<prod>
<cProd>TP100</cProd>
<cEAN>7894798025900</cEAN>
<xProd>FIO 100%POLIESTER150 100gTEX 18 Cor:9900</xProd>
<NCM>54023300</NCM>
<EXTIPI>00</EXTIPI>
<CFOP>5101</CFOP>
<uCom>Un</uCom>
<qCom>20.00</qCom>
<vUnCom>1.85676</vUnCom>
<vProd>37.14</vProd>
<cEANTrib>7894798025900</cEANTrib>
<uTrib>Un</uTrib>
<qTrib>20.00</qTrib>
<vUnTrib>1.85676</vUnTrib>
<indTot>1</indTot>
</prod>
<imposto>
<ICMS>
<ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>3</modBC>
<vBC>37.14</vBC>
<pICMS>12.00</pICMS>
<vICMS>4.45</vICMS>
</ICMS00>
</ICMS>
<IPI>
<cEnq>999</cEnq>
<IPINT>
<CST>51</CST>
</IPINT>
</IPI>
<PIS>
<PISAliq>
<CST>01</CST>
<vBC>37.14</vBC>
<pPIS>1.65</pPIS>
<vPIS>0.61</vPIS>
</PISAliq>
</PIS>
<COFINS>
<COFINSAliq>
<CST>01</CST>
<vBC>37.14</vBC>
<pCOFINS>7.60</pCOFINS>
<vCOFINS>2.82</vCOFINS>
</COFINSAliq>
</COFINS>
</imposto>
</det>
<det nItem="12">
<prod>
<cProd>SP520</cProd>
<cEAN>7894798282808</cEAN>
<xProd>LINHA100%POLIESTER120 4570mTEX 30 Cor:812</xProd>
<NCM>55081000</NCM>
<EXTIPI>00</EXTIPI>
<CFOP>5101</CFOP>
<uCom>Un</uCom>
<qCom>5.00</qCom>
<vUnCom>3.25945</vUnCom>
<vProd>16.30</vProd>
<cEANTrib>7894798282808</cEANTrib>
<uTrib>Un</uTrib>
<qTrib>5.00</qTrib>
<vUnTrib>3.25945</vUnTrib>
<indTot>1</indTot>
</prod>
<imposto>
<ICMS>
<ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>3</modBC>
<vBC>16.30</vBC>
<pICMS>12.00</pICMS>
<vICMS>1.95</vICMS>
</ICMS00>
</ICMS>
<IPI>
<cEnq>999</cEnq>
<IPINT>
<CST>51</CST>
</IPINT>
</IPI>
<PIS>
<PISAliq>
<CST>01</CST>
<vBC>16.30</vBC>
<pPIS>1.65</pPIS>
<vPIS>0.27</vPIS>
</PISAliq>
</PIS>
<COFINS>
<COFINSAliq>
<CST>01</CST>
<vBC>16.30</vBC>
<pCOFINS>7.60</pCOFINS>
<vCOFINS>1.24</vCOFINS>
</COFINSAliq>
</COFINS>
</imposto>
</det>
<det nItem="13">
<prod>
<cProd>TP100</cProd>
<cEAN>7894798025948</cEAN>
<xProd>FIO 100%POLIESTER150 100gTEX 18 Cor:252</xProd>
<NCM>54023300</NCM>
<EXTIPI>00</EXTIPI>
<CFOP>5101</CFOP>
<uCom>Un</uCom>
<qCom>10.00</qCom>
<vUnCom>1.85676</vUnCom>
<vProd>18.57</vProd>
<cEANTrib>7894798025948</cEANTrib>
<uTrib>Un</uTrib>
<qTrib>10.00</qTrib>
<vUnTrib>1.85676</vUnTrib>
<indTot>1</indTot>
</prod>
<imposto>
<ICMS>
<ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>3</modBC>
<vBC>18.57</vBC>
<pICMS>12.00</pICMS>
<vICMS>2.22</vICMS>
</ICMS00>
</ICMS>
<IPI>
<cEnq>999</cEnq>
<IPINT>
<CST>51</CST>
</IPINT>
</IPI>
<PIS>
<PISAliq>
<CST>01</CST>
<vBC>18.57</vBC>
<pPIS>1.65</pPIS>
<vPIS>0.31</vPIS>
</PISAliq>
</PIS>
<COFINS>
<COFINSAliq>
<CST>01</CST>
<vBC>18.57</vBC>
<pCOFINS>7.60</pCOFINS>
<vCOFINS>1.41</vCOFINS>
</COFINSAliq>
</COFINS>
</imposto>
</det>
<det nItem="14">
<prod>
<cProd>TP100</cProd>
<cEAN>7894798025955</cEAN>
<xProd>FIO 100%POLIESTER150 100gTEX 18 Cor:220</xProd>
<NCM>54023300</NCM>
<EXTIPI>00</EXTIPI>
<CFOP>5101</CFOP>
<uCom>Un</uCom>
<qCom>10.00</qCom>
<vUnCom>1.85676</vUnCom>
<vProd>18.57</vProd>
<cEANTrib>7894798025955</cEANTrib>
<uTrib>Un</uTrib>
<qTrib>10.00</qTrib>
<vUnTrib>1.85676</vUnTrib>
<indTot>1</indTot>
</prod>
<imposto>
<ICMS>
<ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>3</modBC>
<vBC>18.57</vBC>
<pICMS>12.00</pICMS>
<vICMS>2.22</vICMS>
</ICMS00>
</ICMS>
<IPI>
<cEnq>999</cEnq>
<IPINT>
<CST>51</CST>
</IPINT>
</IPI>
<PIS>
<PISAliq>
<CST>01</CST>
<vBC>18.57</vBC>
<pPIS>1.65</pPIS>
<vPIS>0.31</vPIS>
</PISAliq>
</PIS>
<COFINS>
<COFINSAliq>
<CST>01</CST>
<vBC>18.57</vBC>
<pCOFINS>7.60</pCOFINS>
<vCOFINS>1.41</vCOFINS>
</COFINSAliq>
</COFINS>
</imposto>
</det>
<det nItem="15">
<prod>
<cProd>TP100</cProd>
<cEAN>7894798025757</cEAN>
<xProd>FIO 100%POLIESTER150 100gTEX 18 Cor:1001</xProd>
<NCM>54023300</NCM>
<EXTIPI>00</EXTIPI>
<CFOP>5101</CFOP>
<uCom>Un</uCom>
<qCom>10.00</qCom>
<vUnCom>1.85676</vUnCom>
<vProd>18.57</vProd>
<cEANTrib>7894798025757</cEANTrib>
<uTrib>Un</uTrib>
<qTrib>10.00</qTrib>
<vUnTrib>1.85676</vUnTrib>
<indTot>1</indTot>
</prod>
<imposto>
<ICMS>
<ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>3</modBC>
<vBC>18.57</vBC>
<pICMS>12.00</pICMS>
<vICMS>2.22</vICMS>
</ICMS00>
</ICMS>
<IPI>
<cEnq>999</cEnq>
<IPINT>
<CST>51</CST>
</IPINT>
</IPI>
<PIS>
<PISAliq>
<CST>01</CST>
<vBC>18.57</vBC>
<pPIS>1.65</pPIS>
<vPIS>0.31</vPIS>
</PISAliq>
</PIS>
<COFINS>
<COFINSAliq>
<CST>01</CST>
<vBC>18.57</vBC>
<pCOFINS>7.60</pCOFINS>
<vCOFINS>1.41</vCOFINS>
</COFINSAliq>
</COFINS>
</imposto>
</det>
<det nItem="16">
<prod>
<cProd>TP500</cProd>
<cEAN>7894798981398</cEAN>
<xProd>FIO 100%POLIESTER150 500gTEX 18 Cor:214</xProd>
<NCM>54023300</NCM>
<EXTIPI>00</EXTIPI>
<CFOP>5101</CFOP>
<uCom>UN</uCom>
<qCom>12.00</qCom>
<vUnCom>8.41683</vUnCom>
<vProd>101.00</vProd>
<cEANTrib>7894798981398</cEANTrib>
<uTrib>UN</uTrib>
<qTrib>12.00</qTrib>
<vUnTrib>8.41683</vUnTrib>
<indTot>1</indTot>
</prod>
<imposto>
<ICMS>
<ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>3</modBC>
<vBC>101.00</vBC>
<pICMS>12.00</pICMS>
<vICMS>12.11</vICMS>
</ICMS00>
</ICMS>
<IPI>
<cEnq>999</cEnq>
<IPINT>
<CST>51</CST>
</IPINT>
</IPI>
<PIS>
<PISAliq>
<CST>01</CST>
<vBC>101.00</vBC>
<pPIS>1.65</pPIS>
<vPIS>1.67</vPIS>
</PISAliq>
</PIS>
<COFINS>
<COFINSAliq>
<CST>01</CST>
<vBC>101.00</vBC>
<pCOFINS>7.60</pCOFINS>
<vCOFINS>7.68</vCOFINS>
</COFINSAliq>
</COFINS>
</imposto>
</det>
<det nItem="17">
<prod>
<cProd>TP351</cProd>
<cEAN>7894798330547</cEAN>
<xProd>FIO 100%POLIESTER150 250gTEX 18 Cor:9216</xProd>
<NCM>54023300</NCM>
<EXTIPI>00</EXTIPI>
<CFOP>5101</CFOP>
<uCom>Un</uCom>
<qCom>20.00</qCom>
<vUnCom>4.60216</vUnCom>
<vProd>92.04</vProd>
<cEANTrib>7894798330547</cEANTrib>
<uTrib>Un</uTrib>
<qTrib>20.00</qTrib>
<vUnTrib>4.60216</vUnTrib>
<indTot>1</indTot>
</prod>
<imposto>
<ICMS>
<ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>3</modBC>
<vBC>92.04</vBC>
<pICMS>12.00</pICMS>
<vICMS>11.04</vICMS>
</ICMS00>
</ICMS>
<IPI>
<cEnq>999</cEnq>
<IPINT>
<CST>51</CST>
</IPINT>
</IPI>
<PIS>
<PISAliq>
<CST>01</CST>
<vBC>92.04</vBC>
<pPIS>1.65</pPIS>
<vPIS>1.52</vPIS>
</PISAliq>
</PIS>
<COFINS>
<COFINSAliq>
<CST>01</CST>
<vBC>92.04</vBC>
<pCOFINS>7.60</pCOFINS>
<vCOFINS>7.00</vCOFINS>
</COFINSAliq>
</COFINS>
</imposto>
</det>
<total>
<ICMSTot>
<vBC>2820.07</vBC>
<vICMS>338.40</vICMS>
<vBCST>0.00</vBCST>
<vST>0.00</vST>
<vProd>2820.07</vProd>
<vFrete>0.00</vFrete>
<vSeg>0.00</vSeg>
<vDesc>0.00</vDesc>
<vII>0.00</vII>
<vIPI>0.00</vIPI>
<vPIS>46.54</vPIS>
<vCOFINS>214.34</vCOFINS>
<vOutro>0.00</vOutro>
<vNF>2820.07</vNF>
</ICMSTot>
<retTrib/>
</total>
<transp>
<modFrete>0</modFrete>
<transporta/>
<vol>
<qVol>4</qVol>
<esp>450X295X270</esp>
<marca>PARAGUACU</marca>
<pesoL>19.123</pesoL>
<pesoB>25.198</pesoB>
</vol>
<vol>
<qVol>1</qVol>
<esp>475X365X190</esp>
<marca>PARAGUACU</marca>
<pesoL>4.781</pesoL>
<pesoB>6.300</pesoB>
</vol>
<vol>
<qVol>1</qVol>
<esp>420X360X190</esp>
<marca>PARAGUACU</marca>
<pesoL>4.781</pesoL>
<pesoB>6.300</pesoB>
</vol>
<vol>
<qVol>17</qVol>
<esp>460X370X145</esp>
<marca>PARAGUACU</marca>
<pesoL>81.270</pesoL>
<pesoB>107.092</pesoB>
</vol>
</transp>
<cobr>
<dup>
<nDup>0039099/01</nDup>
<dVenc>2013-05-02</dVenc>
<vDup>2820.07</vDup>
</dup>
</cobr>
<infAdic>
<infCpl>
# #### BOLETO BANCARIO VIA CORREIO ou DDA, CASO NAO RECEBA LIGAR PARA 0800.707.2328 - APOS VENCIMENTO NAO SERA DISPENSADO JUROS/MULTA #####Aliquota do IPI Reduzida a ZERO Conforme Decreto 7660/2011 Reducao da Aliquota do ICMS Conf. Art. 42 Letra B-27 do Dec. 43.080 de 13/12/2002 / [EMAIL=lucianolinhas@gmail.com]
</infCpl>
</infAdic>
<compra>
<xPed>EF111401</xPed>
</compra>
</infNFe>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<Reference URI="#NFe31130400139737000270550080000390991232629005">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue>tMdbyQ3Omj64WoboVJeZKq7dwXQ=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>
kNd0dVzyuWc6O5E4ypT5aXcGThgHsvsR+PC+unBN7isPROG914MOmTI0GQfJFBfVTJqBCboYnap1dp+KkXShooZSC+FUdSift8DSNv8PV0gZpVOFLjLknUztE1IPi5gSQTV8QvcSz0Xw5qw7fMWWnDAQn2y7wXukVlEspIM0H0/Z2AC9BCYl5Ncmza86VGT1SZ15g51nj2jCLdEDj4/iJ4RPa3o+05T9c+TQM38XqyFMQDToTKsA/MBrwTiWhG08ByNoB2D/AhCpH8z3ZrZgo+nXopDhpR1goaff4Ev7TYCmTqv10jXfgu+qUfhYNHBj64PQvd+B+Jzxkr1V0EEFzA==
</SignatureValue>
<KeyInfo>
<X509Data>
<X509Certificate>
MIIIMDCCBhigAwIBAgIQBBlSrRPFoeJ96LaKi2zlIjANBgkqhkiG9w0BAQsFADB0MQswCQYDVQQGEwJCUjETMBEGA1UEChMKSUNQLUJyYXNpbDEtMCsGA1UECxMkQ2VydGlzaWduIENlcnRpZmljYWRvcmEgRGlnaXRhbCBTLkEuMSEwHwYDVQQDExhBQyBDZXJ0aXNpZ24gTXVsdGlwbGEgRzUwHhcNMTIwNzEyMDAwMDAwWhcNMTMwNzExMjM1OTU5WjCBvzELM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srXse3SRdGNnJpqWc6SgOkv/TZpm/YkC4J990eu3ikbug6a4HxDrppwHIbIRRk7fvmIbFxS2OLXjWZkr7jkrZoE5qyBYGfWg4s1x8WFsmxDVlrT0a3ALeQBD5tYzvMFoeTsjqBz46FsCJZuavAXEG7JK+ACgFh0/OcHMcYuuQ1/wQTxkXBYmiUqTpCUJbkmIsHmhSPL77DbUlNnYVlz48WuulS2jUNrd+EpjAQXm99meqxUJS+I++PnVnkawrNeR2SuICO4hNyaZsdiuke36bVLdrywrx0vHqbELEHGzTazv7AmfjdaO6Z/l6vDzdLbMvT1SS6ulfXaiD03lWz1MtpfPvSST1KTqx3nQDLeCc419frUYTG3PWUh2Ur6jCS0pJtQWo14JNxoB7DvMhpFwPO/68Mx
</X509Certificate>
</X509Data>
</KeyInfo>
</Signature>
</NFe>
<protNFe xmlns="http://www.portalfiscal.inf.br/nfe" versao="2.00">
<infProt>
<tpAmb>1</tpAmb>
<verAplic>13_0_71</verAplic>
<chNFe>31130400139737000270550080000390991232629005</chNFe>
<dhRecbto>2013-04-03T14:08:55</dhRecbto>
<nProt>131131054180510</nProt>
<digVal>tMdbyQ3Omj64WoboVJeZKq7dwXQ=</digVal>
<cStat>100</cStat>
<xMotivo>Autorizado o uso da NF-e</xMotivo>
</infProt>
</protNFe>
</nfeProc>

0
|
0

Leonardo Carvalho
   - 18 abr 2013

http://cbsa.com.br/post/ler-arquivo-xml-usando-xmltextreader-e-xmldocument-em-c---aspnet.aspx

http://www.codigofonte.net/dicas/csharp/151_lendo-um-arquigo-xml

0
|
0

Joel Rodrigues
   - 18 abr 2013

Após analisar o arquivo aqui e fazer uns testes, cheguei ao seguinte código:
#Código

XElement xml = XElement.Load("D://NFE.xml");
            foreach (XElement det in xml.Element("{http://www.portalfiscal.inf.br/nfe}NFe").Element("{http://www.portalfiscal.inf.br/nfe}infNFe").Elements("{http://www.portalfiscal.inf.br/nfe}det"))
            {
                det.Element("{http://www.portalfiscal.inf.br/nfe}prod").Element("{http://www.portalfiscal.inf.br/nfe}cProd").Value = 
                    det.Element("{http://www.portalfiscal.inf.br/nfe}prod").Element("{http://www.portalfiscal.inf.br/nfe}cEAN").Value;

                xml.Save("D://NFe_2.xml");
            }

Isso substitui o valor do cProd pelo cEAN. É isso mesmo?

0
|
0

João Flávio
   - 18 abr 2013


Citação:
Após analisar o arquivo aqui e fazer uns testes, cheguei ao seguinte código:
#Código

XElement xml = XElement.Load("D://NFE.xml");
            foreach (XElement det in xml.Element("{http://www.portalfiscal.inf.br/nfe}NFe").Element("{http://www.portalfiscal.inf.br/nfe}infNFe").Elements("{http://www.portalfiscal.inf.br/nfe}det"))
            {
                det.Element("{http://www.portalfiscal.inf.br/nfe}prod").Element("{http://www.portalfiscal.inf.br/nfe}cProd").Value = 
                    det.Element("{http://www.portalfiscal.inf.br/nfe}prod").Element("{http://www.portalfiscal.inf.br/nfe}cEAN").Value;

                xml.Save("D://NFe_2.xml");
            }

Isso substitui o valor do cProd pelo cEAN. É isso mesmo?

Esta dando um erro para a referencia 'XElement', quais classes deve declarar para que o comando seja reconhecido ?

0
|
0

Joel Rodrigues
   - 18 abr 2013

using System.Xml.Linq;

0
|
0

Joel Rodrigues
   - 19 abr 2013

Deu certo?

0
|
0

Joel Rodrigues
   - 30 jun 2013

Bom, creio que deu certo. Então estou marcando o tópico como concluído.

0
|
0