이 스레드는 Perl script to populate an XML file에 이어져 있습니다.Perl 스크립트를 통해 XML 파일 내용을 변경하십시오.
내가 변경하고자하는 파일입니다 : 나는이 목록에 여기에 새로운 나라를 추가 할
<?xml version="1.0" encoding="UTF-8"?>
<configuration start="earth">
<country-list>
<country name="japan">
<description></description>
<start>1900</start>
<end/>
</country>
<country name="italy">
<description></description>
<start>1950</start>
<end/>
</country>
<country name="korea">
<description></description>
<start>1800</start>
<end/>
</country>
</country-list>
</configuration>
.
이전 질문에서 Perl script to populate an XML file입니다.
#Get the list of cities as a list, then push "Tokyo" to it.
push @{$doc->{countries}->{country}->{'japan-'}->{city}}, 'Tokyo';
새 태그를 추가하는 것이 좋습니다. 그러나 제 경우에는 정확히 "밀어 넣기"를 사용할 수 있는지 확실하지 않습니다. 올바른 태그에 매핑 할 수 없습니다.
문제는 무엇입니까? – cjm
push @ {$ doc -> {configuration} -> { 'country-list'} -> {country}}, $ platform_name; - 제안되었지만 확실하지는 않습니다. 정확히 어떻게 새로운 나라를 추가하기 위해 푸시를 사용해야합니까? – hari