Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - PLease help a newbie with a complex type and element interaction [Thread Next] Re: PLease help a newbie with a complex type and element interactionTo: NULL Date: 6/10/2005 1:16:00 PM "Sandie C" <sandie_nospam_c@s...> writes:
> I have included my schema and xml file below. I am using
> xml spy and the message I get is Phone must be valid
> with respect to definition '{no name}'.
What is it that you don't understand?
The Phone element needs to be valid against its type; in the
schema/instance pair you provide, the Phone elements aren't
valid. The type assigned to Phone has no name; that might be
why XMLSpy">XMLSpy refers to it using the phrase "{no name}".
If that's the only error message you get, I can understand
being a bit baffled; it gives no hint as to WHY the Phone
elements are not valid. You might try another schema
processor. If you don't have any other processors installed,
try packaging up schema and instance together and using the
validate-uploaded-file feature of the XSV server at W3C:
http://www.w3.org/2001/03/webdata/xsv
To package the schema and instance together, make a
file with the following structure:
<wrapper>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
id="this_is_the_place"
>
... (the rest of your schema, just as you sent it
to the newsgroup)
</xsd:schema>
<Group xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="#this_is_the_place">
... (the rest of your XML instance, just as you
sent it to the group)
</Group>
</wrapper>
Put this somewhere in your file system. Then go to
http://www.w3.org/2001/03/webdata/xsv in your Web browser
and scroll down to find the part of the form that begins
Use this form only if you are behind a firewall or have a
schema to check which is not accessible via the Web.
File to upload:
and ask XSV to validate the single-file package you
constructed above.
You'll see a slightly different set of error messages.
They may help convince you that Priscilla Walmsley was
right in her response to your post: your regex is not
doing quite what a regex intended to match North
American phone numbers should be doing.
> <xsd:pattern value="[1-9] {3}[0-9]{3}-[0-9]{4}"/>
> ...
> <Phone Location="home">305 555-2919</Phone>
Look at these two carefully and you will achieve
enlightenment.
I hope this helps,
-C. M. Sperberg-McQueen
World Wide Web Consortium
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
