link for the xml text. please remove "http:" from the link textXML 파일에서 여러 속성 값을 추출하는 방법은 무엇입니까?
아래는 XML 텍스트 콘텐츠입니다. 내가 추출 할이 XML 텍스트에서
<?xml version="1.0" standalone="yes"?>
<hydstra_xml_store date_format="BRITISH" version="1" application="WEBBATLS" timestamp="20170111144727">
<webbatls>
<site station="G0010001" parent="" stname="Sandover River - #7 Bore" shortname="Sandover R #7 Bore" mapname="" zone="53" easting="476064.2" northing="7552556.9" grdatum="MGA94" latitude="-22.131884543" longitude="134.767896023" lldatum="GDA94" posacc="" elev="12.658" elevdatum="" elevacc="01" local_map="" timezone="9.5" qquarter="" quarter="" section="" township="" range="" meridian="" active="False" owner="" commence="16/10/1968" cease="15/05/1974" stntype="SWG" region="5" orgcode="NTP" barcode="" category1="" category2="" category3="" category4="" category5="" category6="" category7="" category8="" category9="" category10="" category11="" category12="" category13="" category14="" category15="" category16="" category17="" category18="" category19="" category20="" spare1="" spare2="" enteredby="" checkedby="HYD" comment="" dbver41="" datecreate="30/12/1899" timecreate="0" usercreate="" datemod="09/12/2016" timemod="1111" usermod="BAILJ">
<_decode_ station="Sandover R #7 Bore" parent="(None)" grdatum="Map Grid of Australia 1994" latitude="22°07'54.8"S" longitude="134°46'04.4"E" lldatum="Geodetic Datum of Australia 1994" posacc="Prec unknown" elevdatum="(unknown)" elevacc="Not Applicable" timezone="Offset of standard local time from GMT" meridian="Unspecified" owner="(None)" stntype="SW Gauging Station" region="NT Wide" orgcode="NT Water Resources" category1="(Not set)" category2="(Not set)" category3="(Not set)" category4="(unknown)" category5="Unknown" category6="Unknown" category7="Unknown" category8="Unknown" category9="Unknown" category10="Unknown" category11="(unknown)" category12="(unknown)" category13="(unknown)" category14="(unknown)" category15="(unknown)" category16="(unknown)" category17="(unknown)" category18="(unknown)" category19="(unknown)" category20="(unknown)" enteredby="(unknown)" checkedby="HYDMG <Data imported by H"/>
</site>
<station station="G0010001" gauge="0" datum="GD" control="sandy river bed" contcode="" ctf="1.368" downst="False" gaugfacil="" hut="False" telemetry="False" streamdist="0" phone="" spillway="0" qmin="0" tmin="0" maxgaug="0" maxgdate="30/12/1899" catcharea="5050" enteredby="DRK" checkedby="HYD" bedslope="0" order="0" spare1="" spare2="" spare3="" spare4="" spare5="" dbver22="" datecreate="30/12/1899" timecreate="0" usercreate="" datemod="03/01/2017" timemod="212" usermod="SVCACC">
<_decode_ station="Sandover R #7 Bore" datum="Gauge Datum" contcode="Unknown" streamdist="km" tmin="Mins" catcharea="sq. km" enteredby="Doug Kinter" checkedby="HYDMG <Data imported by H" spare1="(unknown)" spare2="(unknown)" spare3="(unknown)" spare4="(unknown)" spare5="(unknown)"/>
</station>
<stninis/>
<periods/>
<gwholes/>
<aquifers/>
<variables/>
<contents_lists>
<content_list secttype="Reports" secttypestr="Reports" section="WEBREPORTSDWHSW"/>
<content_list secttype="Documents" secttypestr="Documents" section="WEBDOCUMENTSDWHSW"/>
</contents_lists>
</webbatls>
</hydstra_xml_store>
는 "_"(파란색 글꼴 단어) 내 사이트>/사이트 <> 사이의 값을 속성. "Sandover 강 - # 7 튜브"예 "G0010001"에 대한 ...
이것은 내가 성공적으로 XML 텍스트를 구문 분석 할 수 있었다 나는
url="http://water.nt.gov.au/wgen/cache/anon/G0010001.xml?1484112860902?1484112861283" data=XML::xmlParse(readLines(url)) xpathSApply(data, "//webbatls/site[@station,@....]")
이 내가이 일 :
B < -gsub을 시도하십시오 "A"변수에 예를 들어 텍스트를 저장하고 XpathSApply 기능
[[1]]
<site station="G0010001" parent="" stname="Sandover River - #7 Bore" shortname="Sandover R #7 Bore" mapname="" zone="53" easting="476064.2" northing="7552556.9" grdatum="MGA94" latitude="-22.131884543" longitude="134.767896023" lldatum="GDA94" posacc="" elev="12.658" elevdatum="" elevacc="01" local_map="" timezone="9.5" qquarter="" quarter="" section="" township="" range="" meridian="" active="False" owner="" commence="16/10/1968" cease="15/05/1974" stntype="SWG" region="5" orgcode="NTP" barcode="" category1="" category2="" category3="" category4="" category5="" category6="" category7="" category8="" category9="" category10="" category11="" category12="" category13="" category14="" category15="" category16="" category17="" category18="" category19="" category20="" spare1="" spare2="" enteredby="" checkedby="HYD" comment="" dbver41="" datecreate="30/12/1899" timecreate="0" usercreate="" datemod="09/12/2016" timemod="1111" usermod="BAILJ">
<_decode_ station="Sandover R #7 Bore" parent="(None)" grdatum="Map Grid of Australia 1994" latitude="22°07'54.8"S" longitude="134°46'04.4"E" lldatum="Geodetic Datum of Australia 1994" posacc="Prec unknown" elevdatum="(unknown)" elevacc="Not Applicable" timezone="Offset of standard local time from GMT" meridian="Unspecified" owner="(None)" stntype="SW Gauging Station" region="NT Wide" orgcode="NT Water Resources" category1="(Not set)" category2="(Not set)" category3="(Not set)" category4="(unknown)" category5="Unknown" category6="Unknown" category7="Unknown" category8="Unknown" category9="Unknown" category10="Unknown" category11="(unknown)" category12="(unknown)" category13="(unknown)" category14="(unknown)" category15="(unknown)" category16="(unknown)" category17="(unknown)" category18="(unknown)" category19="(unknown)" category20="(unknown)" enteredby="(unknown)" checkedby="HYDMG <Data imported by H"/>
</site>
내가 제대로 니펫에 XML 텍스트를 붙여 드릴 수 없습니다 코드 –
를 reformating하시기 바랍니다. 제발 도와주세요 –
4 공백을 사용하여 XML 문자열을 코드 블록으로 포맷하십시오. 또한 원하는 내용과 시도한 코드에 대해 더 잘 설명해야합니다. – blongworth