sábado, 24 de junho de 2017

AULA 1187 WinDev 010 xml LerItensXml









Video no Youtube Se Gostou clique aqui para dar joinha





https://doc.windev.com/en-US/?3081025&name=xmlfind_function





WinDev - Xml - 001/... Criar um Xml
WinDev - Xml - 002/... Ler Xml Aula 1/...
WinDev - Xml - 003/... Ler Xml Aula 2/...
WinDev - Xml - 004/... Ler Xml Aula 3
WinDev - Xml - 005/... XmlRead - Retirar Tag
WinDev - Xml - 006/... Sefaz Gratuito-Ler Xml Cliente/Gravar
WinDev - Xml - 007/... Utf8ToString
Ler Xml e Colocar Tabela - WinDev - Xml - 008/...
Ler Xml Nfe - WinDev - Xml 009
LER ITENS XML - DOCZIP MANIFESTACAO - XML 010 - AULA 1187
DESCOMPACTAR STRING - XML - MANIFESTACAO NOTA - XML 011 - AULA 1192




TableDeleteAll(TABLE_NSU)

nome_tag is string=""
Nome_Atributo is string=""

s_meu_xml is string=EDT_xml  //s_meu_xml is string=fLoadText(s_xml_documento)   
XMLDocument("XML5",s_meu_xml)
EDT_tpAmb=XMLRead("XML5","/retDistDFeInt/tpAmb")
EDT_ultNSU=XMLRead("XML5","/retDistDFeInt/ultNSU")
EDT_maxNSU=XMLRead("XML5","/retDistDFeInt/maxNSU")   

XMLFind("XML5",Null,XMLContinue+XMLChildItem)   
WHILE XMLFound("XML5")     
   
    SWITCH XMLElementType("XML5")       
        CASE XMLTag :
            nome_tag = XMLElementName("XML5")           
        CASE XMLAttribute
            IF nome_tag="docZip" THEN
                Nome_Atributo = XMLData("XML5")
                IF IsNumeric(Nome_Atributo) THEN
                    TableAddLine(TABLE_NSU,Nome_Atributo)
                END
               
            END   
           
    END
    XMLNext("XML5")   
   
END
XMLClose("XML5")







EDT_xml=[
    <?xml version="1.0"?>
    <retDistDFeInt xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.portalfiscal.inf.br/nfe" versao="1.00">
    <tpAmb>1</tpAmb>
    <verAplic>1.1.9</verAplic>
    <cStat>138</cStat>
    <xMotivo>Documento(s) localizado(s)</xMotivo>
    <dhResp>2017-06-23T05:33:17</dhResp>
    <ultNSU>000000000003373</ultNSU>
    <maxNSU>000000000003787</maxNSU>
    <loteDistDFeInt>
    <docZip NSU="000000000003324" schema="resNFe_v1.00.xsd">H4sIAAAAAAAEAIVSbW+CMBD+K4bv0istIORs4hQzF8fMUOP2DUvRJggGiPrzV8VtMVmyL+1z1+flcinWqomnqnc5FGUTXppsaO3b9hgScj6f7TOzq3pHHABKNq/zRO7VIbV+yPp/cl+XTZuWUlm9k6qbtBpa1Aa4ezzoj1XdpkWuG5kWti5ze1uTMleWQLk3IwrOqA8sANf3mOuBifHAdYHCFXI34AENgPt8QB2OpNPgOF68iEcNklsTL3F1UGIyW0TJat5bR7Pxav6W9ObLyQhJ94izSIDDwThS7iExJWb76KCFA9TvA+s7bElpCE7IuClDMO4dAdtjPBUUye3GkzkGXmAPGJIrxkzv1mkhiu2uGn0UWslymeb06TOTo2cWb5iWQ2PVkUzmu5Lbtvoj1v2NvXOwXNRVK+htX8A9P2AOGyDp2igT3V5XY0b7hki6XyC+AB2HMdUOAgAA</docZip>
    <docZip NSU="000000000003325" schema="resNFe_v1.00.xsd">H4sIAAAAAAAEAIVS246CMBD9FcK7tKUFhIxNiKKry7JkvcRXRBB2ubiAwudvBffi0zbNdGZyzpzJSaGKam8eSV2eFbXV1ceJnDTN2UKobVulpUpZnZCKMUH7F3cdJlEeyD/g9H/wKC3qJijCSJauUVUH5UQmCsb3GQ/8c1k1QRandRhkSlrEyqFCRRzJHMJErMgZJQamRB8zSvHtqBrVNKHWF2NNxWSsY2wSQlRAAwemnr/ijxxAfRM6r8wjPtv5kr3dvPrO1F5L7mZmS5Lj+5I0X7pL2wU0wGDpcKwyzAxqGCYgUcIxcfKUC1ljhOlIpRuMrf6KUkRAAwCaszfnBFD/wlUEhqliGoBuORzT0y7I+MW3F86iiJ9W5cX80I3T53v3bO5ZXm4nYtQAEppvUXhoyr+yhFhMtyj5lb1joPCrsuGkdw4z4YKqawzQ0IZwnTY3k8Rq3ymg4T/wL1sn8lMYAgAA</docZip>
    <docZip NSU="000000000003326" schema="resNFe_v1.00.xsd">H4sIAAAAAAAEAIWSyW7CQAyGXyXKnYxnyyYzEmIpVBQoELrcQggkUkhQMio8fgdCW3HqxfPb+uzfsgbrtJmNUutyLMomvDS7rp1pfQoJOZ/Pzpk7VX0gDICS95fpKsnSY2z/wvn/cCcvGx2XSWpbX2ndxFXXpg7AfcZD/6mqdVzs8yaJCycv9862JuU+tRUmmVlRCU494F5AJff8AABcX0pp3IyEQAKXRkmg0pSRtD3Yny2e1WMPklsRL7PqmKrBMnqabyb9sdWL1nNrMez3VtZ0PeghaQGcDBUwAcxnnhBITIq7bHjMFQPqdYB3GF9TEUo/BDCpiUhaAPVpNlIUye3FLxOE6zrUAFeNu/ywiQs1boJ+NR5Pot0HjZcseatf688CokSLrhnVQsZzmSZbXT3YSuMWcv/P9s5guagrrejtZiDcIBCcMSRtGZNVrq/nMav9SCTtT1Dfvi/DYxICAAA=</docZip>
    <docZip NSU="000000000003327" schema="resNFe_v1.00.xsd">H4sIAAAAAAAEAIVS226CQBD9FcJrIzvLsiBk3MQqJlpKTRHTPiKuQsPFABH79wWxbUwf+rRzZs5lMlmsZO0vpHLJs6J2LvV+oiZNc3IIadtWa5lWVkeiA1Dy9uwFcSLzSP0hp/+TR2lRN1ERS1U5y6qOyolKNYCbx53+VFZNlB3SOo4yLS0O2q4ixUGqAuOkW1EYjFrAbOCWybgJXYwJnAOFvjS4Pbb6hsXB5oBk0ODMX6/EvQbJtYkXv8ylmC/XbhB6ytZdzkLvJVC8zXyKZBji0hWgG0B1gxomkg7iPnHzVOhArRGwkc421HQYdajdQQc694GAzclfCIrk+uK5B5RqnCPpa9ynx22UienT52Omr8Lispm/B7PxAyUfgVuEi6CddFYDqct8lfGuKf/G6vAbe+Ngsa7KRtDrvcCwKNgmGyMZ2hgHadOfplvtu0Qy/ALxBWupzhAOAgAA</docZip>
    <docZip NSU="000000000003373" schema="resNFe_v1.00.xsd">H4sIAAAAAAAEAIVSbW+CMBD+K4Tv0mtpEcnZhExMZhSJ4LJ9RKxComCAKT9/RdwW92VJc708eV4ul8NaNeFcGd35VDZe1+ynZt62F4+Q2+1m3Wyrqo+EAVDyvlrGWa7OqflDLv4nj4qyadMyU6ZxVXWTVlOTWgAPjyf9parb9HQomiw9WUV5sHY1KQ/KlJjlekRpCzoG7jIHwLU56BgAIQB0IDDOQfQA4xMxcQSSQYMvYbSQzxokdxC7sDor6W+TtRGtY10DYxPEib/d+GESGFGQbNZREBrLZOYjGdj4GkhBex/m2JQ6SDSA+zw4F5IBHY+A65fQicfGHhUjsL0+cCBgewnnkiK5/3jVxeXcAhtJ3+O+OL6lJ0lWHewdMttV5LDgvFI0P358rnbM30611UDSmRuV7drqT6xte5T/xj44WEZ11Up6XyGjlAnOqYtkgDGLi7bflh7tu0UyHIb8AoWPdFwhAgAA</docZip>
    </loteDistDFeInt>
    </retDistDFeInt>
]

// EU CRIEI UM EDT XML, PARA MOSTRAR A VOCES, O XML, E TAMBEM PARA RETIRAR O NSU, QUE TANTO PRECISO
// I CREATED AN EDT XML, TO SHOW YOU, THE XML, AND ALSO TO REMOVE THE NSU, THAT SO MUCH I NEED
// YO CREA UN EDT XML, PARA MOSTRAR A VOCES, XML, Y TAMBIEN PARA RETIRAR EL NSU, QUE TANTO PRECISO




















Teste

Teste
teste