我需要將我的XML轉換爲另一個數據結構。 我收到的XML象下面這樣:使用XSLT合併XML節點
<results>
<resultset>
<result>
<name>BMW Cars</name>
<code>BMW Pkw</code>
<model.model>730d Saloon</model.model>
<model.name>KM21</model.name>
</result>
<result>
<name>BMW Cars</name>
<code>BMW Pkw</code>
<model.model>120i 3 doors</model.model>
<model.name>UA51</model.name>
</result>
<result>
<name>BMW Cars</name>
<code>BMW Pkw</code>
<model.model>Z4 sDrive23i</model.model>
<model.name>LM31</model.name>
</result>
<result>
<name>Audi</name>
<code>AUDI</code>
<model.model>A4 SAL.3.0 Q SPT TIP 5SPD</model.model>
<model.name>8E2SFZ04</model.name>
</result>
<result>
<name>Audi</name>
<code>AUDI</code>
<model.model>A6 SAL. 2.5TDI SPORT MAN.6SP.</model.model>
<model.name>4B2BBC04</model.name>
</result>
<result>
<name>AUdi</name>
<code>AUDI</code>
<model.model>A8 4.2 QUATTRO 6-SPD TIP</model.model>
<model.name>4E201L04</model.name>
</result>
</resultset>
</results>
,我需要它是這樣的:
<results>
<resultset>
<result>
<name>BMW Cars</name>
<code>BMW Pkw</code>
<model.model>730d Saloon</model.model>
<model.name>KM21</model.name>
<model.model>120i 3 doors</model.model>
<model.name>UA51</model.name>
<model.model>Z4 sDrive23i</model.model>
<model.name>LM31</model.name>
</result>
<result>
<name>Audi</name>
<code>AUDI</code>
<model.model>A4 SAL.3.0 Q SPT TIP 5SPD</model.model>
<model.name>8E2SFZ04</model.name>
<model.model>A6 SAL. 2.5TDI SPORT MAN.6SP.</model.model>
<model.name>4B2BBC04</model.name>
<model.model>A8 4.2 QUATTRO 6-SPD TIP</model.model>
<model.name>4E201L04</model.name>
</result>
</resultset>
</results>
我花了很多時間來解決這個問題,但至今沒有運氣。 有誰知道如何解決這個問題?
您使用的是XSLT 1.0還是2.0? –