Subject:how to get the xpath of xml element by xsl Author:manjunath Angadi Date:31 Aug 2006 08:31 AM
hi,
I need to populate the output xmls with the hardcoded tags say <xpath> as the value of xpath of each elements in the input xml.
eg:
input xml:
<root_tag>
<section_1>
<tag_1>tag1Value</tag_1>
<tag_2>tag2Value</tag_2>
</section_1>
<section_1>
<tag_1>tag1Value</tag_1>
<tag_2>tag2Value</tag_2>
</section_1>
</root_tag>
The expected output xml is:
<xpath>root_tag/section_1[1]/tag_1</xpath>
<value>tag1Value</value>
<xpath>root_tag/section_1[1]/tag_2</xpath>
<value>tag2Value</value>
<xpath>root_tag/section_1[2]/tag_1</xpath>
<value>tag1Value</value>
<xpath>root_tag/section_1[2]/tag_2</xpath>
<value>tag2Value</value>
Please reply me with the logic of code can be used in xsl to get the required output specified above.