【发布时间】:2010-04-13 16:59:31
【问题描述】:
我想更好地了解获取像此早餐菜单这样的 XML 文档所需的基本步骤...
<?xml version="1.0" encoding="ISO-8859-1"?>
<breakfast_menu>
<food>
<name>Belgian Waffles</name>
<price>$5.95</price>
<description>two of our famous Belgian Waffles with plenty of real maple syrup</description>
<calories>650</calories>
</food>
<food>
<name>Strawberry Belgian Waffles</name>
<price>$7.95</price>
<description>light Belgian waffles covered with strawberries and whipped cream</description>
<calories>900</calories>
</food>
<food>
<name>Berry-Berry Belgian Waffles</name>
<price>$8.95</price>
<description>light Belgian waffles covered with an assortment of fresh berries and whipped cream</description>
<calories>900</calories>
</food>
<food>
<name>French Toast</name>
<price>$4.50</price>
<description>thick slices made from our homemade sourdough bread</description>
<calories>600</calories>
</food>
<food>
<name>Homestyle Breakfast</name>
<price>$6.95</price>
<description>two eggs, bacon or sausage, toast, and our ever-popular hash browns</description>
<calories>950</calories>
</food>
</breakfast_menu>
然后将其“导出”为使用 XSLT 的 Access 或 MySQL 数据库,创建两个连接表:
-
餐桌:早餐菜单
- 字段:menu_item_id
- 字段:food_id
-
餐桌:食物
- 字段:food_id
- 字段:姓名
- 字段:价格
- 字段:说明
- 字段:卡路里
如果您知道有这方面的在线教程,我也会有兴趣了解更多信息。
谢谢。
【问题讨论】:
-
XSLT 可用于为填充表生成必要的 INSERT INTO SQL 命令。但是,提供的 XML 没有任何与
menu_item_id相关的数据 -
您有这个 XSLT 外观的示例吗?
-
呃,有什么原因你不能直接导出,即将你的 MySQL 表链接到 Access 并附加数据?