我尝试在 nodejs 上使用 JSONIX 并使用 AJV 来验证传入的 XML。
通常我使用这样的东西:
新闻.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>
新闻.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。
亲切的问候
马库斯