【发布时间】:2009-07-21 13:51:26
【问题描述】:
我有以下 XML 结构
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<BookingGroup>
<PostCodes>
<PostCode >AB</PostCode>
<PostCode >AL</PostCode>
</PostCodes>
</BookingGroup>
<BookingGroup>
<PostCodes>
<PostCode >AB</PostCode>
<PostCode >D</PostCode>
</PostCodes>
</BookingGroup>
</Root>
现在对于整个 Xml 中的每个邮政编码 AB,我需要输出为:
<Root>
<Child>
<Child1>
</Child1>
<Child1>
</Child1>
</root>
因为有两个 AB 邮政编码,所以我需要两个 child1 元素。
【问题讨论】:
-
这个问题,按照目前的措辞,是难以理解的。
-
我想知道人们是否曾经阅读他们写的东西?没有人可以实际上如此残缺地和同时使用 XML。但话又说回来,也许这是可能的。 xkcd.com/481