【问题标题】:Jsonix-schema-compiler cannot convert .xsd file to JSON ObjectJsonix-schema-compiler 无法将 .xsd 文件转换为 JSON 对象
【发布时间】:2015-11-27 16:02:42
【问题描述】:

我将一些 .xsd 文件转换为带有 jsonix-schema-compiler 的 JSON 对象,但有一个带有限定命名空间的 .xsd。

无法转换以下 .xsd - 没有错误消息,但也没有生成输出。我尝试将日志输出切换到 TRACE,但这无济于事,因为它什么也不输出。

<?xml version="1.0" encoding="UTF-8"?>
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:ietf:params:xml:ns:lost1" xmlns:p2="http://www.opengis.net/gml" xmlns:ns1="urn:ietf:params:xml:ns:lost1">
  <xs:import namespace="http://www.opengis.net/gml" schemaLocation="p2.xsd"/>
      <xs:element name="findService">
          <xs:complexType>
              <xs:sequence>
                  <xs:element ref="ns1:location"/>
                  <xs:element ref="ns1:service"/>
              </xs:sequence>
              <xs:attribute name="recursive" use="required" type="xs:boolean"/>
              <xs:attribute name="serviceBoundary" use="required" type="xs:NCName"/>
           </xs:complexType>
      </xs:element>
      <xs:element name="location">
          <xs:complexType>
              <xs:sequence>
                  <xs:element ref="p2:Point"/>
              </xs:sequence>
              <xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
              <xs:attribute name="profile" use="required" type="xs:NCName"/>
           </xs:complexType>
       </xs:element>
      <xs:element name="service" type="xs:NMTOKEN"/>
 </xs:schema>

任何想法为什么不能转换?

【问题讨论】:

    标签: json xml xsd jsonix


    【解决方案1】:

    不尝试就很难说。请向我发送带有重现测试用例的拉取请求:

    https://github.com/highsource/jsonix-support/

    以下是此类测试项目的示例:

    https://github.com/highsource/jsonix-support/tree/master/s/shiporder

    免责声明:我是Jsonix的作者。

    【讨论】:

    • 谢谢。刚刚解决了。昨天的 PR 是我的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-12-17
    • 1970-01-01
    • 2016-07-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多