0

nodejs で JSONIX を使用し、着信 XML の検証に AJV を使用しようとしています。

通常、私は次のようなものを使用します。

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 スキーマさえあります。

敬具

マーカス

4

1 に答える 1

0

Jsonix は現在サポートしていませんxi:include。不可能ではありませんが、実装されていません。したがって、AJV は XML ではなく JS オブジェクト レベルで検証するため、何もできません。

免責事項私は Jsonix の作成者です。

于 2016-12-16T14:20:16.147 に答える