0
如何在XML文檔中的一組相同xml標記周圍插入結束標記和結束標記?舉例來說,如果我原來的XML如下所示:使用開始標記和結束標記封裝具有相同XML標記的組
<recordImport OperatorID="ABC123">
<patients>
<patient roomNo=1 name="George Washington" addressID="1">
<address ID="1" street="123 Credibility Street" city="Boston" state="MA"/>
<address ID="1" street="456 Aqualung Avenue" city="Seattle" state="WA"/>
</patient>
<patient roomNo=2 name="Thomas Jefferson" addressID="2">
<address ID="2" street="5 Famous Street" city="Burbank" state="CA"/>
</patient>
</patients>
</recordImport>
我怎麼能插入「地址」標籤如下:
<recordImport OperatorID="ABC123">
<patients>
<patient roomNo=1 name="George Washington" addressID="1">
<addresses>
<address ID="1" street="123 Credibility Street" city="Boston" state="MA"/>
<address ID="1" street="456 Aqualung Avenue" city="Seattle" state="WA"/>
</addresses>
</patient>
<patient roomNo=2 name="Thomas Jefferson" addressID="2">
<addresses>
<address ID="2" street="5 Famous Street" city="Burbank" state="CA"/>
</addresses>
</patient>
</patients>
</recordImport>
我寧願一個非LINQ解決方案,但我會用它如果它歸結於它。
在此先感謝。
您正在使用哪種腳本語言? – Vinit