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 创建填充数据库
基础教程推荐
- 在 SQL 中连接多个表 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- 无法解决整理冲突 2021-01-01
