FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 25
→
WX - Example Read Xml with Android and iOS - Lendo Xml com Android e iOS
WX - Example Read Xml with Android and iOS - Lendo Xml com Android e iOS
Débuté par BOLLER, 28 juil. 2017 15:25 - Aucune réponse
Connectez-vous…
BOLLER
#1
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 28 juillet 2017 - 15:25
Procedure
Android_iOs_ReadXml
(
XML_Retorno
is string
,
Xml_Atributo
is string
)
arrXml_TagResult
is array of strings
xposicaoinicial
is int
=
0
Xposicaofinal
is int
=
0
X
is int
=
0
arrXml_Tag
is array of strings
XML_Retorno
=
RemoveAcentos
(
XML_Retorno
)
XML_Retorno
=
Replace
(
XML_Retorno
,
CRLF
,
""
)
XML_Retorno
=
Replace
(
XML_Retorno
,
CR
,
""
)
Inicial
is int
=
PositionOccurrence
(
XML_Retorno
,
"<"
+
Xml_Atributo
,
firstRank
,
FromBeginning
+
IgnoreCase
)
Final
is int
=
PositionOccurrence
(
XML_Retorno
,
"</"
+
Xml_Atributo
+
">"
,
lastRank
,
FromEnd
+
IgnoreCase
) +
Length
(
"</"
+
Xml_Atributo
+
">"
)
XML_Retorno
=
Middle
(
XML_Retorno
,
Inicial
,
Final
-
Inicial
)
XML_Retorno
=
Replace
(
XML_Retorno
,
Xml_Atributo
,
"NoXml"
)
XML_Retorno
=
"<Xml><Retorno>"
+
XML_Retorno
+
"</Retorno></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
(
arrXml_Tag
,
stag
)
Xposicaofinal
=
0
xposicaoinicial
=
0
END
END
IF
ArrayCount
(
arrXml_Tag
) >
0
THEN
NoXml
is string
i
is int
=
0
LOOP
i
+
+
NoXml
=
XMLExtractString
(
XML_Retorno
,
"NoXml"
,i)
IF
NoXml
=
""
THEN
BREAK
END
FOR
E
ACH stag OF arrXml_Tag
temp
is string
=
XMLExtractString
(
NoXml
,
stag
)
Add
(
arrXml_TagResult
,
temp
)
END
END
END
RESULT
arrXml_TagResult
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Signaler
0
0
→ Revenir à WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte