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>
</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>
</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
|