现在我有一个字符串,长的很像xml,但是它就是个字符串,现在我要像xml那样,取得里面的值,我该怎么做?
能直接把字符串对象转换成xml对象吗?
- XML code
<root> <ENTRY NO_CHECK="Y" OFF_BALANCE="N"> <C_CUST_ID FV_TYPE="F"/> <DO condition="" name="ChgOutForm" path="ChgOutForm"/> <D_BOOKING_DATE FV_TYPE=""/> <D_VALUE_DATE FV_TYPE="F">2010-04-19</D_VALUE_DATE> <C_TRX_DESC FV_TYPE="F"/> <C_EXCHGE_RATE2 FV_TYPE="" USED="N"/> <C_EXCHGE_RATE1 FV_TYPE="" USED="N"/> <C_INTEREST_RATE2 FV_TYPE="" USED="N"/> <C_INTEREST_RATE1 FV_TYPE="" USED="N"/> <C_REF_NUMBER FV_TYPE=""/> <C_VOUCHER_DESC FV_TYPE=""/> <C_DBT_CRDT FV_TYPE="V">D</C_DBT_CRDT> <C_GL FV_TYPE="F">40000000521</C_GL> <C_SL FV_TYPE=""/> <C_CURRENCY FV_TYPE="F">EUR</C_CURRENCY> <C_TRANS_CODE FV_TYPE="F">PDVTP</C_TRANS_CODE> <C_CUST_CODE FV_TYPE=""/> <C_CUST_BS_GROUP FV_TYPE=""/> <C_CUST_BS_TYPE FV_TYPE=""/> <C_AO_CODE FV_TYPE=""/> <C_CU_REL_CODE FV_TYPE=""/> <C_CUST_CNTY_CODE FV_TYPE=""/> <C_VCH_SPECIAL1 FV_TYPE="F">3060</C_VCH_SPECIAL1> <C_VCH_SPECIAL2 FV_TYPE=""/> <I_TRX_AC_TYPE>1101</I_TRX_AC_TYPE> <C_UNIT_CODE>CAIXAPT</C_UNIT_CODE> <C_AC_TITLE>PEDRO FERNANDES SOARES</C_AC_TITLE> <N_AMT>36.40</N_AMT></ENTRY> </root>
------解决方案--------------------------------------------------------
Set objParser = CreateObject( "Microsoft.XMLDOM" )
objParser.LoadXML(strXML)
然后采用xpath可以取到任何值