码迷,mamicode.com
首页 > 其他好文 > 详细

xml转map

时间:2016-08-22 21:41:20      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:

原始xml

<?xml version="1.0" encoding="UTF-8"?>
<PACKET type="REQUEST" version="1.0">
  <HEAD>
    <CDataSource>02</CDataSource>
    <SERVICE_NO>2300000001</SERVICE_NO>
  </HEAD>
  <BODY>
    <BASE>
      <PLY_APP_NO />
      <PROD_NO>0355</PROD_NO>
      <SALES_CHANNEL>19001</SALES_CHANNEL>
      <ORIG_FLG>0</ORIG_FLG>
      <DPT_CDE>37150107</DPT_CDE>
      <SLS_CDE>137511499</SLS_CDE>
      <SALEGRP_CDE>37150107002</SALEGRP_CDE>
     
    </BASE>
    <VHL>
      <BLD_YEAR />
      <BRND_CDE>HGD1046TJF</BRND_CDE>
      <BRND_NME>丰田TV7160GMD轿车</BRND_NME>
      <CAR_COLOUR />
      <TFI_REF_CDE2>HGD1046TJF</TFI_REF_CDE2>
      <CONFIRM_CDE />
      <OWNER_NAME>土豪金</OWNER_NAME>
      <ECDEMIC_VEHICLE_FLAG>0</ECDEMIC_VEHICLE_FLAG>
      <ENGINE_NO>TUHAOOUBA20151217</ENGINE_NO>
      <DISPLACEMENT>1.598</DISPLACEMENT>
      <USE_TYPE>345038001</USE_TYPE>
      <VEHICLE_REGISTER_DATE>2015-06-10</VEHICLE_REGISTER_DATE>
      <CAR_MARK>*</CAR_MARK>
      <VEHICLE_TYPE />
      <PO_CATEGORY />
      <QUERY_CDE>V0101ZSIC370015001450333914032</QUERY_CDE>
      <RGN_CDE>002</RGN_CDE>
      <USE_YEAR_CDE>345020001</USE_YEAR_CDE>
      <VHL_BRAND />
      <RACK_NO>LFMAP22CUBA201512</RACK_NO>
      <VEHICLE_CATEGORY>345039001</VEHICLE_CATEGORY>
      <VIN />
      <COLOUR />
      <SEC_CDE />
      <RELATIONSHIP_WITH_VEHICLE>348001</RELATIONSHIP_WITH_VEHICLE>
      <MADIN_CDE>34503601</MADIN_CDE>
      <DEPRECIATION_COEFFICIENT />
      <MODELS_CONFIRMATION />
      <BRAND_MODEL>丰田TV7160GMD轿车</BRAND_MODEL>
      <EXTENDED_AREA_RADIUS />
      <PROPORTION_AGREEMENT />
      <TRAVEL_AREA_DESCRIPTION />
      <VHL_GALSS>303011001</VHL_GALSS>
      <INSURANCE_LAST_YEAR />
      <LIABILITY_AMOUNT />
      <LAST_YEAR_POLICY_NO />
      <ARE_TEAM>0</ARE_TEAM>
      <VEHICLE_STYLE>345041087</VEHICLE_STYLE>
      <LOAN_CAR_FLAG>0</LOAN_CAR_FLAG>
      <TRANSFER_VEHICLE_LOGO>0</TRANSFER_VEHICLE_LOGO>
      <FLEET_NO />
      <NO_DAMAGE_YEARS />
      <LIMIT_LOAD_PERSON>5</LIMIT_LOAD_PERSON>
      <LIMIT_LOAD />
      <NEWVHL_VAL>93800</NEWVHL_VAL>
      <SUM_INSURED_TYPE>01</SUM_INSURED_TYPE>
      <PACK />
      <MODELS_ORIGINAL_PRICE>90423</MODELS_ORIGINAL_PRICE>
      <CHK_CDE />
      <CHECK_MAN />
      <CHECK_TIME />
      <CHK_REC />
      <DEV_CDE />
      <VEHICLE_MODEL>丰田TV7160GMD轿车</VEHICLE_MODEL>
      <NEW_FLAG>1</NEW_FLAG>
      <CERTIFICATE_DATE />
      <OWNER_TYPE>1</OWNER_TYPE>
      <VHL_QUE_NO />
      <POWER />
      <TRANSFER_DATE />
      <MAINTENANCE_FACTOR />
      <PRECON_CDE />
      <MODEL_CDE>BTJHHIUB0005</MODEL_CDE>
      <AREA_CDE />
    </VHL>
    
    <COVERAGE_LIST>
      <COVERAGE>
        <INSRNC_CDE>035001</INSRNC_CDE>
        <DEDUCTIBLE_CONVENTION>345021001</DEDUCTIBLE_CONVENTION>
        <LIMIT_AMOUNT />
        <OPTIONAL_DI_DE />
        <INSURED>90423.2</INSURED>
        <BASE_PRM>0</BASE_PRM>
        <BEF_PRM>1980.72</BEF_PRM>
        <STANDARD_PREMIUM>1431.07</STANDARD_PREMIUM>
        <RATE />
        <SERIAL_NO>0</SERIAL_NO>
        <N_SEATS />
        <REFERENCE_PREMIUNS />
        <CANCEL_MARK />
        <RISK_PRM>1287.47</RISK_PRM>
        <RISK_PRM_FLAG>1</RISK_PRM_FLAG>
        <DEDUCTIBLES_COET />
      </COVERAGE>
      <COVERAGE>
        <INSRNC_CDE>035002</INSRNC_CDE>
        <DEDUCTIBLE_CONVENTION>345021001</DEDUCTIBLE_CONVENTION>
        <LIMIT_AMOUNT>345012005</LIMIT_AMOUNT>
        <OPTIONAL_DI_DE />
        <INSURED />
        <BASE_PRM>932</BASE_PRM>
        <BEF_PRM>1434</BEF_PRM>
        <STANDARD_PREMIUM>1036.07</STANDARD_PREMIUM>
        <RATE />
        <SERIAL_NO>1</SERIAL_NO>
        <N_SEATS />
        <REFERENCE_PREMIUNS />
        <CANCEL_MARK />
        <RISK_PRM />
        <RISK_PRM_FLAG />
        <DEDUCTIBLES_COET />
      </COVERAGE>
      <COVERAGE>
        <INSRNC_CDE>035003</INSRNC_CDE>
        <DEDUCTIBLE_CONVENTION>345021001</DEDUCTIBLE_CONVENTION>
        <LIMIT_AMOUNT />
        <OPTIONAL_DI_DE />
        <INSURED>10000</INSURED>
        <BASE_PRM>0</BASE_PRM>
        <BEF_PRM>42</BEF_PRM>
        <STANDARD_PREMIUM>30.35</STANDARD_PREMIUM>
        <RATE>2.73</RATE>
        <SERIAL_NO>3</SERIAL_NO>
        <N_SEATS>1</N_SEATS>
        <REFERENCE_PREMIUNS />
        <CANCEL_MARK />
        <RISK_PRM />
        <RISK_PRM_FLAG />
        <DEDUCTIBLES_COET />
      </COVERAGE>
      <COVERAGE>
        <INSRNC_CDE>035004</INSRNC_CDE>
        <DEDUCTIBLE_CONVENTION>345021001</DEDUCTIBLE_CONVENTION>
        <LIMIT_AMOUNT />
        <OPTIONAL_DI_DE />
        <INSURED>10000</INSURED>
        <BASE_PRM>0</BASE_PRM>
        <BEF_PRM>108</BEF_PRM>
        <STANDARD_PREMIUM>78.03</STANDARD_PREMIUM>
        <RATE>1.755</RATE>
        <SERIAL_NO>4</SERIAL_NO>
        <N_SEATS>4</N_SEATS>
        <REFERENCE_PREMIUNS />
        <CANCEL_MARK />
        <RISK_PRM />
        <RISK_PRM_FLAG />
        <DEDUCTIBLES_COET />
      </COVERAGE>
      <COVERAGE>
        <INSRNC_CDE>035005</INSRNC_CDE>
        <DEDUCTIBLE_CONVENTION>345021001</DEDUCTIBLE_CONVENTION>
        <LIMIT_AMOUNT />
        <OPTIONAL_DI_DE />
        <INSURED>90423.2</INSURED>
        <BASE_PRM>78</BASE_PRM>
        <BEF_PRM>563.07</BEF_PRM>
        <STANDARD_PREMIUM>406.82</STANDARD_PREMIUM>
        <RATE>3.185</RATE>
        <SERIAL_NO>2</SERIAL_NO>
        <N_SEATS />
        <REFERENCE_PREMIUNS />
        <CANCEL_MARK />
        <RISK_PRM />
        <RISK_PRM_FLAG />
        <DEDUCTIBLES_COET />
      </COVERAGE>
      <COVERAGE>
        <INSRNC_CDE>035104</INSRNC_CDE>
        <DEDUCTIBLE_CONVENTION />
        <LIMIT_AMOUNT />
        <OPTIONAL_DI_DE />
        <INSURED />
        <BASE_PRM>0</BASE_PRM>
        <BEF_PRM>178.22</BEF_PRM>
        <STANDARD_PREMIUM>128.76</STANDARD_PREMIUM>
        <RATE>1.235</RATE>
        <SERIAL_NO>7</SERIAL_NO>
        <N_SEATS />
        <REFERENCE_PREMIUNS />
        <CANCEL_MARK />
        <RISK_PRM />
        <RISK_PRM_FLAG />
        <DEDUCTIBLES_COET />
      </COVERAGE>
      <COVERAGE>
        <INSRNC_CDE>035801</INSRNC_CDE>
        <DEDUCTIBLE_CONVENTION />
        <LIMIT_AMOUNT />
        <OPTIONAL_DI_DE />
        <INSURED />
        <BASE_PRM>0</BASE_PRM>
        <BEF_PRM>297.11</BEF_PRM>
        <STANDARD_PREMIUM>214.66</STANDARD_PREMIUM>
        <RATE />
        <SERIAL_NO>20</SERIAL_NO>
        <N_SEATS />
        <REFERENCE_PREMIUNS />
        <CANCEL_MARK />
        <RISK_PRM />
        <RISK_PRM_FLAG />
        <DEDUCTIBLES_COET />
      </COVERAGE>
      <COVERAGE>
        <INSRNC_CDE>035802</INSRNC_CDE>
        <DEDUCTIBLE_CONVENTION />
        <LIMIT_AMOUNT />
        <OPTIONAL_DI_DE />
        <INSURED />
        <BASE_PRM>0</BASE_PRM>
        <BEF_PRM>215.1</BEF_PRM>
        <STANDARD_PREMIUM>155.41</STANDARD_PREMIUM>
        <RATE />
        <SERIAL_NO>21</SERIAL_NO>
        <N_SEATS />
        <REFERENCE_PREMIUNS />
        <CANCEL_MARK />
        <RISK_PRM />
        <RISK_PRM_FLAG />
        <DEDUCTIBLES_COET />
      </COVERAGE>
      <COVERAGE>
        <INSRNC_CDE>035803</INSRNC_CDE>
        <DEDUCTIBLE_CONVENTION />
        <LIMIT_AMOUNT />
        <OPTIONAL_DI_DE />
        <INSURED />
        <BASE_PRM>0</BASE_PRM>
        <BEF_PRM>6.3</BEF_PRM>
        <STANDARD_PREMIUM>4.55</STANDARD_PREMIUM>
        <RATE />
        <SERIAL_NO>22</SERIAL_NO>
        <N_SEATS />
        <REFERENCE_PREMIUNS />
        <CANCEL_MARK />
        <RISK_PRM />
        <RISK_PRM_FLAG />
        <DEDUCTIBLES_COET />
      </COVERAGE>
      <COVERAGE>
        <INSRNC_CDE>035804</INSRNC_CDE>
        <DEDUCTIBLE_CONVENTION />
        <LIMIT_AMOUNT />
        <OPTIONAL_DI_DE />
        <INSURED />
        <BASE_PRM>0</BASE_PRM>
        <BEF_PRM>16.2</BEF_PRM>
        <STANDARD_PREMIUM>11.7</STANDARD_PREMIUM>
        <RATE />
        <SERIAL_NO>23</SERIAL_NO>
        <N_SEATS />
        <REFERENCE_PREMIUNS />
        <CANCEL_MARK />
        <RISK_PRM />
        <RISK_PRM_FLAG />
        <DEDUCTIBLES_COET />
      </COVERAGE>
      <COVERAGE>
        <INSRNC_CDE>035805</INSRNC_CDE>
        <DEDUCTIBLE_CONVENTION />
        <LIMIT_AMOUNT />
        <OPTIONAL_DI_DE />
        <INSURED />
        <BASE_PRM>0</BASE_PRM>
        <BEF_PRM>112.61</BEF_PRM>
        <STANDARD_PREMIUM>81.36</STANDARD_PREMIUM>
        <RATE />
        <SERIAL_NO>24</SERIAL_NO>
        <N_SEATS />
        <REFERENCE_PREMIUNS />
        <CANCEL_MARK />
        <RISK_PRM />
        <RISK_PRM_FLAG />
        <DEDUCTIBLES_COET />
      </COVERAGE>
    </COVERAGE_LIST>
  </BODY>
</PACKET>


            
                                                                                                                                                                                                                                                                                                                                                                                                                                  

转成map后打印如下 :

{
  BODY={
    BASE={
      PLY_APP_NO=,
      DPT_CDE=37150107,
      PROD_NO=0355,
      SALEGRP_CDE=37150107002,
      ORIG_FLG=0,
      SLS_CDE=137511499,
      SALES_CHANNEL=19001
    },
    COVERAGE_LIST={
      COVERAGE=[
        {
          DEDUCTIBLES_COET=,
          BASE_PRM=0,
          RATE=,
          LIMIT_AMOUNT=,
          INSURED=90423.2,
          DEDUCTIBLE_CONVENTION=345021001,
          INSRNC_CDE=035001,
          RISK_PRM_FLAG=1,
          CANCEL_MARK=,
          N_SEATS=,
          BEF_PRM=1980.72,
          REFERENCE_PREMIUNS=,
          SERIAL_NO=0,
          STANDARD_PREMIUM=1431.07,
          OPTIONAL_DI_DE=,
          RISK_PRM=1287.47
        },
        {
          DEDUCTIBLES_COET=,
          BASE_PRM=932,
          RATE=,
          LIMIT_AMOUNT=345012005,
          INSURED=,
          DEDUCTIBLE_CONVENTION=345021001,
          INSRNC_CDE=035002,
          RISK_PRM_FLAG=,
          CANCEL_MARK=,
          N_SEATS=,
          BEF_PRM=1434,
          REFERENCE_PREMIUNS=,
          SERIAL_NO=1,
          STANDARD_PREMIUM=1036.07,
          OPTIONAL_DI_DE=,
          RISK_PRM=
        },
        {
          DEDUCTIBLES_COET=,
          BASE_PRM=0,
          RATE=2.73,
          LIMIT_AMOUNT=,
          INSURED=10000,
          DEDUCTIBLE_CONVENTION=345021001,
          INSRNC_CDE=035003,
          RISK_PRM_FLAG=,
          CANCEL_MARK=,
          N_SEATS=1,
          BEF_PRM=42,
          REFERENCE_PREMIUNS=,
          SERIAL_NO=3,
          STANDARD_PREMIUM=30.35,
          OPTIONAL_DI_DE=,
          RISK_PRM=
        },
        {
          DEDUCTIBLES_COET=,
          BASE_PRM=0,
          RATE=1.755,
          LIMIT_AMOUNT=,
          INSURED=10000,
          DEDUCTIBLE_CONVENTION=345021001,
          INSRNC_CDE=035004,
          RISK_PRM_FLAG=,
          CANCEL_MARK=,
          N_SEATS=4,
          BEF_PRM=108,
          REFERENCE_PREMIUNS=,
          SERIAL_NO=4,
          STANDARD_PREMIUM=78.03,
          OPTIONAL_DI_DE=,
          RISK_PRM=
        },
        {
          DEDUCTIBLES_COET=,
          BASE_PRM=78,
          RATE=3.185,
          LIMIT_AMOUNT=,
          INSURED=90423.2,
          DEDUCTIBLE_CONVENTION=345021001,
          INSRNC_CDE=035005,
          RISK_PRM_FLAG=,
          CANCEL_MARK=,
          N_SEATS=,
          BEF_PRM=563.07,
          REFERENCE_PREMIUNS=,
          SERIAL_NO=2,
          STANDARD_PREMIUM=406.82,
          OPTIONAL_DI_DE=,
          RISK_PRM=
        },
        {
          DEDUCTIBLES_COET=,
          BASE_PRM=0,
          RATE=1.235,
          LIMIT_AMOUNT=,
          INSURED=,
          DEDUCTIBLE_CONVENTION=,
          INSRNC_CDE=035104,
          RISK_PRM_FLAG=,
          CANCEL_MARK=,
          N_SEATS=,
          BEF_PRM=178.22,
          REFERENCE_PREMIUNS=,
          SERIAL_NO=7,
          STANDARD_PREMIUM=128.76,
          OPTIONAL_DI_DE=,
          RISK_PRM=
        },
        {
          DEDUCTIBLES_COET=,
          BASE_PRM=0,
          RATE=,
          LIMIT_AMOUNT=,
          INSURED=,
          DEDUCTIBLE_CONVENTION=,
          INSRNC_CDE=035801,
          RISK_PRM_FLAG=,
          CANCEL_MARK=,
          N_SEATS=,
          BEF_PRM=297.11,
          REFERENCE_PREMIUNS=,
          SERIAL_NO=20,
          STANDARD_PREMIUM=214.66,
          OPTIONAL_DI_DE=,
          RISK_PRM=
        },
        {
          DEDUCTIBLES_COET=,
          BASE_PRM=0,
          RATE=,
          LIMIT_AMOUNT=,
          INSURED=,
          DEDUCTIBLE_CONVENTION=,
          INSRNC_CDE=035802,
          RISK_PRM_FLAG=,
          CANCEL_MARK=,
          N_SEATS=,
          BEF_PRM=215.1,
          REFERENCE_PREMIUNS=,
          SERIAL_NO=21,
          STANDARD_PREMIUM=155.41,
          OPTIONAL_DI_DE=,
          RISK_PRM=
        },
        {
          DEDUCTIBLES_COET=,
          BASE_PRM=0,
          RATE=,
          LIMIT_AMOUNT=,
          INSURED=,
          DEDUCTIBLE_CONVENTION=,
          INSRNC_CDE=035803,
          RISK_PRM_FLAG=,
          CANCEL_MARK=,
          N_SEATS=,
          BEF_PRM=6.3,
          REFERENCE_PREMIUNS=,
          SERIAL_NO=22,
          STANDARD_PREMIUM=4.55,
          OPTIONAL_DI_DE=,
          RISK_PRM=
        },
        {
          DEDUCTIBLES_COET=,
          BASE_PRM=0,
          RATE=,
          LIMIT_AMOUNT=,
          INSURED=,
          DEDUCTIBLE_CONVENTION=,
          INSRNC_CDE=035804,
          RISK_PRM_FLAG=,
          CANCEL_MARK=,
          N_SEATS=,
          BEF_PRM=16.2,
          REFERENCE_PREMIUNS=,
          SERIAL_NO=23,
          STANDARD_PREMIUM=11.7,
          OPTIONAL_DI_DE=,
          RISK_PRM=
        },
        {
          DEDUCTIBLES_COET=,
          BASE_PRM=0,
          RATE=,
          LIMIT_AMOUNT=,
          INSURED=,
          DEDUCTIBLE_CONVENTION=,
          INSRNC_CDE=035805,
          RISK_PRM_FLAG=,
          CANCEL_MARK=,
          N_SEATS=,
          BEF_PRM=112.61,
          REFERENCE_PREMIUNS=,
          SERIAL_NO=24,
          STANDARD_PREMIUM=81.36,
          OPTIONAL_DI_DE=,
          RISK_PRM=
        }
      ]
    },
    VHL={
      VEHICLE_CATEGORY=345039001,
      EXTENDED_AREA_RADIUS=,
      CAR_MARK=*,
      PRECON_CDE=,
      VEHICLE_MODEL=丰田TV7160GMD轿车,
      CHK_REC=,
      BRND_NME=丰田TV7160GMD轿车,
      VEHICLE_REGISTER_DATE=2015-06-10,
      PO_CATEGORY=,
      LIMIT_LOAD=,
      OWNER_NAME=土豪金,
      RELATIONSHIP_WITH_VEHICLE=348001,
      ENGINE_NO=TUHAOOUBA20151217,
      USE_TYPE=345038001,
      CHK_CDE=,
      LAST_YEAR_POLICY_NO=,
      NO_DAMAGE_YEARS=,
      FLEET_NO=,
      AREA_CDE=,
      VHL_GALSS=303011001,
      VHL_BRAND=,
      CHECK_TIME=,
      CHECK_MAN=,
      TRANSFER_VEHICLE_LOGO=0,
      NEW_FLAG=1,
      MODEL_CDE=BTJHHIUB0005,
      BLD_YEAR=,
      ARE_TEAM=0,
      BRND_CDE=HGD1046TJF,
      OWNER_TYPE=1,
      DEPRECIATION_COEFFICIENT=,
      COLOUR=,
      VHL_QUE_NO=,
      VEHICLE_STYLE=345041087,
      BRAND_MODEL=丰田TV7160GMD轿车,
      USE_YEAR_CDE=345020001,
      SUM_INSURED_TYPE=01,
      PROPORTION_AGREEMENT=,
      VIN=,
      CAR_COLOUR=,
      TRAVEL_AREA_DESCRIPTION=,
      QUERY_CDE=V0101ZSIC370015001450333914032,
      SEC_CDE=,
      CONFIRM_CDE=,
      NEWVHL_VAL=93800,
      TRANSFER_DATE=,
      POWER=,
      MODELS_ORIGINAL_PRICE=90423,
      DISPLACEMENT=1.598,
      MODELS_CONFIRMATION=,
      MADIN_CDE=34503601,
      RGN_CDE=002,
      LIABILITY_AMOUNT=,
      CERTIFICATE_DATE=,
      ECDEMIC_VEHICLE_FLAG=0,
      INSURANCE_LAST_YEAR=,
      LIMIT_LOAD_PERSON=5,
      MAINTENANCE_FACTOR=,
      LOAN_CAR_FLAG=0,
      VEHICLE_TYPE=,
      PACK=,
      TFI_REF_CDE2=HGD1046TJF,
      RACK_NO=LFMAP22CUBA201512,
      DEV_CDE=
    }
  },
  HEAD={
    SERVICE_NO=2300000001,
    CDataSource=02
  }
}

 

xml转map

标签:

原文地址:http://www.cnblogs.com/bobo1713930654/p/5796991.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!