Bonjour
J'essaye de faire fonctionner les exemples de djibril et je rencontre une erreur lors de la partie de contrôle d'un instance XML
La partie PERL
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 annuaire.xml:3: validity error : Value for attribute xmlns:xsi of annuaire is different from default "http://www.w3.org/2001/XMLSc hema-instance" ww.w3.org/2001/XMLSchemainstance" xsi:noNamespaceSchemaLocation="ExempleXSD.xsd" ^ annuaire.xml:3: validity error : Value for attribute xmlns:xsi of annuaire must be "http://www.w3.org/2001/XMLSchema-instance" ww.w3.org/2001/XMLSchemainstance" xsi:noNamespaceSchemaLocation="ExempleXSD.xsd" ^ annuaire.xml:55: validity error : Element annuaire namespace name for xsi does not match the DTD </annuaire>
Le fichier XML :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 my $FichierXSD = $root->getAttribute('xsi:noNamespaceSchemaLocation'); my $schema = XML::LibXML::Schema->new( location => $FichierXSD ); eval { $schema->validate($tree) }; die "[XSD] Le fichier $FichierXML est non valide.\n$@" if $@;
Merci de votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE annuaire SYSTEM "ExempleDTD.dtd" > <annuaire xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance" xsi:noNamespaceSchemaLocation="ExempleXSD.xsd"> <personne miseajour="2009-06-18T20:57:57">
Partager