emotta Posted December 20, 2017 Report Share Posted December 20, 2017 Preciso conseguir a chave da NFe usando o TXmlDocument alguem pode me ajudar? Quote Link to comment Share on other sites More sharing options...
sistem Posted December 20, 2017 Report Share Posted December 20, 2017 veja se ajuda cFile := FOpen( "arquivo.xml" ) xmlDoc := TXmlDocument():New( cFile ) If xmlDoc:nStatus != HBXML_STATUS_OK Msginfo("Erro ao ler XML", "Aviso!") Return nil Endif xmlIter := TXmlIterator():New( xmlDoc:oRoot ) xmlNode := xmlIter:Find() Do While xmlNode != nil If !Empty(xmlNode:cData) If Lower(xmlNode:cName) == "nnf" cNumeroNFe := xmlNode:cData Elseif Lower(xmlNode:cName) == "cfop" cCFOP := xmlNode:cData Elseif Lower(xmlNode:cName) == "chnfe" cChaveNfe := xmlNode:cData Endif Endif xmlNode := xmlIter:Next() Enddo Endif ? cChaveNfe Quote Link to comment Share on other sites More sharing options...
kapiaba Posted December 20, 2017 Report Share Posted December 20, 2017 http://fivetechsupport.com/forums/viewtopic.php?f=3&t=23740 http://www.pctoledo.com.br/forum/viewtopic.php?f=43&t=12543 https://pctoledo.websiteseguro.com/forum/viewtopic.php?f=54&t=15913 Quote Link to comment Share on other sites More sharing options...
emotta Posted December 20, 2017 Author Report Share Posted December 20, 2017 obrigado pessoal Quote Link to comment Share on other sites More sharing options...
crisvam Posted December 22, 2017 Report Share Posted December 22, 2017 (edited) Faça assim: cFile := FOpen( "arquivo.xml" ) xmlDoc := TXmlDocument():New( cFile ) If xmlDoc:nStatus != HBXML_STATUS_OK Msginfo("Erro ao ler XML", "Aviso!") Return nil Endif oNode := xmlDoc:findfirst("chNFe") If oNode != Nil ?oNode:cData Endif Edited December 22, 2017 by crisvam Auxilio Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.