在VBA中使用XSD的Excel到XML [英] Excel to XML using XSD in VBA
问题描述
我想通过编写VB宏将Excel工作表转换为XML格式。
此功能在Office 2010中可用,您可以在Excel工作表中映射XSD文件,然后单击导出XML以获取XML文件,但它适用于简单和非重复的嵌套标记。
我有一个复杂的模式定义(XSD),它在根标记下有重复的标记。在这种情况下,Office的内置功能不起作用。
有谁能告诉我如何使用内置功能完成这项工作?
或
是否有VB宏可用于此?
我用google搜索但只能找到C#代码。
请帮助!!
Hi,
I want to convert an excel sheet to XML using XSD by writing a VB Macro.
This feature is available in Office 2010 where you can map a XSD file in an excel sheet and click on export XML to get an XML file but it works for simple and non-repetitive nested tags.
I have a complex schema definition (XSD) which has repetitive tags under the root tag. In this case, the in-built feature of Office does not work.
Can anyone please let me know how this can be done using the in-built feature ?
Or
Is there any VB macro avaialble for this ?
I googled out but could find C# code only.
Please help !!
推荐答案
CP知识库:
将Excel转换为XML文件/ XML架构,并根据XML架构验证Excel [ ^ ]
Google with:使用xsd msdn的VBA Excel到xml
句子返回(几个示例链接):
http://stackoverflow.com/questions/11708492/msxml-vba-validating-xml-against-xsd-the-namespace-provided-differs-from-t [< a href =http://stackoverflow.com/questions/11708492/msxml-vba-validating-xml-against-xsd-the-namespace-provided-differs-from-ttarget =_ blanktitle =New Window > ^ ]
http://social.msdn.microsoft.com/Forums/en-US/exceldev/thread/1722e225-f788-4b05-87f5-338eb532be1d/ [ ^ ]
http://stackoverflow.com/questions/11305/how- to-parse-xml-in-vba [ ^ ]
http://blogs.msdn.com/b/johnrdurant/archive/2010/01/29/ excel-2010-xml-maps.aspx [ ^ ]
CP Knowledge base:
Convert Excel to XML file/XML Schema, and validate Excel against XML Schema[^]
Google with:VBA Excel to xml using xsd msdn
sentence returns (few example links):
http://stackoverflow.com/questions/11708492/msxml-vba-validating-xml-against-xsd-the-namespace-provided-differs-from-t[^]
http://social.msdn.microsoft.com/Forums/en-US/exceldev/thread/1722e225-f788-4b05-87f5-338eb532be1d/[^]
http://stackoverflow.com/questions/11305/how-to-parse-xml-in-vba[^]
http://blogs.msdn.com/b/johnrdurant/archive/2010/01/29/excel-2010-xml-maps.aspx[^]
这篇关于在VBA中使用XSD的Excel到XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!