XML Development

Moderators: None (Apply to moderate this forum)
Number of threads: 247
Number of posts: 448

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
XSLT logic some dependent records Posted by bala_1234 on 15 Dec 2009 at 3:42 PM
Hi All,

Am new to XSLT and trying to write some xslt which is having 1st record as the header,2nd record as the status and 3rd records as the trainings and all these 3 records can be occured n numbers of time, we want that fixed length file need to be converted into xml file, below is the simple input and out file should look like.


Sample Input is :

H123
S111SE
Tjavaasp
H231
S112SA
Tjavaaix

Output should be like below with above Input :

-<Information>
- <organization>
<id>123</id>
- <employee-status>
<employee-id>111</employee-id>
<employee-designation>SE</employee-designation>
</employee-status>
- <employee-trainings>
<employee-training1>java</employee-training1>
<employee-training2>asp</employee-training2>
</employee-trainings>
</organization>
- <organization>
<id>231</id>
- <employee-status>
<employee-id>112</employee-id>
<employee-designation>SA</employee-designation>
</employee-status>
- <employee-trainings>
<employee-training1>java</employee-training1>
<employee-training2>aix</employee-training2>
</employee-trainings>
</organization>
</Information>


In the above example we can distungish between record with first character of each record. I have tried but not able to getting the perfect logic.

Can any one plese help on getting this done. as this is urgent requirement for me.




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.