Ciao a tutti,
ho un problema a definire l'XSD per l'elemento che segue:
<price currency="EUR">12,15</price>
L'elemento Price è un decimal, l'attributo currency invece accetta solo 3 caratteri di testo.
Io ho scritto qualcosa del genere:
Codice PHP:
<xs:element name="price" type="xs:decimal" minOccurs="1">
<xs:complexType>
<xs:attribute name="currency" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:whiteSpace value="collapse"/>
<xs:length value="3"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
Ovviamente è sbagliato. Come si definisce questo elemento?
Grazie mille a tutti ;-)