|
-
January 22nd, 2007, 11:04 AM
#1
why is this XML not validating?
Have the following XSD:
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.org/mytypes" xmlns:tns="http://example.org/mytypes">
<xsd:complexType name="personinfo2">
<xsd:sequence>
<xsd:element name="lastname" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="employee" type="tns ersoninfo2"/>
</xsd:schema>
and the following XML file:
<employee xmlns='http://example.org/mytypes'><lastname>smith</lastname></employee>
why is it failing validation with this message?:
"The element 'employee' in namespace 'http://example.org/mytypes' has invalid child element 'lastname' in namespace 'http://example.org/mytypes'. List of possible elements expected: 'lastname'."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|