PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 25
→
WD - Como ler tags "itens" Feed RSS de um WebDev dinâmica?
WD - Como ler tags "itens" Feed RSS de um WebDev dinâmica?
Started by BOLLER ADRIANO, Jun., 28 2016 6:25 AM - No answer
Connect yourself…
BOLLER ADRIANO
#1
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on June, 28 2016 - 6:25 AM
Como ler tags "itens" Feed RSS de um WebDev dinâmica?
//Voici un exemple complet de code.
//Traitement dans le code d`init d`une page qui renseigne une combo "ZR_ZoneRepeteeFluxRSS"
//Variables locales
s
RequeteXPATH est une
chaîne
n
Cpt est un
entier
i est un
entier
ptabEnregEncours est un
tableau dynamique
s
ContenuXML est une
chaîne
Res est un
booléen
gs
AdresseFichierXML
est une
chaîne
=
"http://carnets.voyage.free.fr/CarnetsDeVoyages.XML"
//Recupration du fichier XML
SI
HTTPRequête
(
gs
GAdresseFichierXML
)
ALORS
s
ContenuXML
=
HTTPDonneRésultat
(
httpRésultat
)
FIN
SI
s
ContenuXML
<
>
""
ALORS
// Creation du document XML
Res
=
XMLDocument
(
"DocXML"
,
s
ContenuXML
)
// Le document est cree ?
SI
Res
=
Faux
ALORS
SI
EnModeTest
(
)
ALORS
Trace
(
"Le document n`a pas pu etre cree."
)
FIN
FIN
s
RequeteXPATH
=
"//item/title | //item/description | //item/link"
//On compte le nombre d`occurrences
SI
XMLExecuteXPath
(
"DocXML"
,
s
RequeteXPATH
)
ALORS
TANTQUE
XMLTrouve
(
"DocXML"
)
//3 items par occurrence
XMLSuivant
(
"DocXML"
)
XMLSuivant
(
"DocXML"
)
XMLSuivant
(
"DocXML"
)
n
Cpt
+
+
FIN
FIN
ptabEnregEncours
=
allouer
un
tableau dynamique de
3
par
n
Cpt
chaînes
i
=
1
SI
XMLExecuteXPath
(
"DocXML"
,
s
RequeteXPATH
)
ALORS
TANTQUE
XMLTrouve
(
"DocXML"
)
//Titre du flux
ptabEnregEncours
[
1
]
[i] =
XMLDonnée
(
"DocXML"
)
XMLSuivant
(
"DocXML"
)
//Description du flux
ptabEnregEncours
[
2
]
[i] =
XMLDonnée
(
"DocXML"
)
XMLSuivant
(
"DocXML"
)
//Lien HTTP du flux
ptabEnregEncours
[
3
]
[i] =
XMLDonnée
(
"DocXML"
)
XMLSuivant
(
"DocXML"
)
i
+
+
FIN
FIN
XMLTermine
(
"DocXML"
)
i
=
1
POUR i
=
1
A
n
Cpt
SI
EnModeTest
(
)
ALORS
Trace
(
"pos 1 du tab : "
+
ptabEnregEncours
[
1
]
[i]
)
Trace
(
"pos 2 du tab : "
+
ptabEnregEncours
[
2
]
[i]
)
Trace
(
"pos 3 du tab : "
+
ptabEnregEncours
[
3
]
[i]
)
FIN
ZoneRépétéeAjouteLigne
(
ZR_
ZoneRepeteeFluxRSS
,
ptabEnregEncours
[
1
]
[i]
,
ptabEnregEncours
[
3
]
[i]
,
ptabEnregEncours
[
2
]
[i]
)
FIN
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
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