问题描述
我需要将 XSD 卸载到 CSV 文件中以构建映射文档.CSV 是 XSD 中定义的所有标签的列表,格式为路径、类型、基数.类似的东西:
I need XSD unloaded into CSV file to build a mapping doc. The CSV is a list of all tags defined in XSD, in format path,type,cardinality. Something like:
tag1/tag2/tag3,E,0..n
tag1/tag2/tag3@attr1,A,0..n
tag1/tag2/tag4,E,1..1
XSD 可能会导入架构.有没有工具可以完成这项任务?谢谢.
XSD may import schemas. Is there a tool to accomplish this task? Thanks.
推荐答案
我已经发布了一个可能的解决方案 这里.如果您愿意尝试,请下载该工具和示例文件;请按照文档进行分步指导.如果您遇到任何问题,请使用网站上的联系信息(支持)给我发送电子邮件.
I've posted a possible solution here. If it is something you're willing to try, then download the tool and the sample files; please follow the document for step by step guidance. If you run into any issues, send me an email using the contact info (support) on the web site.
再次,基数问题非常棘手.我为您准备的示例(所有下载链接都在文档中)是我正在使用的测试用例之一,但我必须为您的文件布局提供一个特定的模板.似乎有争议的一个问题是如何计算 XPath 的值,从 XML Schema 的角度来看,它遍历选择合成器.另一个可能没有太大争议的问题是如何计算重复合成器下粒子的基数等.
The cardinality problem, again, is very tricky. The sample I've prepared for you (all the download links are in the document) is one of the test cases I was using, except that I had to come up with a specific template for your file layout. One issue that seems to be subject to debate is how to calculate the value for XPaths that, from an XML Schema perspective, traverse choice compositors. Another, not so controversial maybe, is how to calculate the cardinality for particles under repeating compositors, etc.
这篇关于XSD 结构到 CSV 作为路径、类型、基数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!