使用XML和XSD创建填充数据库 [英] Using XML and XSD to create a populated database

查看:193
本文介绍了使用XML和XSD创建填充数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道这是否可能,但我想问我是否可以获得任何信息。



如标题所示,我有一个包含数千行的XML文件。我也有它的相关XSD模式文件。



我想知道,是否有可能将这些数据转换为MySQL数据库,而无需手动指定XPath的东西? p>

例如,是否有可能Java或Python或任何程序分析XML结构,基于XSD,提取表列,并填充数据? / p>

我尝试使用PHPMyAdmin导入我的XML文件,但它没有工作,并说有一个问题,我认为是有关的事实,它不能创建列。据我所知,它可以更好地处理CSV文件,这是另一个选项为2阶段转换。



谢谢。

解决方案

使用 XMLImport 将XSD加载到Excel,将CSV或格式保存为所需的XML格式,例如 Wordpress ,然后导入MySQL。


I'm not sure if this is possible, but figured I'd ask and see if I can get any info.

As the title suggests, I have an XML file with thousands of lines. I also have its associated XSD schema file.

I was wondering, is it possible for me to convert this data into a MySQL database without manually specifying the XPath stuff?

For example, is it possible for a Java or Python or whatever program to analyse the XML structure, based on the XSD, extract the table columns, and populate it with data?

I tried using PHPMyAdmin to import my XML file, but it didn't work and said there was a problem, which I think was related to the fact that it couldn't create the columns. As far as I know, it can handle CSV files better, so that's another option for a 2 stage conversion.

Thanks.

解决方案

Use XMLImport to load the XML with XSD into Excel, save as CSV or format into the desired XML format such as Wordpress, then import into MySQL.

这篇关于使用XML和XSD创建填充数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆