简体   繁体   English

如何识别数据格式

[英]How to recognize data format

I have same type of data in two format but I not sure which format they are.我有两种格式的相同类型的数据,但我不确定它们是哪种格式。

Data format 1数据格式1

{
  "ArraytionGroup": {
    "-xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
    "-xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
    "LocationGroup": [
      {
        "Id": "6",
        "Uuid": "894055b6-971ecc0c7224",
        "Name": {
          "-xmlns": "http://www.air-watch.com/servicemodel/resources",
          "#text": "gtg"
        },
        "GroupId": { "-xmlns": "http://www.air-watch.com/servicemodel/resources" },
        "LocationGroupType": {
          "-xmlns": "http://www.air-watch.com/servicemodel/resources",
          "#text": "C"
        },
        "Country": {
          "-xmlns": "http://www.air-watch.com/servicemodel/resources",
          "#text": "s"
        },
        "Locale": {
          "-xmlns": "http://www.air-watch.com/servicemodel/resources",
          "#text": "kk"
        },
        "ParentLocationGroup": {
          "-xmlns": "http://www.air-watch.com/servicemodel/resources",
          "-uuid": "bdce439362",
          "#text": "70"
        },
        "CreatedOn": {
          "-xmlns": "http://www.air-watch.com/servicemodel/resources",
          "#text": "2/21/2018 3:08:55 PM"
        },
}

Data format 2数据格式2

<?xml version="1.0" encoding="utf-8" ?>
<SarttGroupSe xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.air-watch.com/servicemodel/resources">
    <Page>0</Page>
    <PageSize>500</PageSize>
    <Total>61</Total>
    <LocationGroups>
        <Id xmlns="">655</Id>
        <Name>EDX</Name>
        <GroupId>DDDD</GroupId>
        <LocationGroupType>Container</LocationGroupType>
        <Country/>
        <Locale/>
        <Users>0</Users>
        <Admins>0</Admins>
        <Devices>0</Devices>
    </LocationGroups>
    <LocationGroups>
        <Id xmlns="">2</Id>
        <Name>EE</Name>
        <GroupId>New</GroupId>
        <LocationGroupType>C</LocationGroupType>
        <Country/>
        <Locale/>
        <Users>0</Users>
        <Admins>0</Admins>
        <Devices>0</Devices>
    </LocationGroups>
    <LocationGroups>
        <Id xmlns="">6</Id>
        <Name>RAC</Name>
        <LocationGroupType>Ciner</LocationGroupType>
        <Country/>
        <Locale/>
        <Users>0</Users>
        <Admins>0</Admins>
        <Devices>0</Devices>
    </LocationGroups>
</SarttGroupSe>

What format these data can anyone help me out?任何人都可以帮助我解决这些数据的格式吗?

JSON objects are surrounded by curly braces {}. JSON 对象被花括号 {} 包围。

JSON objects are written in key/value pairs. JSON 对象以键/值对形式写入。

Keys must be strings, and values must be a valid JSON data type (string, number, object, array, boolean or null).键必须是字符串,值必须是有效的 JSON 数据类型(字符串、数字、object、数组、boolean 或 null)。

example { "name":"John", "age":30, "car":null } then your first example is a json object validate your first example in json validator example { "name":"John", "age":30, "car":null } then your first example is a json object validate your first example in json validator

The Element object represents an element in an XML document.元素 object 表示 XML 文档中的元素。 Elements may contain attributes, other elements, or text.元素可能包含属性、其他元素或文本。 If an element contains text, the text is represented in a text-node.如果元素包含文本,则文本将在文本节点中表示。

example <year>2005</year> then your second example is a xml object例如<year>2005</year>那么你的第二个例子是 xml object

try your second example in xml validatorxml 验证器中尝试第二个示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM