开发者

Is this valid xml for reading using linq to xml

hi i have a confusion about xml

please tell me is this valid xml or not. i want to read it using linq to xml

  <registeredPeople>
    <id>1</id>
    <name>mohsan</name>
    <id>2开发者_如何学Python</id>
    <name>ali</name>
    <id>3</id>
    <name>azhar</name>
  </registeredPeople>


Well, it is well-formed, but it does not make much sense. It should look more like this:

<registeredPeople> 
    <person>
       <id>1</id> 
       <name>mohsan</name> 
    </person>
    <person>
       <id>2</id> 
       <name>ali</name> 
    </person>
    <person>
       <id>3</id> 
       <name>azhar</name> 
    </person>
</registeredPeople> 

or maybe even like this:

<registeredPeople>
    <person id="1" name="mohsan" />
    <person id="2" name="ali" />
    <person id="3" name="azhar" />
</registeredPeople>        


Nobody can tell if it is valid, but is well-formed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜