Quantcast
Channel: SCN : Unanswered Discussions - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 6719

XSL transformation help

$
0
0

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>


Viewing all articles
Browse latest Browse all 6719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>