【问题标题】:JSONIX / AJV: how to use Xinclude inside JSONIX for validation?JSONIX / AJV:如何在 JSONIX 中使用 Xinclude 进行验证?
【发布时间】: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


    【解决方案1】:

    Jsonix 目前不支持xi:include。这不是不可能的,但没有实施。因此 AJV 也无法做任何事情,因为它在 JS 对象级别而不是 XML 上进行验证。

    免责声明我是 Jsonix 的作者。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多