k.vijayakumar -6 Newbie Poster

Hi friends,

I had an xml like

<a text="asadf">
<b text="narsapur">

    <c text="1234" />


<c text="statecag" />
<c text="Pending Approval" />
<c text="S Corp:Pending Approval" />
<c text="Composite:Pending Approval" />
<c text="Combined:Pending Approval" />
<c text="Form Status">
  <d text="Approval Pending">
    <e text="BITa" />
    <e text="BITb" />
    <e text="BPTbc" />          
  </d>
  <d text="ro">
    <e text="efgh" />
  </d>
</c>

</a>

I want to change this to following format

    <label>asadf</label>
    <id>a</id>
    <children>
        <label>narsapur</label>
        <id>b</id>
        <children>
            <label>1234</label>
            <id>c</id>
        </children>
        <children>
            <label>statecag</label>
            <id>c</id>
        </children>
        <children>
            <label>Pending Approval</label>
            <id>c</id>
        </children>
        </children>

I think we can change it using schema. But i dont know how to write. Thanks in advance.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.