Salve a tutti.
Ho un problemarelativo ad un xml che ho costruito per fare un catalogo
di film.
Ho costruito questa DTD:
<!ELEMENT elenco_film (film)>
<!ELEMENT film (titolo,anno,genere,regista,attore)>
<!ELEMENT titolo (#PCDATA)>
<!ELEMENT anno (#PCDATA)>
<!ELEMENT genere (#PCDATA)>
<!ELEMENT regista (nome_regista,cognome_regista)>
<!ELEMENT nome_regista (#PCDATA)>
<!ELEMENT cognome_regista (#PCDATA)>
<!ELEMENT attore (nome_attore,cognome_attore)>
<!ELEMENT nome_attore (#PCDATA)>
<!ELEMENT cognome_attore (#PCDATA)>
poi ho costruito l'xml associando la DTD al file. Questo è l'xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE elenco_film SYSTEM "C:\Users\luisella\Desktop\esercizi\catalogo film prova\catalogo film 1.dtd">
<elenco_film>
<film>1
<titolo>an andalusian dog</titolo>
<anno>1929</anno>
<genere>surrealista</genere>
<regista>
<nome_regista>luis</nome_regista>
<cognome_regista>Bunuel</cognome_regista>
</regista>
<attore>
<nome_attore>Salvador</nome_attore>
<cognome_attore>Dalì</cognome_attore>
</attore>
</film>
<film>2
<titolo>arizona dream</titolo>
<anno>1993</anno>
<genere>drammatico</genere>
<regista>
<nome_regista>Emir</nome_regista> <cognome_regista>Kusturica</cognome_regista>
</regista>
<attore>
<nome_attore>Johnny</nome_attore>
<cognome_attore>Depp</cognome_attore>
</attore>
</film>
</elenco_film>
quando faccio "check validation" continuano a venirmi fuori questi errori
nell'xml: 1. the content of element type "film" must match "(titolo,anno,genere,regista,attore)"
2. the content of element type "elenco_film" must match "(film).
Inoltre nella DTD mi compare "the markup in the document preceding the root element must be well formed
Qualcuno mi aiuti HELPPPPPP!!!!!

relativo ad un xml che ho costruito per fare un catalogo
Rispondi quotando
