2010-12-14 66 views
1

我還沒有真正使用XML工作過,但我不知道怎麼會變成這個層次結構轉換成XML格式,如果是有道理的:))感謝將此層次轉換爲xml?困惑

agent 
     agentname 
     email 
     allproperty 
     aproperty 
       postcode 
       price 
       imagefilename 
       visits 
     aproperty 
       postcode 
       price 
       imagefilename 
       visits 
     aproperty 
       postcode 
       price 
       imagefilename 
       visits 

回答

2
<agent> 
    <agentname></agentname> 
    <email></email> 
    <allproperty> 
     <aproperty> 
      <postcode></postcode> 
      <price></price> 
      <imagefilename></imagefilename> 
      <visits></visits> 
     </aproperty> 
     <aproperty> 
      <postcode></postcode> 
      <price></price> 
      <imagefilename></imagefilename> 
      <visits></visits> 
     </aproperty> 
     <aproperty> 
      <postcode></postcode> 
      <price></price> 
      <imagefilename></imagefilename> 
      <visits></visits> 
     </aproperty> 
    </allproperty> 
</agent> 
+0

歡呼聲,那是很容易的!對不起,這個愚蠢的問題!呵呵 – getaway 2010-12-14 17:58:31

0

不能你做這樣的事情?

<agent> 
    <name>agentName</name> 
    <email>agentEmail</email> 
    <properties> 
     <property> 
      <postcode>myPostcode</postcode> 
      ... 
     </property> 
     ... 
    </properties> 
</agent>