Advertisement

07.04.2007 at 02:57PM PDT, ID: 22675803
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.6

Import XML in Access problem.

Asked by jphendriks in Microsoft Access Database, Extensible Markup Language (XML)

Tags: , ,

I try to import data from XML into Access but it doesn't fulfill my wishes. Consider this XML:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<countries xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="city.xsd">
  <country>
    <code>BR</code>
    <name>Brasil</name>
    <city>
      <name>Brasilia</name>
    </city>
    <city>
      <name>Manaus</name>
    </city>
  </country>
  <country>
    <code>JP</code>
    <name>Japan</name>
    <city>
      <name>Osaka</name>
    </city>
    <city>
      <name>Yokohama</name>
    </city>
    <city>
      <name>Sapporo</name>
    </city>
  </country>
</countries>

I have created this xsd for it:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="countries">
            <xs:complexType>
                  <xs:sequence>
                        <xs:element name="country" type="countryType" maxOccurs="unbounded"/>
                  </xs:sequence>
            </xs:complexType>
      </xs:element>
      <xs:complexType name="countryType">
            <xs:sequence>
                  <xs:element name="code" type="xs:string"/>
                  <xs:element name="name" type="xs:string"/>
                  <xs:element name="city" type="cityType" maxOccurs="unbounded"/>
            </xs:sequence>
      </xs:complexType>
      <xs:complexType name="cityType">
            <xs:sequence>
                  <xs:element name="name" type="xs:string"/>
            </xs:sequence>
      </xs:complexType>
</xs:schema>

Now if I import this into access it will give me a table of countries and a table of cities, but in the table of the cities there is no reference to a country found. Osaka will be in the city table, but there is no record to it's country Japan. This information is implicitly in the xml since the country "Japan" embraces the city "Osaka" but that is not enough to get a reference to Japan in the city table.

Can I get this job done someway by modifying the xsd?

Many thanks for any comment.
JP.
Start Free Trial
[+][-]07.04.2007 at 07:14PM PDT, ID: 19421459

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Access Database, Extensible Markup Language (XML)
Tags: access, xml, import
Sign Up Now!
Solution Provided By: LPurvis
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.04.2007 at 07:34PM PDT, ID: 19421499

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]03.16.2008 at 06:14AM PDT, ID: 21136786

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44