zoukankan      html  css  js  c++  java
  • xml json 互转

    <?xml version="1.0" encoding="UTF-8"?>
    <model name="user_model_1" type="user" priority="1">
        <type>curvilinear</type>
        <traffic_type>bps</traffic_type>
        <points>(0,1),(600,1)</points>
        <time_to_first_iteration>0</time_to_first_iteration>
        <time_between_iteration>0</time_between_iteration>
        <iterations>1</iterations>
    </model>
    {
      "model": {
        "-name": "user_model_1",
        "-type": "user",
        "-priority": "1",
        "type": "curvilinear",
        "traffic_type": "bps",
        "points": "(0,1),(600,1)",
        "time_to_first_iteration": "0",
        "time_between_iteration": "0",
        "iterations": "1"
      }
    }
    {
        "model": {
            "@attributes": {
                "name": "user_model_1",
                "type": "user",
                "priority": "1"
            },
            "type": "curvilinear",
            "traffic_type": "bps",
            "points": "(0,1),(600,1)",
            "time_to_first_iteration": "0",
            "time_between_iteration": "0",
            "iterations": "1"
        }
    }
    <?xml version="1.0" encoding="UTF-8"?>
    <recipe type="dessert">
        <recipename cuisine="american" servings="1">Ice Cream Sundae
        </recipename>
        <ingredlist>
            <listitem>
                <quantity units="cups">0.5</quantity>
                <itemdescription>vanilla ice cream</itemdescription>
            </listitem>
            <listitem>
                <quantity units="tablespoons">3</quantity>
                <itemdescription>chocolate syrup or chocolate fudge</itemdescription>
            </listitem>
            <listitem>
                <quantity units="tablespoons">1</quantity>
                <itemdescription>nuts</itemdescription>
            </listitem>
            <listitem>
                <quantity units="each">1</quantity>
                <itemdescription>cherry</itemdescription>
            </listitem>
        </ingredlist>
        <utensils>
            <listitem>
                <quantity units="each">1</quantity>
                <utensilname>bowl</utensilname>
            </listitem>
            <listitem>
                <quantity units="each">1</quantity>
                <utensilname>spoons</utensilname>
            </listitem>
            <listitem>
                <quantity units="each">1</quantity>
                <utensilname>ice cream scoop</utensilname>
            </listitem>
        </utensils>
        <directions>
            <step>Using ice cream scoop, place vanilla ice cream into bowl.</step>
            <step>Drizzle chocolate syrup or chocolate fudge over the ice cream.
            </step>
            <step>Sprinkle nuts over the mound of chocolate and ice cream.</step>
            <step>Place cherry on top of mound with stem pointing upward.</step>
            <step>Serve.</step>
        </directions>
        <variations>
            <option>Replace nuts with raisins.</option>
            <option>Use chocolate ice cream instead of vanilla ice cream.</option>
        </variations>
        <preptime>5 minutes</preptime>
    </recipe>
    {
      "recipe": {
        "-type": "dessert",
        "recipename": {
          "-cuisine": "american",
          "-servings": "1",
          "#text": "Ice Cream Sundae"
        },
        "ingredlist": {
          "listitem": [
            {
              "quantity": {
                "-units": "cups",
                "#text": "0.5"
              },
              "itemdescription": "vanilla ice cream"
            },
            {
              "quantity": {
                "-units": "tablespoons",
                "#text": "3"
              },
              "itemdescription": "chocolate syrup or chocolate fudge"
            },
            {
              "quantity": {
                "-units": "tablespoons",
                "#text": "1"
              },
              "itemdescription": "nuts"
            },
            {
              "quantity": {
                "-units": "each",
                "#text": "1"
              },
              "itemdescription": "cherry"
            }
          ]
        },
        "utensils": {
          "listitem": [
            {
              "quantity": {
                "-units": "each",
                "#text": "1"
              },
              "utensilname": "bowl"
            },
            {
              "quantity": {
                "-units": "each",
                "#text": "1"
              },
              "utensilname": "spoons"
            },
            {
              "quantity": {
                "-units": "each",
                "#text": "1"
              },
              "utensilname": "ice cream scoop"
            }
          ]
        },
        "directions": {
          "step": [
            "Using ice cream scoop, place vanilla ice cream into bowl.",
            "Drizzle chocolate syrup or chocolate fudge over the ice cream.",
            "Sprinkle nuts over the mound of chocolate and ice cream.",
            "Place cherry on top of mound with stem pointing upward.",
            "Serve."
          ]
        },
        "variations": {
          "option": [
            "Replace nuts with raisins.",
            "Use chocolate ice cream instead of vanilla ice cream."
          ]
        },
        "preptime": "5 minutes"
      }
    }
    {
        "recipe": {
            "@attributes": {
                "type": "dessert"
            },
            "recipename": "Ice Cream Sundae",
            "ingredlist": {
                "listitem": [
                    {
                        "quantity": "0.5",
                        "itemdescription": "vanilla ice cream"
                    },
                    {
                        "quantity": "3",
                        "itemdescription": "chocolate syrup or chocolate fudge"
                    },
                    {
                        "quantity": "1",
                        "itemdescription": "nuts"
                    },
                    {
                        "quantity": "1",
                        "itemdescription": "cherry"
                    }
                ]
            },
            "utensils": {
                "listitem": [
                    {
                        "quantity": "1",
                        "utensilname": "bowl"
                    },
                    {
                        "quantity": "1",
                        "utensilname": "spoons"
                    },
                    {
                        "quantity": "1",
                        "utensilname": "ice cream scoop"
                    }
                ]
            },
            "directions": {
                "step": [
                    "Using ice cream scoop, place vanilla ice cream into bowl.",
                    "Drizzle chocolate syrup or chocolate fudge over the ice cream.",
                    "Sprinkle nuts over the mound of chocolate and ice cream.",
                    "Place cherry on top of mound with stem pointing upward.",
                    "Serve."
                ]
            },
            "variations": {
                "option": [
                    "Replace nuts with raisins.",
                    "Use chocolate ice cream instead of vanilla ice cream."
                ]
            },
            "preptime": "5 minutes"
        }
    }
  • 相关阅读:
    thinkphp5自定义sql排序
    php版雪花算法生产唯一ID 分库分表专用
    java和php保持一致的md5加密
    rabbitmq新版本使用
    pentaho-kettle+eclipse 搭建本地源码
    《我们好像在哪见过》
    《邂逅》-----徐志摩
    Oracle数据库查询和取出表中重复记录
    Kettle提取数据,数据库中文字符乱码问题
    kettle报错收集- java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@160750a6 is still active
  • 原文地址:https://www.cnblogs.com/zouhao510/p/5167719.html
Copyright © 2011-2022 走看看