|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
XML Schema Confusion ... ?
Ok, I am new to this so sorry if the error is something obvious, but I can't seem to get the bit of code below to work properly:
<xs:element name="doctext"> <xs:complexType> <xs:sequence> <xs:element name="primary" type="xs:string"/> <xs:element name="secondary" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> Upon validation, I get a message telling me that the primary and secondary elements were not declared. Yet the code below (from the same Schema) worksd fine. <xs:element name="administrative"> <xs:complexType> <xs:sequence> <xs:element name="id" minOccurs="1" maxOccurs="1"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:length value="15"/> <xs:pattern value="\d{3}-\d{4}-\d{6}"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="status-comment" type="xs:string"/> <xs:element name="copyright" type="xs:string"/> <xs:element name="sponsor" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> Other than the simpleType restriction on the id element, I can't see anything that would cause one code snippet to work and the other not. Any leads would be appreciated. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > XML Schema Confusion ... ? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|