Salve ragazzi,
partendo dal seguente linguaggio di markup definito sulla base dell'xml (fornito come esempio dal sito stesso)
ho definito lo schema xsd del linguaggio nella maniera che segue:codice:<?xml version="1.0" standalone="no"?> <?xml-stylesheet type="text/xsl" href="ListaCdXsl.xsl"?> <!DOCTYPE listacd SYSTEM "listaCdXsd.xsd"> <listacd> <artista> <nome>Stanley Jordan</nome> <albums> <album> <titolo>Magic Touch</titolo> <anno>1985</anno> <etichetta>Blue Note</etichetta> </album> <album> <titolo>Stolen Moments</titolo> <anno>1991</anno> <etichetta>Blue Note</etichetta> </album> </albums> </artista> <artista> <nome>Nick Drake</nome> <albums> <album> <titolo>Pink Moon</titolo> <anno>1972</anno> <etichetta>Island</etichetta> </album> <album> <titolo>Bryter Layter</titolo> <anno>2000</anno> <etichetta>Island</etichetta> </album> <album> <titolo>Five leaves left</titolo> <anno>1970</anno> <etichetta>Island</etichetta> </album> </albums> </artista> <artista> <nome>Jeff Buckley</nome> <albums> <album> <titolo>Grace</titolo> <anno>1994</anno> <etichetta>Columbia</etichetta> </album> <album> <titolo>Mistery white boy</titolo> <anno>2000</anno> <etichetta>Columbia</etichetta> </album> </albums> </artista> <artista> <nome>Joe Satriani</nome> <albums> <album> <titolo>Surfing with the alien</titolo> <anno>1987</anno> <etichetta>Epic</etichetta> </album> <album> <titolo>Not of this earth</titolo> <anno>1988</anno> <etichetta>Relativity</etichetta> </album> </albums> </artista> </listacd>
Poi infine ho definito una trasformazione XSLT ma nel momento in cui dico al software Exchanger XML Editor di eseguirla (per generarmi il file xhtml), mi comunica il seguente errore:codice:<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="listacd"> <xsd:complexType> <xsd:all> <xsd:element ref="artista" minOccurs="1"/> </xsd:all> </xsd:complexType> </xsd:element> <xsd:element name="artista"> <xsd:complexType> <xsd:sequence> <xsd:element ref="nome" maxOccurs="1"/> <xsd:element ref="albums" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="nome" type="xsd:string"/> <xsd:element name="albums"> <xsd:complexType> <xsd:all> <xsd:element ref="album" minOccurs="1"/> </xsd:all> </xsd:complexType> </xsd:element> <xsd:element name="album"> <xsd:complexType> <xsd:sequence minOccurs="1" maxOccurs="1"> <xsd:element ref="titolo"/> <xsd:element ref="anno"/> <xsd:element ref="etichetta"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="titolo" type="xsd:string"/> <xsd:element name="anno"> <xsd:simpleType> <xsd:restriction base="xsd:integer"> <xsd:minInclusive value="1800"/> <xsd:maxInclusive value="2009"/> </xsd:restriction> </xsd:simpleType> </xsd:element> <xsd:element name="etichetta" type="xsd:string"/> </xsd:schema>
Non capisco dov'è l'errore nel file xsd! Spero qualcuno mi sappia dare utili suggerimenti!codice:FATAL ERROR: Error reported by XML parser; SystemID: file:/C:/../Cd/listaCdXsd.xsd; Line#: 1; Column#: 2 FATAL ERROR: org.xml.sax.SAXParseException: The markup declarations contained or pointed to by the document type declaration must be well-formed.

Rispondi quotando