condition checking in xml using xslt

songania

New Member
Input XML\[code\]<Employer> <Employeedetail>Sam SR Engineer 10%</ Employeedetail > <Employeedetail>Sam SR 10%</ Employeedetail > <Employeedetail>Sam SR</ Employeedetail ></ Employer >\[/code\]Below is the Output Input XML\[code\]<Employer> < Employeedetails > < Employeedetail1> < Employeedetail > <Name>Sam</ Name > <Grade> SR Engineer </ Grade > <Experience>10</ Experience > </ Employeedetail > </ Employeedetail1> </ Employeedetails></ Employer > <Employer> < Employeedetails > < Employeedetail1> < Employeedetail > <Name>Sam</ Name > <Grade>SR</ Grade > <Experience>10</ Experience > </ Employeedetail > </ Employeedetail1> </ Employeedetails></ Employer > <Employer> < Employeedetails > < Employeedetail1> < Employeedetail > <Name>Sam</ Name > <Grade>SR</ Grade > <Experience>10</ Experience > </ Employeedetail > </ Employeedetail1> </ Employeedetails></ Employer >\[/code\]People from stack overflow they have helped if we have three space sperated node we will get the outputBut here there is a slight twist again if you look into the grade Sr Engineer this will come into the grade but the code what I have will display SR into the Grade element and Engineer and 10 (Experience) will come in the Experience element.If there is no value for Experience it has take by default 10.In the above Input XML there will be number of Employee details it will come.Here is the link for that xsltPlease help for the above question thanks in advance
 
Back
Top