ciao a tutti, sono nuovo del forum.

ho svolto quest'esercizio e vorrei sapere se è giusto o se ho fatto qualche errore! grazie

Dato il seguente DTD:

<!DOCTYPE bookstore [
<!ELEMENT bookstore (topic+)>
<!ELEMENT topic (name, book*)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT book (title, author)>
<!ELEMENT title (#CDATA)>
<!ELEMENT author (#CDATA)>
<!ELEMENT isbn (#CDATA)>
<!ATTLIST book isbn CDATA “0”>
]>

determinare XML e XML Schema:

-------------------------------------------------------------------------------------

XML:

<?xml version="1.0"?>
<bookstore>
<topic>
<name>&quiteNOME_ARGOMENTO_SEZIONE&quite</name>
<book isbn =”1234567891012”>
<title>”TITOLO_LIBRO”</title>
<author>AUTORE_LIBRO</author>
</book>
</topic>
</bookstore>

XML Schema:

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:element name="bookstore" type="Tbookstore"/>

<xsd:complexType name="Tbook">
<xsd:sequence>
<element name="title" type="xsd:string" />
<element name="autor" type="xsd:string" />
</xsd:sequence>
<xsd:attribute name="isbn" type="xsd:string" default="0"/>
</xsd:complexType>

<xsd:complexType name="Ttopic">
<xsd:sequence>
<element name="name" type="xsd:string" />
<element name="book" type="Tbook" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="Tbookstore">
<element name="topic" type="Ttopic" minOccurs="1" maxOccurs="unbounded"/>
</xsd:complexType>




grazie a tutti!