0

我对 Talend 非常陌生,并试图解决我当前项目中的需求。我需要比较来自两个不同来源的 XSD 和 JSON 元数据,如果这些元数据匹配,则输出一个 XLS 文件。如果你有类似的需求,你能给我一些建议吗?

这是 XSD 示例 -

        <?xml version="1.0" encoding="UTF-8"?>
     <xs:schema elementFormDefault="qualified" targetNamespace="myNamespace/TroubleTicketCountResponse.xsd" version="214.0.00" xmlns="myNamespace/TroubleTicketCountResponse.xsd"  xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="TicketCountResponse" type="TicketCountResponseInfo"/>
      <xs:complexType name="TicketCountResponseInfo">
        <xs:annotation>
          <xs:documentation>Retrieves Ticket counts</xs:documentation>
        </xs:annotation>
        <xs:sequence>
           <xs:element minOccurs="0" name="addressId">
                  <xs:annotation>
                    <xs:documentation>Location Id</xs:documentation>
                  </xs:annotation>
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:maxLength value="30"/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:element>
                <xs:element minOccurs="0" name="organizationId" type="xs:int">
                  <xs:annotation>
                    <xs:documentation>Organization Identifier</xs:documentation>
                  </xs:annotation>
                </xs:element>
                <xs:element minOccurs="0" name="assetId">
                  <xs:annotation>
                    <xs:documentation>CircuitId</xs:documentation>
                  </xs:annotation>
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:maxLength value="20"/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:element>
                <xs:element minOccurs="0" name="assetKey">
                  <xs:annotation>
                    <xs:documentation>AssetId</xs:documentation>
                  </xs:annotation>
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:maxLength value="30"/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:element>
                <xs:element minOccurs="0" name="accountOrganizationId" type="xs:string">
                  <xs:annotation>
                    <xs:documentation>accountOrganizationid</xs:documentation>
                  </xs:annotation>
                </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>

这是 JSON 模式示例 -

"title": "CustomerTroubleTicketCount",
"description": "Retrieves Ticket counts",
"type": "object",
"properties": {
    "addressId": {
        "description": "replacement for Location Id",
        "type": "string"
    },
    "organizationId": {
        "description": "Organization Identifier",
        "type": "number"
    },
    "assetId": {
        "description": "Circuit Id",
        "type": "string",
    }
},
    "assetKey": {
        "description": "AssetId can be serial circuit/CLCI",
        "type": "string",
    }
},
    "accountOrganizationId": {
        "description": "accountOrganizationid",
        "type": "string",
    }
}

谢谢, 苏维克

4

0 回答 0