PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 25
→
Wx - Procedure WS_ReadXml
Wx - Procedure WS_ReadXml
Started by adrianoboller, Aug., 28 2015 8:34 PM - 1 reply
Connect yourself…
adrianoboller
#1
Registered member
3,664 messages
Popularité : +175 (223 votes)
Posted on August, 28 2015 - 8:34 PM
Procedure
WS_ReadXml
(
XML_Retorno is
string
)
arr
Xml_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
arr
Xml_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>"
n
Totalxml is
int
=
Length
(
XML_Retorno
)
LOOP
(
n
Totalxml
)
X
+
+
IF
xposicaoinicial
=
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
(
arr
Xml_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
s
Tag OF
arr
Xml_Tag
Add
(
arr
Xml_TagResult
,
NoXml
..
ChildNode
[
s
Tag
]
)
END
END
RESULT
arr
Xml_TagResult
Report
0
0
adrianoboller
#2
Registered member
3,664 messages
Popularité : +175 (223 votes)
Posted on August, 28 2015 - 9:41 PM
Prezados,
segue alguns links:
http://help.windev.com/en-US/…
http://help.windev.com/en-US/…
http://help.windev.com/en-US/…
http://help.windev.com/en-US/…
Informações complementares, lembro pra se aterem aos retornos se estao vindo wm UTF-8, Ansi ou Unicode ai tem que converter se não vai aparecer codigo japones.... rsss...
[ ]´s
Adriano Boller
Report
0
0
→ Go back to WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text