|
Wx - Procedure WS_ReadXml |
Iniciado por Boller, 28,ago. 2015 20:34 - 1 respuesta |
| |
| | | |
|
| |
Miembro registrado 4.520 mensajes |
|
Publicado el 28,agosto 2015 - 20:34 |
Procedure WS_ReadXml(XML_Retorno is string)
arrXml_TagResult is array of strings
busca01 is string = "<Row>" busca02 is string = "</Row>"
xposicaoinicial is int = 0 Xposicaofinal is int = 0
X is int = 0 arrXml_Tag is array of strings
Inicial is int = PositionOccurrence(XML_Retorno,busca01,firstRank,FromBeginning) Final is int = PositionOccurrence(XML_Retorno,busca02,lastRank,FromEnd)
XML_Retorno = Middle(XML_Retorno,Inicial,(Final + Length(busca02)) - Inicial)
XML_Retorno = "<Xml><Recorte><NoXml>"+XML_Retorno+"</NoXml></Recorte></Xml>"
nTotalxml is int = Length(XML_Retorno)
LOOP (nTotalxml)
X++ IFxposicaoinicial = 0 AND Xposicaofinal = 0 AND XML_Retorno[[X]] = "<" THEN X++ IF XML_Retorno[[X]] = "/" THEN xposicaoinicial = X + 1 END END IF xposicaoinicial > 0 AND XML_Retorno[[X]] = ">" THEN Xposicaofinal = X END IF Xposicaofinal > 0 AND xposicaoinicial > 0 THEN stag is string = Middle(XML_Retorno,xposicaoinicial,Xposicaofinal - xposicaoinicial) IF stag="NoXml" THEN BREAK END Add(arrXml_Tag, stag) Xposicaofinal = 0 xposicaoinicial = 0 END
END
XmlDoc is XMLDocument XmlDoc = XMLOpen(XML_Retorno, fromString) NoXml is xmlNode
FOR EACH NoXml OF XmlDoc.Xml.Recorte on NoXml
FOR EACH sTag OF arrXml_Tag
Add(arrXml_TagResult,NoXml..ChildNode[sTag])
END
END
RESULT arrXml_TagResult |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 4.520 mensajes |
|
Publicado el 28,agosto 2015 - 21:41 |
| |
| |
| | | |
|
| | | | |
| | |
|