2016-12-15 7 views
0

nodejs에서 JSONIX를 사용하고 들어오는 XML의 유효성 검사에 AJV를 사용하려고합니다.JSONIX/AJV : 유효성 검사를 위해 JSONIX 내부에서 Xinclude를 사용하는 방법?

News.xml :

는 일반적으로 I는 다음과 같이 사용

<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 스키마도 있습니다.

종류

마르쿠스

답변

0

Jsonix 순간에 xi:include을 지원하지 않습니다 간주한다. 불가능한 것은 아니지만 구현되지 않았습니다. 따라서 AJV는 XML이 아닌 JS 객체 수준에서 유효성 검사를 수행하므로 아무 것도 할 수 없습니다.

면책 조항 저는 Jsonix의 저자입니다.