Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    errore documento XML e DTD

    Salve a tutti.
    Ho un problema relativo 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!!!!!
    Immagini allegate Immagini allegate

  2. #2
    può essere perchè ci sono quegli 1 e 2 subito dentro film ?
    hai provato magari a darlo come <film id="1"> al posto di <film>1 ?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.