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 November 8th, 2010, 06:48 AM
Registered User
 
Join Date: Nov 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Learner XSLT programmer needs urgent help!!!

I am currently outputting the results of an xml file to an xslt email...

XML FILE:-

<?xml version="1.0" encoding="UTF-8"?>
<ProcessData>
<SenderID>5055185400461</SenderID>
<ReceiverID>5013546206787</ReceiverID>
<InterchangeControlNumber>2124</InterchangeControlNumber>
<EnvelopeType>STX END</EnvelopeType>
<Standard>TRADACOMS</Standard>
<InterchangeDateTime>101104141918</InterchangeDateTime>
<HeaderMessageType>ORDHDR</HeaderMessageType>
<TransactionSetControlNumber>2124</TransactionSetControlNumber>
<MessageType>ORDERS</MessageType>
<TransactionVersion>9</TransactionVersion>
<TransactionCount>2</TransactionCount>
<InnerEnvelopeName>GIS_I_MORRISONSPO1</InnerEnvelopeName>
<ExtractDirectory>\\flqad004\mfgpro\edi\live\data\ inbound</ExtractDirectory>
<ExtractFilename>$BPID$_$SENDERID$_$DATE$_$TIME$.o rd</ExtractFilename>
<TranslationEngine>
<ValidateInput>YES</ValidateInput>
<ValidateOutput>YES</ValidateOutput>
</TranslationEngine>
<ComplianceCheckMapName>Alan_example_NPI Tradacom Orders080210_5001_Morrisons</ComplianceCheckMapName>
<DeliveryLocation>BURTON LATIMER GROCE</DeliveryLocation>
<PO_Field>9532523</PO_Field>
<CustomerCode>0731816</CustomerCode>
<ItemDescription>M MOIST TISSUE ALOE 40 S</ItemDescription>
<SU_Qty>12</SU_Qty>
<Case_Qty>168</Case_Qty>
<CustomerCode>0731818</CustomerCode>
<ItemDescription>M MOIST TOILET TISSUE 40S</ItemDescription>
<SU_Qty>12</SU_Qty>
<Case_Qty>168</Case_Qty>
<CustomerCode>0779491</CustomerCode>
<ItemDescription>M FLOOR WIPES 15 S</ItemDescription>
<SU_Qty>9</SU_Qty>
<Case_Qty>136</Case_Qty>
<CustomerCode>0779989</CustomerCode>
<ItemDescription>M MULTIPURP WIPES LEMON 40 S</ItemDescription>
<SU_Qty>8</SU_Qty>
<Case_Qty>170</Case_Qty>
<CustomerCode>0779992</CustomerCode>
<ItemDescription>M ANTIBACTERIAL WIPES 40 S</ItemDescription>
<SU_Qty>8</SU_Qty>
<Case_Qty>170</Case_Qty>
<CustomerCode>0897602</CustomerCode>
<ItemDescription>M LOTION BABY WIPES 80 S (MS)</ItemDescription>
<SU_Qty>12</SU_Qty>
<Case_Qty>180</Case_Qty>
<CustomerCode>0898050</CustomerCode>
<ItemDescription>M TODDLER WIPES SENS. 60 S</ItemDescription>
<SU_Qty>12</SU_Qty>
<Case_Qty>119</Case_Qty>
<CustomerCode>0898051</CustomerCode>
<ItemDescription>M TODDLER WIPES 60 S</ItemDescription>
<SU_Qty>12</SU_Qty>
<Case_Qty>119</Case_Qty>
<CustomerCode>0898054</CustomerCode>
<ItemDescription>M LOTION FFREE B/WIPE 80S(MS)</ItemDescription>
<SU_Qty>12</SU_Qty>
<Case_Qty>420</Case_Qty>
<CustomerCode>0898057</CustomerCode>
<ItemDescription>M VALUE BABY WIPES 72 S</ItemDescription>
<SU_Qty>12</SU_Qty>
<Case_Qty>540</Case_Qty>
<DeliveryLocation>BURTON LATIMER GROCE</DeliveryLocation>
<PO_Field>9532524</PO_Field>
<CustomerCode>0897602</CustomerCode>
<ItemDescription>M LOTION BABY WIPES 80 S (MS)</ItemDescription>
<SU_Qty>12</SU_Qty>
<Case_Qty>480</Case_Qty>
<CustomerCode>0898054</CustomerCode>
<ItemDescription>M LOTION FFREE B/WIPE 80S(MS)</ItemDescription>
<SU_Qty>12</SU_Qty>
<Case_Qty>600</Case_Qty>
<CustomerCode>0898057</CustomerCode>
<ItemDescription>M VALUE BABY WIPES 72 S</ItemDescription>
<SU_Qty>12</SU_Qty>
<Case_Qty>60</Case_Qty>
<TRACKINGID>fledi001:node1:12b0f867d7d:2149365</TRACKINGID>
<CONTRACT_FOUND>YES</CONTRACT_FOUND>
<EnvelopeID>fledi001:node1:12aa4881a80:306259</EnvelopeID>
<RESTART_FROM>379961</RESTART_FROM>
<Rename>
<FileDate>20101108</FileDate>
<FileTime>102946</FileTime>
<SenderID>5055185400461</SenderID>
<BPID>700</BPID>
<MessType/>
<ReceiverID>5013546206787</ReceiverID>
<Identifier/>
<filenameOld>$BPID$_$SENDERID$_$DATE$_$TIME$.ord </filenameOld>
</Rename>
<NewFileName>700_5055185400461_20101108_102946.ord </NewFileName>
<PrimaryDocument SCIObjectID="fledi001:node1:12b0f867d7d:2272369"/>
</ProcessData>

The output of this currently is below

Order Number/s

9532523
Item Details
Customer Code Item Description SU_Qty Case_Qty

0731816M MOIST TISSUE ALOE 40 S12168
0731818M MOIST TOILET TISSUE 40S12168
0779491M FLOOR WIPES 15 S9136
0779989M MULTIPURP WIPES LEMON 40 S8170 0779992M ANTIBACTERIAL WIPES 40 S8170 0897602M LOTION BABY WIPES 80 S (MS)12180 0898050M TODDLER WIPES SENS. 60 S12119 0898051M TODDLER WIPES 60 S12119 0898054M LOTION FFREE B/WIPE 80S(MS)12420 0898057M VALUE BABY WIPES 72 S12540 0897602M LOTION BABY WIPES 80 S (MS)12480 0898054M LOTION FFREE B/WIPE 80S(MS)12600 0898057M VALUE BABY WIPES 72 S1260


The information is coming out ok but I would to place the data in a table rather than string in its current state. With the table headings being Customer code, Item Description, SU_Qty, Case_Qty.


My current XSLT is below...

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates select="ProcessData"/>
</xsl:template>
<xsl:template match="ProcessData">
<xsl:for-each select="PO_Field">
Order Number/s
<xsl:text>&#xA;</xsl:text>
<xsl:value-of select="." />
Item Details
Customer Code Item Description SU_Qty Case_Qty
<xsl:for-each select="following-sibling::CustomerCode">
<xsl:text>&#xA;</xsl:text>
<xsl:value-of select="." />
<xsl:value-of select="following-sibling::ItemDescription[1]"/>
<xsl:value-of select="following-sibling::SU_Qty[1]"/>
<xsl:value-of select="following-sibling::Case_Qty[1]"/>
</xsl:for-each>
</xsl:for-each>
<Result>
<xsl:if test="count(Identifier) >0">
<output><xsl:for-each select="Identifier">
<br><xsl:value-of select="Identifier"/></br>
</xsl:for-each></output>
</xsl:if>
</Result>
</xsl:template>
</xsl:stylesheet>


Please can someone help me regarding this...

Thanks

Pete





Similar Threads
Thread Thread Starter Forum Replies Last Post
help!!!!!!!! learner ysfkay Windows Presentation Foundation 1 March 21st, 2011 02:06 PM
Looking for best learner book etippelt Visual C++ 0 July 12th, 2007 01:47 AM
Query About XSLT-Urgent harshalchoksi XSLT 6 February 23rd, 2007 06:43 AM
urgent help with xslt sonya9879 XSLT 1 August 18th, 2005 09:17 AM
XSLT HELP URGENT! pkg XSLT 3 June 22nd, 2005 01:46 AM





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