I have a problem to define my data Type, this is my xsd file:
<xs:simpleType name="maso_Type">
<xs:restriction base="xs:ID">
<xs:pattern value="[0-9]+"/>
</xs:restriction>
</xs:simpleType>
And this is my xml file:
<cuahang xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="dulieu.xsd">
<sach soluong="1">
<maso>1</maso>
<tieude>Gotich</tieude>
<nhaxuatban>KimDong</nhaxuatban>
<tacgia>KimDong</tacgia>
<hinhanh>hinhanhs/sachs/KientrucGotich.jpg</hinhanh>
<giaca>7500</giaca>
<tinhtrang>Con</tinhtrang>
<theloai>nghethuat</theloai>
</sach>
</cuahang>
I want my "maso" base on ID (is only for each), no duplicated. Its work if I define it is integer but it's not only. If I define base on ID, I got this when validate the xml:
cvc-datatype-valid.1.2.1: '1' is not a valid value for 'NCName'. [7]
cvc-type.3.1.3: The value '1' of element 'maso' is not valid. [7]