PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 25 → WD21 - Criar xml sitemap
WD21 - Criar xml sitemap
Débuté par Mister ANDRE MARTINI, 23 nov. 2016 16:50 - 1 réponse
Membre enregistré
212 messages
Popularité : +25 (25 votes)
Posté le 23 novembre 2016 - 16:50
Pessoal,

estou fazendo um aplicativo para gerar o sitemap dos meus sites e gostaria de saber o seguinte:
Como criar este tag abaixo:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">


sitemap correto
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>http://www.insurancevah.com/<lastmod>2016-11-11T11:56:22+00:00</lastmod>
<changefreq>daily</changefreq>
<priority>1.00</priority>
</url>

sitemap que eu gerei
<?xml version="1.0" encoding="UTF-8"?>
<url>
<loc>http://www.insurancevah.com/<changefreq>monthly</changefreq><priority>0.5000</priority></url>

meu código
XMLDocument("sitemap")
XMLParent("sitemap")
XMLAddChild("sitemap","url","",True)
XMLAddChild("sitemap", "loc", EDT_url_site + "/")
XMLAddChild("sitemap", "changefreq", "monthly")
XMLAddChild("sitemap", "priority", "0.5000")

xmlfile = XMLBuildString("Sitemap",XMLDocumentDefault,XMLEncodingUTF8)

fSaveText("sitemap.xml", xmlfile)
XMLClose("sitemap")


--
André Martini
IS2 Automotive http://www.is2.inf.br/is2automotive/index.html
IS2 Construtive http://www.is2.inf.br/is2construtive/index.html
IS2 Store http://www.is2.inf.br/is2store/index.html
IS2 Gerent http://www.is2.inf.br/is2gerent/index.html
Membre enregistré
212 messages
Popularité : +25 (25 votes)
Posté le 23 novembre 2016 - 18:33
resolvido

XMLDocument("sitemap")
XMLParent("sitemap")
XMLAddChild("sitemap","urlset","",True)
XMLAddAttribute("sitemap", "xmlns", "http://www.sitemaps.org/schemas/sitemap/0.9")
XMLAddAttribute("sitemap", "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance")
XMLAddAttribute("sitemap", "xsi:schemaLocation", "http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd")

XMLParent("sitemap")
XMLAddChild("sitemap","url","",True)
XMLAddChild("sitemap", "loc", EDT_url_site + "/")
XMLAddChild("sitemap", "changefreq", "monthly")
XMLAddChild("sitemap", "priority", "0.5000")


xmlfile = XMLBuildString("Sitemap",XMLDocumentDefault,XMLEncodingUTF8)

fSaveText("sitemap.xml", xmlfile)
XMLClose("sitemap")


--
André Martini
IS2 Automotive http://www.is2.inf.br/is2automotive/index.html
IS2 Construtive http://www.is2.inf.br/is2construtive/index.html
IS2 Store http://www.is2.inf.br/is2store/index.html
IS2 Gerent http://www.is2.inf.br/is2gerent/index.html
Message modifié, 23 novembre 2016 - 18:33