Hi Experts
I have a xml generated in PI from a file as below
<?xml version="1.0" encoding="utf-8"?>
<ns:ABCD xmlns:ns="urn:XYZ">
<document_hdr>
<d1>
<d2>
</document_hdr>
<document_vendor>
<v1>
<v2>
</document_vendor>
<document_gl>
<gl1>
<gl2>
</document_gl>
<document_gl>
<gl1>
<gl2>
</document_gl>
<document_hdr>
<d1>
<d2>
</document_hdr>
<document_vendor>
<v1>
<v2>
</document_vendor>
<document_gl>
<gl1>
<gl2>
</document_gl>
I want to assign a serial number for each node from top to bottom; where the number changes when <document_hdr> node starts
could anybody help me with the xslt
First xslt
It will assign a serial number to each group
<?xml version="1.0" encoding="utf-8"?>
<ns:ABCD xmlns:ns="urn:XYZ">
<document_hdr>
<d1>
<d2>
<ser>1
</document_hdr>
<document_vendor>
<v1>
<v2>
<ser>1
</document_vendor>
<document_gl>
<gl1>
<gl2>
<ser>1
</document_gl>
<document_gl>
<gl1>
<gl2>
<ser>1
</document_gl>
<document_hdr>
<ser>2
<d1>
<d2>
</document_hdr>
<document_vendor>
<v1>
<v2>
<ser>2
</document_vendor>
<document_gl>
<gl1>
<gl2>
<ser>2
</document_gl>