Hi Martin/Michael,
Thanks for ur reply.
I am using XSLT 1.0
>>How is the parent -> child relationship determined?
In the source structure the values under Level and Parent elements(under Item) will determine the hirearchy of SPM node on the target structure.
Please allow me to explain this using one example...
1) under first Item occ Level=1 and Parent=0
so the output will be :
<SPM>
<Level>1</Level>
<Parent>0</Parent>
<Company>A</Company>
</SPM>
2)If we have one more item i.e under Second Item node values under element Level=2 and Parent=1 respectively
so the output will be :
Code:
<SPM>
<Level>1</Level>
<Parent>0</Parent>
<Company>A</Company>
<SPM>
<Level>2</Level>
<Parent>1</Parent>
<Company>B</Company>
</SPM>
</SPM>
3) Now consider if i have third Item occurrence on the source side having Level=3 and Parent=2 as the element values
Output will be:
Code:
<SPM>
<Level>1</Level>
<Parent>0</Parent>
<Company>A</Company>
<SPM>
<Level>2</Level>
<Parent>1</Parent>
<Company>B</Company>
<SPM>
<Level>3</Level>
<Parent>2</Parent>
<Company>C</Company>
</SPM>
</SPM>
</SPM>
4) (Now the catch is here) Fourth Item occurrence on the source side having Level=2 and Parent=1 (again) as the element values
Output will be:
Code:
<SPM>
<Level>1</Level>
<Parent>0</Parent>
<Company>A</Company>
<SPM>
<Level>2</Level>
<Parent>1</Parent>
<Company>B</Company>
<SPM>
<Level>3</Level>
<Parent>2</Parent>
<Company>C</Company>
</SPM>
</SPM>
<SPM>
<Level>2</Level>
<Parent>1</Parent>
<Company>D</Company>
</SPM>
</SPM>
The values in Level and Parent will always be having (n,n-1) relation....
And one more thing please let me know how to assign points??
Thanks!!