XSLT -- Mapping Same field & attribute with different value

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi All,<br/>
I need to trasform the below intput xml to Output xml using XSLT.<br/>
As some of the fields like(product,subtype) needs to be mapped to same "item" field and same "Name"attribute(with different value) in output.
Please let me know you suggestions,
Thanks in advance.
Input XML<br/>
<Documents PublicationName="ACK <br/>
<br/>
<Info><br/>
<store DocName="Ack" Order="1 <br/>
<Meta><br/>
<Notify>Ack</Notify><br/>
<NUM>12345</NUM><br/>

<PRODUCT>ABC</PRODUCT><br/>

<SUBTYPE>XYZ</SUBTYPE><br/>

<STANDARD>ISO</STANDARD><br/>

<VERSION>one</VERSION><br/>

<CREATION_DATE>2011-12-01</CREATION_DATE><br/>

<CODE>A</CODE><br/>

<NUM>B</NUM><br/>

<USERID>687686</USERID><br/>
</Meta><br/>

<br/>
</Store><br/>
</Info><br/>
</Documents>
<br/>
Output XML<br/>
<Documents PublicationName="ACK <br/>
<ACK><br/>
<DocumentIdentifier><br/>
<page>0015</page><br/>
<lang>E</lang><br/>
</DocumentIdentifier><br/>
<TITLE>MR</TITLE><br/>
<SURNAME>S</SURNAME><br/>

<br/>
</ACK><br/>
<Data><br/>
<stor DocName="Ack" Order="1 <br/>
<Metadata><br/>
<Item name="Notify" type="string Ack</Item><br/>
<Item name="NUM" type="string 12345</Item><br/>

<Item name="PRODUCT" type="string ABC</Item><br/>

<Item name="SUBTYPE" type="string XYZ</Item><br/>

<Item name="STANDARD" type="string ISO</Item><br/>

<Item name="VERSION" type="string one</Item><br/>

<Item name="CREATION_DATE" type="date 2011-12-01</Item><br/>

<Item name="CODE" type="string A</Item><br/>

<Item name="NUM" type="string B</Item><br/>

<Item name="USERID" type="string 687686</Item><br/>
</Metadata><br/>
<Operation>INSERT</Operation><br/>
<CheckSubscription>0</CheckSubscription><br/>
<Document>ACK_US</Document><br/>
<DATE>2011-12-11</DATE><br/>
<TIT>Ack</TIT><br/>
</Stor><br/>
</Data><br/>
</Documents>



View the full article
 
Back
Top