XML中的XSLT序列号

时间:2017-04-10 21:33:14

标签: xml xslt

我有以下XML

<root>
    <qryXMLOrders>
        <IteNumGDS7></IteNumGDS7>
        <GroMasGDS46>AA</GroMasGDS46>
        <NetMasGDS48>AA</NetMasGDS48>
    </qryXMLOrders>
    <qryXMLOrders>
        <IteNumGDS7></IteNumGDS7>
        <GroMasGDS46>BB</GroMasGDS46>
        <NetMasGDS48>BB</NetMasGDS48>
    </qryXMLOrders>
    <qryXMLOrders>
        <IteNumGDS7></IteNumGDS7>
        <GroMasGDS46>CC</GroMasGDS46>
        <NetMasGDS48>CC</NetMasGDS48>
    </qryXMLOrders>
</root> 

我希望在元素中包含连续数字,以便得到所需的结果:

<root>
    <qryXMLOrders>
        <IteNumGDS7>1</IteNumGDS7>
        <GroMasGDS46>AA</GroMasGDS46>
        <NetMasGDS48>AA</NetMasGDS48>
    </qryXMLOrders>
    <qryXMLOrders>
        <IteNumGDS7>2</IteNumGDS7>
        <GroMasGDS46>BB</GroMasGDS46>
        <NetMasGDS48>BB</NetMasGDS48>
    </qryXMLOrders>
    <qryXMLOrders>
        <IteNumGDS7>3</IteNumGDS7>
        <GroMasGDS46>CC</GroMasGDS46>
        <NetMasGDS48>CC</NetMasGDS48>
    </qryXMLOrders>
</root>

如何使用XSLT完成?

0 个答案:

没有答案