Visualizzazione dei risultati da 1 a 3 su 3

Discussione: DTD newbie

  1. #1

    DTD newbie

    Ho iniziato a studiare i DTD dei documenti xml

    questo è un esempio tratto da: http://www.w3schools.com/dtd/dtd_intro.asp

    codice:
    <?xml version="1.0"?>
    <!DOCTYPE note [
      <!ELEMENT note (to,from,heading,body)>
      <!ELEMENT to      (#PCDATA)>
      <!ELEMENT from    (#PCDATA)>
      <!ELEMENT heading (#PCDATA)>
      <!ELEMENT body    (#PCDATA)>
    ]>
    <note>
      <to>Tove</to>
      <from>Jani</from>
      <heading>Reminder</heading>
      <body>Don't forget me this weekend</body>
    </note>
    come avrei dovuto modificare il DTD se il codice XML fosse stato cosi' ?

    codice:
    <clipboard>
    
    <note>
      <to>Tove</to>
      <from>Jani</from>
      <heading>Reminder</heading>
      <body>Don't forget me this weekend</body>
    </note>
    
    <note>
      <to>Tove</to>
      <from>Jani</from>
      <heading>Reminder</heading>
      <body>Don't forget me this weekend</body>
    </note>
    
    </clipboard>
    grazie

  2. #2
    allora anche se sono un po rintronato stasera dovrebbe essere così:

    codice:
    <!DOCTYPE clipboard[
      <!ELEMENT clipboard (note+)>
      <!ELEMENT note (to,from,heading,body)>
      <!ELEMENT to      (#PCDATA)>
      <!ELEMENT from    (#PCDATA)>
      <!ELEMENT heading (#PCDATA)>
      <!ELEMENT body    (#PCDATA)>
    ]>
    Luca Mascaro
    Usability e Accessibility Engineer, User Interface Designer/Engineer
    NOW BLOG
    W3C HTML & WCAG WG Member for IWA/HWG

  3. #3
    grazie,

    il mio codice ora completo è qui: http://www.theartofweb.altervista.org/XML/catalog.xml

    ciao

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 © 2025 vBulletin Solutions, Inc. All rights reserved.