开发者

Import XML file into Access

I have a bunch of xml documents structured like this:

<projectDescription>
    <name>Project1</name>
    <something else />
    <projects>
        <project>Dependency 1</project>
        <project>Dependency 2</project>
        ...
        <project>Dependency n</project>
    <projects>
    <other stuff I don't care about>
    ...
    </other stuff I don't care about>
</projectDescription>

And I want them to all go into the same access table like this:

Project         Dependency
---------------------------
开发者_开发问答Project1        Dependency 1
Project1        Dependency 2
...
Project1        Dependency n

Then do the same thing, in the same table for each xml file.

There should be one record in the table for every node under

If there are no nodes under there should be one entry with the project name and a null value for the Dependency column.

An automated way of doing this would be great!

Thanks so much!


To do that from Access you'll need to write code using the MSXML library to read the files and extract the information you want. Quite doable, but hardly automatic.

Alternatively, you might want to transform the XML file into something more tractable (a flatter XML file, or even CSV) using an XML Transform (look up XLST) and then loading that (automatically, this time) into Access.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜