From: Laurent.DUPLOUY@bnf.fr
Date: 19/05/2003 - 14:32
Bonjour à tous,
Voici le problème que je n'arrive malheureusement pas à résoudre alors que c'est
surement tout simple :
Soit le code suivant :
objXMLAControler.validateOnParse = True
objXMLAControler.Load "d:\html.xml"
objXMLAControler.setProperty "SelectionLanguage", "XPath"
Set objNodeListID = objXMLAControler.selectNodes("//span")
MsgBox (objNodeListID.length)
Rien de plus simple, je veux récupérer les noeuds élément "span".
A partir du fichier html.xml suivant -> PAS DE PB :
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html SYSTEM "xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html"/>
<title>006875.htm</title>
</head>
<body>
<span>zarzioayri</span>
<span>zarzioayri</span>
<span>zarzioayri</span>
<span>zarzioayri</span>
<span>zarzioayri</span>
</body>
</html>
Avec <html xmlns:html="http://www.w3.org/1999/xhtml">, cela marche aussi.
Il trouve bien 5 span (j'ai modifié la DTD pour ne pas être obligé de mettre
l'attribut xmlns dans la balise html.)
Le même code avec le fichier suivant (donc avec un namespace par défaut):
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html"/>
<title>006875.htm</title>
</head>
<body>
<span>zarzioayri</span>
<span>zarzioayri</span>
<span>zarzioayri</span>
<span>zarzioayri</span>
<span>zarzioayri</span>
</body>
</html>
NE TROUVE PAS les balises span ???
Quelqu'un a-t-il la réponse à ce mystère qui me reste entier ?
Merci par avance pour votre collaboration.
Laurent DUPLOUY
--
Devenez redacteur <XML>fr et contribuez au developpement du
xml francophone (http://xmlfr.org/infos/redacteurs/) !
Liste de diffusion "xml-tech@xmlfr.org" (http://xmlfr.org).
Cette liste est a votre disposition pour discuter en francais de
tout sujet technique lie a XML.
Pour resilier votre abonnement, envoyez un message contenant
la commande "unsubscribe" a xml-tech-request@xmlfr.org
(mailto:xml-tech-request@xmlfr.org?Subject=unsubscribe)
Archive générée par hypermail 2.1.3 le 28/06/2004 - 11:06 UTC
webmaster@xmlfr.org
|