0
我嘗試在nodejs上使用JSONIX並使用AJV驗證傳入的XML。JSONIX/AJV:如何使用JSONIX內的Xinclude進行驗證?
通常我用這樣的:
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>
,但現在我會用這個
Author.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模式。
親切的問候
馬庫斯