Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: PLease help a newbie with a complex type and element interaction

From: cmsmcq@---.--- (-. -. ----------------)
To: 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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent