Using XML and XSD to create a populated database(使用 XML 和 XSD 创建填充数据库)
问题描述
我不确定这是否可能,但我想我会问一下,看看我能不能得到任何信息.
I'm not sure if this is possible, but figured I'd ask and see if I can get any info.
正如标题所示,我有一个包含数千行的 XML 文件.我也有其关联的 XSD 架构文件.
As the title suggests, I have an XML file with thousands of lines. I also have its associated XSD schema file.
我想知道,我是否可以在不手动指定 XPath 的情况下将这些数据转换为 MySQL 数据库?
I was wondering, is it possible for me to convert this data into a MySQL database without manually specifying the XPath stuff?
例如,Java 或 Python 或任何程序是否可以基于 XSD 分析 XML 结构、提取表列并用数据填充它?
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?
我尝试使用 PHPMyAdmin 导入我的 XML 文件,但它不起作用并说有问题,我认为这与它无法创建列有关.据我所知,它可以更好地处理 CSV 文件,因此这是 2 阶段转换的另一种选择.
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.
谢谢.
推荐答案
使用 XMLImport 将带有 XSD 的 XML 加载到 Excel 中,另存为 CSV 或格式化为所需的 XML 格式,例如 Wordpress,然后导入 MySQL.
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 创建填充数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 XML 和 XSD 创建填充数据库


- 更改自动增量起始编号? 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- SQL 临时表问题 2022-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01