나는 국가와 도시가 포함 된 데이터베이스를 가지고 있습니다. 이 정보를 xml 문서로 내보내고 싶지만 구조화하는 방법을 궁금해합니다.xml 문서 구성에 대한 도움
내가 이렇게 그것을 수행해야합니다
<country>
<name>Canada</name>
<city>
<name>Toronto</name>
<population>1423200</population>
</city>
<city>
<name>Ottawa</name>
<population>1423200</population>
</city>
</country>
또는 같은
:<country>
<name>Canada</name>
<cities>
<city>
<name>Toronto</name>
<population>1423200</population>
</city>
<city>
<name>Ottawa</name>
<population>1423200</population>
</city>
</cities>
</country>
또는 같은
:<entity>
<country>Canada</country>
<city>Ottawa</city>
<city_population>1423200</city_population>
</entity>
<entity>
<country>Canada</country>
<city>Toronto</city>
<city_population>1423200</city_population>
</entity>
그들 각각 장점과 단점은 무엇인가 ? 구조화의 다른 방법이 있습니까?
미래의 변경 사항 (데이터 추가)을 위해 가장 적합합니다.
처음으로 XML로 구조화하면 피드백/힌트가 멋질 것입니다.
첫 번째 것을 의미할까요? – ajsie
확실히 첫 번째가 더 좋습니다! – anthares
변경에 감사드립니다. 하지만 각 파일마다 하나의 국가가 있으므로이 경우에는 필요하지 않습니다. – ajsie