I am trying to split an value from xml using XSLT1.0 i have a XML like
<employees>
<examples>
<example id="1,2,3">
</example>
</examples>
<emp id="1">
<name>john</name>
</emp>
<emp id="2">
<name>raj</name>
</emp>
<emp id="3">
<name>sat</name>
</emp>
</employees>
I need to extract the id from the example tag and split it and get the value from the emp tag say the output should be
<employees>
<employee>
<id>1</id>
<name>john</name>
</employee>
<employee>
<id>2</id>
<name>raj</name>
</employee>
<employee>
<id>3</id>
<name>sat</name>
</employee>
</employees>
I think than rather than trying to split the @id attribute on the example element, which is a bit messy in XSLT1-0, you could instead try and match the emp elements whose @id appears in the @id of the attribute
Note the use of commas to ensure an @id of 1 is not picked up by an example @id of 11
Here is the full XSLT
When applied to your sample XML, the following is output