12
I’m doing an XML reading of Nfe however, at the moment I’m reading and playing in a txt
, but I can’t read those tags down below:
<?xml version="1.0" encoding="UTF-8"?>
<nfeProc xmlns="http://www.portalfiscal.inf.br/nfe" versao="2.00">
<NFe xmlns="http://www.portalfiscal.inf.br/nfe">
<infNFe Id="NFe0000000000000000000000000000000000000000" versao="2.00>
I can’t identify those openings <?xml
and ?>
, and nfeProc
and infNFe
return me the Node emptiness.
switch (Ler_Xml.NodeType)
{
case XmlNodeType.Element:
txt_display_xml_envio.AppendText("<" + Ler_Xml.Name);
txt_display_xml_envio.AppendText(">");
break;
case XmlNodeType.ProcessingInstruction:
txt_display_xml_envio.AppendText("<?" + Ler_Xml.Name);
txt_display_xml_envio.AppendText("?>");
break;
case XmlNodeType.Text:
txt_display_xml_envio.AppendText(Ler_Xml.Value);
break;
case XmlNodeType.EndElement:
txt_display_xml_envio.AppendText("</" + Ler_Xml.Name);
txt_display_xml_envio.AppendText( ">");
txt_display_xml_envio.AppendText(System.Environment.NewLine.ToString());
txt_display_xml_envio.Update();
break;
}
try to use serialization, http://msdn.microsoft.com/pt-br/library/ms233843.aspx, tonight I make an example with Nfe XML.
– Pablo Tondolo de Vargas
blz cara vlw, it will be extremely useful to serialize when I’m assembling Nfe, but I’m trying to read an Arq.xml and show it in a test-only textbox, this reading normal and showing, however these above tags I specified in the post are not shown, they return empty like this in the textbox <nfeProc><Nfe><infNFe>, the encoding that comes first of all well is presented.
– bp002
would be like the code snippet that reads XML and loads into the textbox?
– Pablo Tondolo de Vargas
edited the post, pasted up there the Cod. blz
– bp002