Wednesday, 2 July 2014

Auto Increment ID Number in XML



I am stuck at very big problem. I have around 500000 line codes in XML format. My job is to change the



<SubIssue id="AlphaNumberic">


by increment +1. Here's the code below and what i want to achieve.



<Bobs>
<lob lName = "Oxygen">

<model IssueType='A_2' mName = "ER567">
<MainIssue nm = "Main Issue 1">
<SubIssue id = "N1" sName = "Ht/LK/MB">Common_IS</SubIssue>
</MainIssue>

<MainIssue nm = "Main Issue 2">
<SubIssue id = "N2" sName = "Ht/LK/MB">Common_IS</SubIssue>

<SubIssue id = "N3" sName = "Refrence Text">Common_IS</SubIssue>

<SubIssue id = "N4" sName = "Refrence Text">Common_IS</SubIssue>

<SubIssue id = "N5" sName = "Refrence Text">Common_IS</SubIssue>

<SubIssue id = "N6" sName = "Refrence Text">Common_IS</SubIssue>
</MainIssue>
<MainIssue nm = "Problemas de Boot">
<SubIssue id = "N7" sName = "Refrence Text)">Common_IS</SubIssue>

<SubIssue id = "N8" sName = "Refrence Text">Common_IS</SubIssue>

<SubIssue id = "N9" sName = "Refrence Text">Common_IS</SubIssue>

<SubIssue id = "N10" sName = "Refrence Text">Common_IS</SubIssue>

<SubIssue id = "N11" sName = "Refrence Text">Common_IS</SubIssue>

</MainIssue>
<lob lName = "AIRO2">

<model IssueType='L_9' mName = "AF678">
<MainIssue nm = "MainIssue_1">
<SubIssue id = "L1" sName = "Refrence Text">Common_IS</SubIssue>
</MainIssue>

<MainIssue nm = "Problems">
<SubIssue id = "L2" sName = "Refrence Text">Common_IS</SubIssue>

<SubIssue id = "L3" sName = "Refrence Text">Common_IS</SubIssue>

<SubIssue id = "L4" sName = "Refrence Text">Common_IS</SubIssue>

<SubIssue id = "L5" sName = "Refrence Text">Common_IS</SubIssue>
</MainIssue>
</Bobs>


So I want to auto increment SubIssue id number by 1. Is there any way to do that. Right now I am doing it manually and its very much irritating. Plzzzz Help guys..!!!


No comments:

Post a Comment