Bonjour, je fais un exercice pour mon école et j'ai un problème pour la validation de mon xml, pourtant je pense que tout est correct
Je vous transmet mon DTD ici :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 <?xml version="1.0" encoding="UTF-8"?> <!ELEMENT bibliotheque ( document+ )> <!ATTLIST document type CDATA #REQUIRED > <!ELEMENT document ( ref ,addresse?, auteur , nomconf? , date? , journal? , nombre? , pages? , titre , volume? , editeur? , annee )> <!ELEMENT annee ( #PCDATA )> <!ELEMENT addresse ( #PCDATA )> <!ELEMENT titre ( #PCDATA )> <!ELEMENT pages ( #PCDATA )> <!ELEMENT nomconf ( #PCDATA )> <!ELEMENT auteur ( nom+ )> <!ELEMENT nom ( #PCDATA )> <!ELEMENT ref ( #PCDATA )> <!ELEMENT volume ( #PCDATA )> <!ELEMENT nombre ( #PCDATA )> <!ELEMENT journal ( #PCDATA )> <!ELEMENT date ( dateAjout? , dateModification? )> <!ELEMENT dateModification ( #PCDATA )> <!ELEMENT dateAjout ( #PCDATA )> <!ELEMENT editeur ( #PCDATA )>
Et voici mon xml
Editix me transmet comme message d'erreur "The content of element type "document" must match "(ref,addresse?,auteur,nomconf?,date?,journal?,nombre?,pages?,titre,volume?,editeur?,annee)"."
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE bibliotheque SYSTEM "03-biblio.dtd"> <bibliotheque> <document type="livre"> <ref>Berge:1970</ref> <addresse>Paris</addresse> <auteur> <nom>Claude Berge</nom> </auteur> <date> <dateAjout>2011-05-17 23:05:29 +0200</dateAjout> <dateModification>2011-05-17 23:06:12 +0200}</dateModification> </date> <titre>Graphes et Hypergraphes</titre> <editeur>Dunod</editeur> <annee>1970</annee> </document> <document type="article"> <ref>Tarjan:1972</ref> <auteur> <nom>Robert E. Tarjan</nom> </auteur> <date> <dateAjout>2011-06-29 16:28:18 +0200</dateAjout> <dateModification>2011-06-29 16:29:15 +0200</dateModification> </date> <journal>SIAM Journal on computing</journal> <nombre>2</nombre> <pages>146-160</pages> <titre>Depth-first search and linear graph algorithms</titre> <volume>1</volume> <annee>1972</annee> </document> <document type="conférence"> <ref>TRosenbergJ:2007</ref> <auteur> <nom>Andrew Rosenberg </nom> <nom>Julia Hirschberg</nom> </auteur> <nomconf>Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning (EMNLP-CoNLL)</nomconf> <pages>410-420</pages> <titre>V-Measure: A Conditional Entropy-Based External Cluster Evaluation Measure</titre> <addresse>Prague, Czech Republic</addresse> <annee>2007</annee> </document> </bibliotheque>
Je vous remercie d'avance.
Cordialement,
Magnin Paul.
Partager