How to define the relationships between tables using the XML schem

Y

Yolande

Hi,

I want to import a XML file and use the XML schema file to define the Access
database. I met a problem of how to define the relationships between tables.
I would like to use "costomerid" in Table "custom" as a foreign key in Table
"ticket" but it did not show in Table "ticket". How do I change the schema
file and/or XML file to accomplish what I want?

Any help is welcome.

Yolande
----------------------------
The XML file has the following structure:

<?xml version="1.0" encoding="UTF-8"?>
<thqroot xmlns:eek:d="urn:schemas-microsoft-com:eek:fficedata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ticket.xsd" generated="2004-12-13T13:44:11">
<ticket>
<objname>041201112521482</objname>
<comment>Test ticket</comment>
<title>A remote test</title>
<customer>
<customerid>"21d62206-e1b4-c044-a3cf-5d3ac96b13a0"</customerid>
<customer>Entry Software Corporation</customer>
<departmentname>Technology Division</departmentname>
<fname>Francisco</fname>
<lname>Imperio</lname>
</customer>
</ticket>
</thqroot>

and the corresponding ticket.xsd is:
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:eek:d="urn:schemas-microsoft-com:eek:fficedata">
<xsd:element name="thqroot">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="ticket" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="generated" type="xsd:dateTime" />
</xsd:complexType>
</xsd:element>

<xsd:element name="ticket">
<xsd:annotation>
<xsd:appinfo>
<od:index index-name="PrimaryKey" index-key="objname" primary="yes"
unique="yes" clustered="no"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="objname" minOccurs="0" od:jetType="text"
od:sqlSType="nvarchar">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="255" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>

<xsd:element ref="customer" minOccurs="0" />

<xsd:element name="comment" minOccurs="0" od:jetType="text"
od:sqlSType="nvarchar">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="255" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>

<xsd:element name="title" minOccurs="0" od:jetType="text"
od:sqlSType="nvarchar">
<xsd:simpleType>
<xsd:restriction base="xsd:string"> <xsd:maxLength value="255" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element name="customer">
<xsd:annotation>
<xsd:appinfo>
<od:index index-name="PrimaryKey" index-key="customerid" primary="yes"
unique="yes" clustered="no"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType >
<xsd:sequence>
<xsd:element name="customerid" type="xsd:string"/>
<xsd:element name="customer" type="xsd:string" />
<xsd:element name="departmentname" type="xsd:string" />
<xsd:element name="fname" type="xsd:string" />
<xsd:element name="lname" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>

</xsd:schema>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top