Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 21st, 2015, 08:27 AM
Registered User
 
Join Date: Oct 2015
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSLT code

Input file is :
<IPBZs>
<IPBZ>
<TRAKOD>IPBZ</TRAKOD>
<TRAYMD>20151002</TRAYMD>
<TRATYD>10573143</TRATYD>
<MODIDE>N</MODIDE>
<CMPNUM>0999900</CMPNUMSRV>
<VLDACTSRT>F</VLDACTSRT>
<TALKODISO>EN</TALKODISO>
<CMPOMS>TEST ANALYSE GCPS 1</CMPOMS>
<CHSNUM>0E777777</CHSNUM>
</IPBZ>
<IPBZ>
<TRAKOD>IPBZ</TRAKOD>
<TRAYMD>20151002</TRAYMD>
<TRATYD>10573143</TRATYD>
<MODIDE>N</MODIDE>
<CMPNUM>0999900</CMPNUMSRV>
<VLDACTSRT>F</VLDACTSRT>
<TALKODISO>EN</TALKODISO>
<CMPOMS>TEST ANALYSE GCPS 1</CMPOMS>
<CHSNUM>0E777778</CHSNUM>
</IPBZ>
<IPBZ>
<TRAKOD>IPBZ</TRAKOD>
<TRAYMD>20151002</TRAYMD>
<TRATYD>10573143</TRATYD>
<MODIDE>N</MODIDE>
<CMPNUM>0999900</CMPNUMSRV>
<VLDACTSRT>F</VLDACTSRT>
<TALKODISO>EN</TALKODISO>
<CMPOMS>TEST ANALYSE GCPS 1</CMPOMS>
<CHSNUM>0E777779</CHSNUM>
</IPBZ>
</IPBZs>

The required output is :

<ns0:FieldActionIssued ID="0999900">
<ns1:ApplicableTo chassisNr="0E777777">
<ns1:ExecutionStatus>Not executed</ns1:ExecutionStatus>
</ns1:ApplicableTo>
<ns1:ApplicableTo chassisNr="0E777778">
<ns1:ExecutionStatus>Not executed</ns1:ExecutionStatus>
</ns1:ApplicableTo>
<ns1:ApplicableTo chassisNr="0E777779">
<ns1:ExecutionStatus>Not executed</ns1:ExecutionStatus>
</ns1:ApplicableTo>
</ns0:FieldActionIssued>

The input CMPNUM value should come in ID attribute in output. How can I achive this?
 
Old October 21st, 2015, 09:48 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Please show the code you have so far, so we can tell you how to fix it.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
NEED XSLT CODE FOR XML suji XSLT 2 February 7th, 2008 11:54 PM
xslt code for xml suji XSLT 2 February 5th, 2008 12:18 AM
Help to incorporate an html code in xslt ismailc XSLT 22 January 16th, 2008 05:22 AM
XSLT code generator for C# asap XSLT 0 April 14th, 2006 03:54 PM
ascii code in my XSLT bluetorch XSLT 1 October 28th, 2005 01:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.