【发布时间】:2016-12-15 15:57:25
【问题描述】:
我尝试在 nodejs 上使用 JSONIX 并使用 AJV 来验证传入的 XML。
通常我使用这样的东西:
News.xml:
<news xmlns="http://news24.tt/news">
<publisher>
<author>Max Mustermann</author>
<company>NEWS24</company>
<resort>Sports</resort>
</publisher>
<topic>HSV wins against FCB!</topic>
<article>Bla bla ... </article>
</news>
但现在我会用这个
作者.xml:
<publisher xmlns="http://news24.tt/news">
<author>Max Mustermann</author>
<company>NEWS24</company>
<resort>Sports</resort>
</publisher>
News.xml:
<news xmlns="http://news24.tt/news" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="Author.xml" />
<topic>HSV wins against FCB!</topic>
<article>Bla bla ... </article>
</news>
是否可以使用 JSONIX 和 AJV 来验证此类结构? 我什至有一个 XSD 和生成的 JSON-Schema。
亲切的问候
马库斯
【问题讨论】:
标签: json node.js xml xinclude jsonix