Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


PLease help a newbie with a complex type and element interaction

From: "Sandie C" <sandie_nospam_c@----.--.--->
To: NULL
Date: 6/6/2005 12:25:00 AM
please help a newbie I am so confused by trying to declare a user type, and
then incorporate it into an element that uses the derived type and has an
attribute.
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}'.
Thanks for any help at all.
Sandie

<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:simpleType name="LType">

<xsd:restriction base="xsd:string">

<xsd:enumeration value="home"/>

<xsd:enumeration value="business"/>

</xsd:restriction>

</xsd:simpleType>

<xsd:simpleType name="PType">

<xsd:restriction base="xsd:string">

<xsd:pattern value="[1-9] {3}[0-9]{3}-[0-9]{4}"/>

</xsd:restriction>

</xsd:simpleType>

<xsd:element name="Phone">

<xsd:complexType>

<xsd:simpleContent>

<xsd:extension base="PType">

<xsd:attribute name="Location" type="LType"/>

</xsd:extension>

</xsd:simpleContent>

</xsd:complexType>

</xsd:element>

<xsd:element name="Group">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="Member" maxOccurs="unbounded"/>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

<xsd:element name="Member">

<xsd:complexType>

<xsd:sequence>

<xsd:element ref="Phone" maxOccurs="unbounded"/>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:schema>



the xml file is

<?xml version="1.0"?>

<Group xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="C:\0s\test.xsd">

<Member>

<Phone Location="home">305 555-2919</Phone>

<Phone Location="business">305 555-2910</Phone>

</Member>

<Member>

<Phone Location="home">517 555-8911</Phone>

</Member>

<Member>

<Phone Location="home">481 555-0911</Phone>

<Phone Location="home">481 555-0912</Phone>

<Phone Location="home">481 555-0913</Phone>

<Phone Location="business">481 555-8717</Phone>

</Member>

<Member>

<Phone Location="home">305 555-8551</Phone>

<Phone Location="business">305 555-9090</Phone>

</Member>

<Member>

<Phone Location="business">415 555-5313</Phone>

</Member>

<Member>

<Phone Location="home">441 555-8771</Phone>

</Member>

<Member>

<Phone Location="business">305 555-0817</Phone>

</Member>

<Member>

<Phone Location="home">301 555-0914</Phone>

<Phone Location="home">301 555-0915</Phone>

<Phone Location="home">301 555-0916</Phone>

</Member>

<Member>

<Phone Location="home">301 555-3181</Phone>

<Phone Location="business">301 555-6581</Phone>

</Member>

<Member>

<Phone Location="business">301 555-6866</Phone>

</Member>

</Group>







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