How to remove 2 same blocks of xslt and make it dynamic?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sarupria
    New Member
    • Sep 2019
    • 1

    How to remove 2 same blocks of xslt and make it dynamic?

    I am new to XSLT so need help from you guys!
    XML file :
    Code:
    <Employees>
     <Employee ID="1">
       <Name>Shweta</Name>
     <Employee ID="2">
       <Name>Ashish</Name>
     <Employee ID="3">
       <Name>Shikha</Name>
    </Employees>
    So I want based on employee IDs it should pick employee data.
    But ID value should not be hardcoded.

    But currently I am using "xsl:choose and when" and "xsl:if" to pick data based on ID which is becoming redundant and XSL is becoming bulky.
    So I want to optimize my code.
    Please suggest any way of doing the same.
    Last edited by gits; Sep 5 '19, 02:11 PM. Reason: added code tags
Working...