Last post Mar 18, 2013 05:07 AM by varun.indoria
None
0 Points
2 Posts
Mar 12, 2013 08:10 AM|varun.indoria|LINK
Hello,
I had a requirement where in i want to use group by with some elements and display result.
my input is an XML and out put should be Text.
Current Output is something like
================================
=====================================================================================
Line # | Cust Line # | Product ID | Schedule | Status
1 88 JCXFMER 12/28/2029 ItemAccepted
Cust ID: HANDWARMER
1 88 JCXFMER 04/27/2012 ItemAccepted
2 88 JCXFMER 12/28/2029 ItemAccepted
This is an automated notification. Any questions or comments should be directed to your
And expected output should be
==========================
Please note the status on following line items:
Line # | Cust Line # | Product ID | Qty | Schedule | Status
1 88 JCXFMER 7 Various See below
Split qty 3 04/27/2012 Scheduled
Split qty 4 12/28/2029 Schedule to follow
Drawing Status: Drawing Due Date to Customer: Customer return Date:
A 2/22/2012 3/7/2012
2 88 JCXFMER 8 Various See below
Split qty 8 12/28/2029 Schedule to follow
This is an automated notification. Any questions or comments should be directed to your ABB representative.
Need to group by all item with same line number, and show split result grouping by Schedule date.
Below is my input XML
<?xml version="1.0" ?> - <Acknowledgement> <OrderNumber>ENS1139</OrderNumber> <CustomerPONumber>2323qweqweqwe</CustomerPONumber> <OrderDate /> <OrderResponseDate>20120208</OrderResponseDate> <Marks>Marks that are on header Pg</Marks> <Terms>ABB Terms and Conditions 2001</Terms> <ProjectName>Project Frank is on the move today</ProjectName> - <BillTo> <DunsNumber>093338531</DunsNumber> <GISNumber>G02227097</GISNumber> <Attention>NA FINANCIAL SERVICES</Attention> <Name>EATON CORP</Name> <Address1>221 HEYWOOD RD</Address1> <Address2 /> <City>ARDEN</City> <State>OH</State> <ZIP>28704-265</ZIP> <Country>US</Country> </BillTo> - <ShipTo> <Attention /> <Name>OLIN CORPORATION</Name> <Address1>1 INDUSTRIAL ROAD</Address1> <Address2 /> <City>MC INTOSH</City> <State>AL</State> <ZIP>29649</ZIP> <Country>US</Country> </ShipTo> <BUUAddress /> <SysAddress /> <Salespersons /> - <Lines> - <AcknowledgementItem> <ItemNumber>1</ItemNumber> <ProductId>JCXFMER</ProductId> - <PlantLocation> <BUUAddress /> </PlantLocation> <UnitPrice>0.00</UnitPrice> <ListPrice>0.00</ListPrice> <Multiplier>0</Multiplier> <CustomerItemNumber>88</CustomerItemNumber> <CustomerProductId>HANDWARMER</CustomerProductId> <Status>ItemAccepted</Status> <ItemSchedules /> <ItemShipments /> <ItemInvoices /> - <AcknowledgementSubItems> - <AcknowledgementSubItem> <Type>Schedule</Type> <ReferenceQuantity>1</ReferenceQuantity> <ReferenceDate>12/28/2029</ReferenceDate> </AcknowledgementSubItem> </AcknowledgementSubItems> <ScheduleShipDate>0001-01-01T00:00:00</ScheduleShipDate> <SubItemNumber>0</SubItemNumber> <ApprovalDueDate>0001-01-01T00:00:00</ApprovalDueDate> <ApprovalMailedDate>0001-01-01T00:00:00</ApprovalMailedDate> <ApprovalReleasedDate>0001-01-01T00:00:00</ApprovalReleasedDate> <FirmDueDate>0001-01-01T00:00:00</FirmDueDate> <FirmMailedDate>0001-01-01T00:00:00</FirmMailedDate> <DrawingreturnDate>0001-01-01T00:00:00</DrawingreturnDate> </AcknowledgementItem> - <AcknowledgementItem> <ItemNumber>1</ItemNumber> <ProductId>JCXFMER</ProductId> - <PlantLocation> <BUUAddress /> </PlantLocation> <UnitPrice>0.00</UnitPrice> <ListPrice>0.00</ListPrice> <Multiplier>0</Multiplier> <CustomerItemNumber>88</CustomerItemNumber> <CustomerProductId>HANDWARMER</CustomerProductId> <Status>ItemAccepted</Status> <ItemSchedules /> <ItemShipments /> <ItemInvoices /> - <AcknowledgementSubItems> - <AcknowledgementSubItem> <Type>Schedule</Type> <ReferenceQuantity>1</ReferenceQuantity> <ReferenceDate>12/28/2029</ReferenceDate> </AcknowledgementSubItem> </AcknowledgementSubItems> <ScheduleShipDate>0001-01-01T00:00:00</ScheduleShipDate> <SubItemNumber>0</SubItemNumber> <ApprovalDueDate>0001-01-01T00:00:00</ApprovalDueDate> <ApprovalMailedDate>0001-01-01T00:00:00</ApprovalMailedDate> <ApprovalReleasedDate>0001-01-01T00:00:00</ApprovalReleasedDate> <FirmDueDate>0001-01-01T00:00:00</FirmDueDate> <FirmMailedDate>0001-01-01T00:00:00</FirmMailedDate> <DrawingreturnDate>0001-01-01T00:00:00</DrawingreturnDate> </AcknowledgementItem> - <AcknowledgementItem> <ItemNumber>1</ItemNumber> <ProductId>JCXFMER</ProductId> - <PlantLocation> <BUUAddress /> </PlantLocation> <UnitPrice>0.00</UnitPrice> <ListPrice>0.00</ListPrice> <Multiplier>0</Multiplier> <CustomerItemNumber>88</CustomerItemNumber> <CustomerProductId>HANDWARMER</CustomerProductId> <Status>ItemAccepted</Status> <ItemSchedules /> <ItemShipments /> <ItemInvoices /> - <AcknowledgementSubItems> - <AcknowledgementSubItem> <Type>Schedule</Type> <ReferenceQuantity>1</ReferenceQuantity> <ReferenceDate>04/27/2012</ReferenceDate> </AcknowledgementSubItem> </AcknowledgementSubItems> <ScheduleShipDate>0001-01-01T00:00:00</ScheduleShipDate> <SubItemNumber>0</SubItemNumber> <ApprovalDueDate>0001-01-01T00:00:00</ApprovalDueDate> <ApprovalMailedDate>0001-01-01T00:00:00</ApprovalMailedDate> <ApprovalReleasedDate>0001-01-01T00:00:00</ApprovalReleasedDate> <FirmDueDate>0001-01-01T00:00:00</FirmDueDate> <FirmMailedDate>0001-01-01T00:00:00</FirmMailedDate> <DrawingreturnDate>0001-01-01T00:00:00</DrawingreturnDate> </AcknowledgementItem> - <AcknowledgementItem> <ItemNumber>1</ItemNumber> <ProductId>JCXFMER</ProductId> - <PlantLocation> <BUUAddress /> </PlantLocation> <UnitPrice>0.00</UnitPrice> <ListPrice>0.00</ListPrice> <Multiplier>0</Multiplier> <CustomerItemNumber>88</CustomerItemNumber> <CustomerProductId>HANDWARMER</CustomerProductId> <Status>ItemAccepted</Status> <ItemSchedules /> <ItemShipments /> <ItemInvoices /> - <AcknowledgementSubItems> - <AcknowledgementSubItem> <Type>Schedule</Type> <ReferenceQuantity>1</ReferenceQuantity> <ReferenceDate>12/28/2029</ReferenceDate> </AcknowledgementSubItem> </AcknowledgementSubItems> <ScheduleShipDate>0001-01-01T00:00:00</ScheduleShipDate> <SubItemNumber>0</SubItemNumber> <ApprovalDueDate>0001-01-01T00:00:00</ApprovalDueDate> <ApprovalMailedDate>0001-01-01T00:00:00</ApprovalMailedDate> <ApprovalReleasedDate>0001-01-01T00:00:00</ApprovalReleasedDate> <FirmDueDate>0001-01-01T00:00:00</FirmDueDate> <FirmMailedDate>0001-01-01T00:00:00</FirmMailedDate> <DrawingreturnDate>0001-01-01T00:00:00</DrawingreturnDate> </AcknowledgementItem> - <AcknowledgementItem> <ItemNumber>1</ItemNumber> <ProductId>JCXFMER</ProductId> - <PlantLocation> <BUUAddress /> </PlantLocation> <UnitPrice>0.00</UnitPrice> <ListPrice>0.00</ListPrice> <Multiplier>0</Multiplier> <CustomerItemNumber>88</CustomerItemNumber> <CustomerProductId>HANDWARMER</CustomerProductId> <Status>ItemAccepted</Status> <ItemSchedules /> <ItemShipments /> <ItemInvoices /> - <AcknowledgementSubItems> - <AcknowledgementSubItem> <Type>Schedule</Type> <ReferenceQuantity>1</ReferenceQuantity> <ReferenceDate>12/28/2029</ReferenceDate> </AcknowledgementSubItem> </AcknowledgementSubItems> <ScheduleShipDate>0001-01-01T00:00:00</ScheduleShipDate> <SubItemNumber>0</SubItemNumber> <ApprovalDueDate>0001-01-01T00:00:00</ApprovalDueDate> <ApprovalMailedDate>0001-01-01T00:00:00</ApprovalMailedDate> <ApprovalReleasedDate>0001-01-01T00:00:00</ApprovalReleasedDate> <FirmDueDate>0001-01-01T00:00:00</FirmDueDate> <FirmMailedDate>0001-01-01T00:00:00</FirmMailedDate> <DrawingreturnDate>0001-01-01T00:00:00</DrawingreturnDate> </AcknowledgementItem> - <AcknowledgementItem> <ItemNumber>1</ItemNumber> <ProductId>JCXFMER</ProductId> - <PlantLocation> <BUUAddress /> </PlantLocation> <UnitPrice>0.00</UnitPrice> <ListPrice>0.00</ListPrice> <Multiplier>0</Multiplier> <CustomerItemNumber>88</CustomerItemNumber> <CustomerProductId>HANDWARMER</CustomerProductId> <Status>ItemAccepted</Status> <ItemSchedules /> <ItemShipments /> <ItemInvoices /> - <AcknowledgementSubItems> - <AcknowledgementSubItem> <Type>Schedule</Type> <ReferenceQuantity>1</ReferenceQuantity> <ReferenceDate>12/28/2029</ReferenceDate> </AcknowledgementSubItem> </AcknowledgementSubItems> <ScheduleShipDate>0001-01-01T00:00:00</ScheduleShipDate> <SubItemNumber>0</SubItemNumber> <ApprovalDueDate>0001-01-01T00:00:00</ApprovalDueDate> <ApprovalMailedDate>0001-01-01T00:00:00</ApprovalMailedDate> <ApprovalReleasedDate>0001-01-01T00:00:00</ApprovalReleasedDate> <FirmDueDate>0001-01-01T00:00:00</FirmDueDate> <FirmMailedDate>0001-01-01T00:00:00</FirmMailedDate> <DrawingreturnDate>0001-01-01T00:00:00</DrawingreturnDate> </AcknowledgementItem> - <AcknowledgementItem> <ItemNumber>1</ItemNumber> <ProductId>JCXFMER</ProductId> - <PlantLocation> <BUUAddress /> </PlantLocation> <UnitPrice>0.00</UnitPrice> <ListPrice>0.00</ListPrice> <Multiplier>0</Multiplier> <CustomerItemNumber>88</CustomerItemNumber> <CustomerProductId>HANDWARMER</CustomerProductId> <Status>ItemAccepted</Status> <ItemSchedules /> <ItemShipments /> <ItemInvoices /> - <AcknowledgementSubItems> - <AcknowledgementSubItem> <Type>Schedule</Type> <ReferenceQuantity>1</ReferenceQuantity> <ReferenceDate>12/28/2029</ReferenceDate> </AcknowledgementSubItem> </AcknowledgementSubItems> <ScheduleShipDate>0001-01-01T00:00:00</ScheduleShipDate> <SubItemNumber>0</SubItemNumber> <ApprovalDueDate>0001-01-01T00:00:00</ApprovalDueDate> <ApprovalMailedDate>0001-01-01T00:00:00</ApprovalMailedDate> <ApprovalReleasedDate>0001-01-01T00:00:00</ApprovalReleasedDate> <FirmDueDate>0001-01-01T00:00:00</FirmDueDate> <FirmMailedDate>0001-01-01T00:00:00</FirmMailedDate> <DrawingreturnDate>0001-01-01T00:00:00</DrawingreturnDate> </AcknowledgementItem> - <AcknowledgementItem> <ItemNumber>2</ItemNumber> <ProductId>JCXFMER</ProductId> - <PlantLocation> <BUUAddress /> </PlantLocation> <UnitPrice>0.00</UnitPrice> <ListPrice>0.00</ListPrice> <Multiplier>0</Multiplier> <CustomerItemNumber>88</CustomerItemNumber> <CustomerProductId>HANDWARMER</CustomerProductId> <Status>ItemAccepted</Status> <ItemSchedules /> <ItemShipments /> <ItemInvoices /> - <AcknowledgementSubItems> - <AcknowledgementSubItem> <Type>Schedule</Type> <ReferenceQuantity>1</ReferenceQuantity> <ReferenceDate>12/28/2029</ReferenceDate> </AcknowledgementSubItem> </AcknowledgementSubItems> <ScheduleShipDate>0001-01-01T00:00:00</ScheduleShipDate> <SubItemNumber>0</SubItemNumber> <ApprovalDueDate>0001-01-01T00:00:00</ApprovalDueDate> <ApprovalMailedDate>0001-01-01T00:00:00</ApprovalMailedDate> <ApprovalReleasedDate>0001-01-01T00:00:00</ApprovalReleasedDate> <FirmDueDate>0001-01-01T00:00:00</FirmDueDate> <FirmMailedDate>0001-01-01T00:00:00</FirmMailedDate> <DrawingreturnDate>0001-01-01T00:00:00</DrawingreturnDate> </AcknowledgementItem> - <AcknowledgementItem> <ItemNumber>2</ItemNumber> <ProductId>JCXFMER</ProductId> - <PlantLocation> <BUUAddress /> </PlantLocation> <UnitPrice>0.00</UnitPrice> <ListPrice>0.00</ListPrice> <Multiplier>0</Multiplier> <CustomerItemNumber>88</CustomerItemNumber> <CustomerProductId>HANDWARMER</CustomerProductId> <Status>ItemAccepted</Status> <ItemSchedules /> <ItemShipments /> <ItemInvoices /> - <AcknowledgementSubItems> - <AcknowledgementSubItem> <Type>Schedule</Type> <ReferenceQuantity>1</ReferenceQuantity> <ReferenceDate>12/28/2029</ReferenceDate> </AcknowledgementSubItem> </AcknowledgementSubItems> <ScheduleShipDate>0001-01-01T00:00:00</ScheduleShipDate> <SubItemNumber>0</SubItemNumber> <ApprovalDueDate>0001-01-01T00:00:00</ApprovalDueDate> <ApprovalMailedDate>0001-01-01T00:00:00</ApprovalMailedDate> <ApprovalReleasedDate>0001-01-01T00:00:00</ApprovalReleasedDate> <FirmDueDate>0001-01-01T00:00:00</FirmDueDate> <FirmMailedDate>0001-01-01T00:00:00</FirmMailedDate> <DrawingreturnDate>0001-01-01T00:00:00</DrawingreturnDate> </AcknowledgementItem> - <AcknowledgementItem> <ItemNumber>2</ItemNumber> <ProductId>JCXFMER</ProductId> - <PlantLocation> <BUUAddress /> </PlantLocation> <UnitPrice>0.00</UnitPrice> <ListPrice>0.00</ListPrice> <Multiplier>0</Multiplier> <CustomerItemNumber>88</CustomerItemNumber> <CustomerProductId>HANDWARMER</CustomerProductId> <Status>ItemAccepted</Status> <ItemSchedules /> <ItemShipments /> <ItemInvoices /> - <AcknowledgementSubItems> - <AcknowledgementSubItem> <Type>Schedule</Type> <ReferenceQuantity>1</ReferenceQuantity> <ReferenceDate>12/28/2029</ReferenceDate> </AcknowledgementSubItem> </AcknowledgementSubItems> <ScheduleShipDate>0001-01-01T00:00:00</ScheduleShipDate> <SubItemNumber>0</SubItemNumber> <ApprovalDueDate>0001-01-01T00:00:00</ApprovalDueDate> <ApprovalMailedDate>0001-01-01T00:00:00</ApprovalMailedDate> <ApprovalReleasedDate>0001-01-01T00:00:00</ApprovalReleasedDate> <FirmDueDate>0001-01-01T00:00:00</FirmDueDate> <FirmMailedDate>0001-01-01T00:00:00</FirmMailedDate> <DrawingreturnDate>0001-01-01T00:00:00</DrawingreturnDate> </AcknowledgementItem> - <AcknowledgementItem> <ItemNumber>2</ItemNumber> <ProductId>JCXFMER</ProductId> - <PlantLocation> <BUUAddress /> </PlantLocation> <UnitPrice>0.00</UnitPrice> <ListPrice>0.00</ListPrice> <Multiplier>0</Multiplier> <CustomerItemNumber>88</CustomerItemNumber> <CustomerProductId>HANDWARMER</CustomerProductId> <Status>ItemAccepted</Status> <ItemSchedules /> <ItemShipments /> <ItemInvoices /> - <AcknowledgementSubItems> - <AcknowledgementSubItem> <Type>Schedule</Type> <ReferenceQuantity>1</ReferenceQuantity> <ReferenceDate>12/28/2029</ReferenceDate> </AcknowledgementSubItem> </AcknowledgementSubItems> <ScheduleShipDate>0001-01-01T00:00:00</ScheduleShipDate> <SubItemNumber>0</SubItemNumber> <ApprovalDueDate>0001-01-01T00:00:00</ApprovalDueDate> <ApprovalMailedDate>0001-01-01T00:00:00</ApprovalMailedDate> <ApprovalReleasedDate>0001-01-01T00:00:00</ApprovalReleasedDate> <FirmDueDate>0001-01-01T00:00:00</FirmDueDate> <FirmMailedDate>0001-01-01T00:00:00</FirmMailedDate> <DrawingreturnDate>0001-01-01T00:00:00</DrawingreturnDate> </AcknowledgementItem> - <AcknowledgementItem> <ItemNumber>2</ItemNumber> <ProductId>JCXFMER</ProductId> - <PlantLocation> <BUUAddress /> </PlantLocation> <UnitPrice>0.00</UnitPrice> <ListPrice>0.00</ListPrice> <Multiplier>0</Multiplier> <CustomerItemNumber>88</CustomerItemNumber> <CustomerProductId>HANDWARMER</CustomerProductId> <Status>ItemAccepted</Status> <ItemSchedules /> <ItemShipments /> <ItemInvoices /> - <AcknowledgementSubItems> - <AcknowledgementSubItem> <Type>Schedule</Type> <ReferenceQuantity>1</ReferenceQuantity> <ReferenceDate>12/28/2029</ReferenceDate> </AcknowledgementSubItem> </AcknowledgementSubItems> <ScheduleShipDate>0001-01-01T00:00:00</ScheduleShipDate> <SubItemNumber>0</SubItemNumber> <ApprovalDueDate>0001-01-01T00:00:00</ApprovalDueDate> <ApprovalMailedDate>0001-01-01T00:00:00</ApprovalMailedDate> <ApprovalReleasedDate>0001-01-01T00:00:00</ApprovalReleasedDate> <FirmDueDate>0001-01-01T00:00:00</FirmDueDate> <FirmMailedDate>0001-01-01T00:00:00</FirmMailedDate> <DrawingreturnDate>0001-01-01T00:00:00</DrawingreturnDate> </AcknowledgementItem> - <AcknowledgementItem> <ItemNumber>2</ItemNumber> <ProductId>JCXFMER</ProductId> - <PlantLocation> <BUUAddress /> </PlantLocation> <UnitPrice>0.00</UnitPrice> <ListPrice>0.00</ListPrice> <Multiplier>0</Multiplier> <CustomerItemNumber>88</CustomerItemNumber> <CustomerProductId>HANDWARMER</CustomerProductId> <Status>ItemAccepted</Status> <ItemSchedules /> <ItemShipments /> <ItemInvoices /> - <AcknowledgementSubItems> - <AcknowledgementSubItem> <Type>Schedule</Type> <ReferenceQuantity>1</ReferenceQuantity> <ReferenceDate>12/28/2029</ReferenceDate> </AcknowledgementSubItem> </AcknowledgementSubItems> <ScheduleShipDate>0001-01-01T00:00:00</ScheduleShipDate> <SubItemNumber>0</SubItemNumber> <ApprovalDueDate>0001-01-01T00:00:00</ApprovalDueDate> <ApprovalMailedDate>0001-01-01T00:00:00</ApprovalMailedDate> <ApprovalReleasedDate>0001-01-01T00:00:00</ApprovalReleasedDate> <FirmDueDate>0001-01-01T00:00:00</FirmDueDate> <FirmMailedDate>0001-01-01T00:00:00</FirmMailedDate> <DrawingreturnDate>0001-01-01T00:00:00</DrawingreturnDate> </AcknowledgementItem> - <AcknowledgementItem> <ItemNumber>2</ItemNumber> <ProductId>JCXFMER</ProductId> - <PlantLocation> <BUUAddress /> </PlantLocation> <UnitPrice>0.00</UnitPrice> <ListPrice>0.00</ListPrice> <Multiplier>0</Multiplier> <CustomerItemNumber>88</CustomerItemNumber> <CustomerProductId>HANDWARMER</CustomerProductId> <Status>ItemAccepted</Status> <ItemSchedules /> <ItemShipments /> <ItemInvoices /> - <AcknowledgementSubItems> - <AcknowledgementSubItem> <Type>Schedule</Type> <ReferenceQuantity>1</ReferenceQuantity> <ReferenceDate>12/28/2029</ReferenceDate> </AcknowledgementSubItem> </AcknowledgementSubItems> <ScheduleShipDate>0001-01-01T00:00:00</ScheduleShipDate> <SubItemNumber>0</SubItemNumber> <ApprovalDueDate>0001-01-01T00:00:00</ApprovalDueDate> <ApprovalMailedDate>0001-01-01T00:00:00</ApprovalMailedDate> <ApprovalReleasedDate>0001-01-01T00:00:00</ApprovalReleasedDate> <FirmDueDate>0001-01-01T00:00:00</FirmDueDate> <FirmMailedDate>0001-01-01T00:00:00</FirmMailedDate> <DrawingreturnDate>0001-01-01T00:00:00</DrawingreturnDate> </AcknowledgementItem> - <AcknowledgementItem> <ItemNumber>2</ItemNumber> <ProductId>JCXFMER</ProductId> - <PlantLocation> <BUUAddress /> </PlantLocation> <UnitPrice>0.00</UnitPrice> <ListPrice>0.00</ListPrice> <Multiplier>0</Multiplier> <CustomerItemNumber>88</CustomerItemNumber> <CustomerProductId>HANDWARMER</CustomerProductId> <Status>ItemAccepted</Status> <ItemSchedules /> <ItemShipments /> <ItemInvoices /> - <AcknowledgementSubItems> - <AcknowledgementSubItem> <Type>Schedule</Type> <ReferenceQuantity>1</ReferenceQuantity> <ReferenceDate>12/28/2029</ReferenceDate> </AcknowledgementSubItem> </AcknowledgementSubItems> <ScheduleShipDate>0001-01-01T00:00:00</ScheduleShipDate> <SubItemNumber>0</SubItemNumber> <ApprovalDueDate>0001-01-01T00:00:00</ApprovalDueDate> <ApprovalMailedDate>0001-01-01T00:00:00</ApprovalMailedDate> <ApprovalReleasedDate>0001-01-01T00:00:00</ApprovalReleasedDate> <FirmDueDate>0001-01-01T00:00:00</FirmDueDate> <FirmMailedDate>0001-01-01T00:00:00</FirmMailedDate> <DrawingreturnDate>0001-01-01T00:00:00</DrawingreturnDate> </AcknowledgementItem> </Lines> </Acknowledgement>
Below is the existing Xsl file:
<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text" /> <xsl:template name="rightpadchar"> <xsl:param name="fieldvalue" select="string('')"/> <xsl:param name="fieldsize" select="0"/> <xsl:param name="char" select="string(' ')"/> <xsl:variable name="whatsthediff" select="$fieldsize - string-length($fieldvalue)" /> <xsl:choose> <xsl:when test="$whatsthediff = 0" > <xsl:value-of select="$fieldvalue"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$fieldvalue"/> <xsl:call-template name="padchar"> <xsl:with-param name="repeat" select="$whatsthediff"/> <xsl:with-param name="fillchar" select="$char"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="paddingleft"> <xsl:param name="value" select="0"/> <xsl:param name="char" select="string(' ')"/> <xsl:call-template name="padchar"> <xsl:with-param name="repeat" select="$value"/> <xsl:with-param name="fillchar" select="$char"/> </xsl:call-template> </xsl:template> <xsl:template name="leftpadchar"> <xsl:param name="fieldvalue" select="string('')"/> <xsl:param name="fieldsize" select="0"/> <xsl:param name="char" select="string(' ')"/> <xsl:variable name="whatsthediff" select="$fieldsize - string-length($fieldvalue)" /> <xsl:choose> <xsl:when test="$whatsthediff < 0" > <xsl:value-of select="$fieldvalue"/> </xsl:when> <xsl:otherwise> <xsl:call-template name="padchar"> <xsl:with-param name="repeat" select="$whatsthediff"/> <xsl:with-param name="fillchar" select="$char"/> </xsl:call-template> <xsl:value-of select="$fieldvalue"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="padchar"> <xsl:param name="repeat">0</xsl:param> <xsl:param name="fillchar" select="string(' ')"/> <xsl:if test="number($repeat) >= 1"> <xsl:call-template name="padchar"> <xsl:with-param name="repeat" select="$repeat - 1"/> <xsl:with-param name="fillchar" select="$fillchar"/> </xsl:call-template> <xsl:value-of select="$fillchar"/> </xsl:if> </xsl:template> <xsl:template name="addspace"> <xsl:param name="repeat">0</xsl:param> <xsl:if test="number($repeat) >= 1"> <xsl:text> </xsl:text> <xsl:call-template name="addspace"> <xsl:with-param name="repeat" select="$repeat - 1"/> </xsl:call-template> </xsl:if> </xsl:template> <xsl:template match="/"> <xsl:text>ABB Order Status Notification</xsl:text> <xsl:text>
</xsl:text> <xsl:text>
</xsl:text> <xsl:text>Customer Name:</xsl:text> <xsl:call-template name="addspace"> <xsl:with-param name="repeat" select="6"/> </xsl:call-template> <xsl:value-of select="Acknowledgement/BillTo/Name"></xsl:value-of> <xsl:text>
</xsl:text> <xsl:text>Shipment Address:</xsl:text> <xsl:call-template name="addspace"> <xsl:with-param name="repeat" select="3"/> </xsl:call-template> <xsl:if test="string-length(Acknowledgement/ShipTo/Name) > 0"> <xsl:value-of select="Acknowledgement/ShipTo/Name"></xsl:value-of> <xsl:text>, </xsl:text> </xsl:if> <xsl:if test="string-length(Acknowledgement/ShipTo/Address1) > 0"> <xsl:value-of select="Acknowledgement/ShipTo/Address1"></xsl:value-of> <xsl:text>, </xsl:text> </xsl:if> <xsl:if test="string-length(Acknowledgement/ShipTo/City) > 0"> <xsl:value-of select="Acknowledgement/ShipTo/City"></xsl:value-of> <xsl:text>, </xsl:text> </xsl:if> <xsl:value-of select="Acknowledgement/ShipTo/State"></xsl:value-of> <xsl:text>
</xsl:text> <xsl:text>Customer PO#:</xsl:text> <xsl:call-template name="addspace"> <xsl:with-param name="repeat" select="7"/> </xsl:call-template> <xsl:value-of select="Acknowledgement/CustomerPONumber"></xsl:value-of> <xsl:text>
</xsl:text> <xsl:text>ABB Reference:</xsl:text> <xsl:call-template name="addspace"> <xsl:with-param name="repeat" select="6"/> </xsl:call-template> <xsl:value-of select="Acknowledgement/OrderNumber"></xsl:value-of> <xsl:text>
</xsl:text> <xsl:text>Terms:</xsl:text> <xsl:call-template name="addspace"> <xsl:with-param name="repeat" select="14"/> </xsl:call-template> <xsl:value-of select="Acknowledgement/Terms"></xsl:value-of> <xsl:text>
</xsl:text> <xsl:text>Marks:</xsl:text> <xsl:call-template name="addspace"> <xsl:with-param name="repeat" select="14"/> </xsl:call-template> <xsl:value-of select="Acknowledgement/Marks"></xsl:value-of> <!-- <xsl:value-of select="string('')"></xsl:value-of> --> <xsl:text>
</xsl:text> <xsl:text>Project Name:</xsl:text> <xsl:call-template name="addspace"> <xsl:with-param name="repeat" select="7"/> </xsl:call-template> <xsl:value-of select="Acknowledgement/ProjectName"></xsl:value-of> <!-- <xsl:value-of select="string('')"></xsl:value-of> --> <xsl:text>

</xsl:text> <xsl:text>Please note the status on following line items:</xsl:text> <xsl:text>
</xsl:text> <xsl:text>=====================================================================================</xsl:text> <xsl:text>
</xsl:text> <xsl:text> ABB Line # </xsl:text> <xsl:text>|</xsl:text> <xsl:text> Cust Line # </xsl:text> <xsl:text>|</xsl:text> <xsl:text> Product ID </xsl:text> <xsl:text>|</xsl:text> <xsl:text> Schedule </xsl:text> <!--<xsl:text>|</xsl:text> <xsl:text> Req Delivery </xsl:text>--> <xsl:text>|</xsl:text> <xsl:text> Status </xsl:text> <xsl:text>
</xsl:text> <xsl:text>=====================================================================================</xsl:text> <xsl:for-each select="Acknowledgement/Lines/AcknowledgementItem"> <xsl:text>
</xsl:text> <xsl:call-template name="paddingleft"> <xsl:with-param name="value" select="2"/> <xsl:with-param name="char" select="string(' ')"/> </xsl:call-template> <xsl:call-template name="rightpadchar"> <xsl:with-param name="fieldsize" select="10"/> <xsl:with-param name="fieldvalue" select="ItemNumber"></xsl:with-param> <xsl:with-param name="char" select="string(' ')"></xsl:with-param> </xsl:call-template> <xsl:text> </xsl:text> <xsl:call-template name="rightpadchar"> <xsl:with-param name="fieldsize" select="12"/> <xsl:with-param name="fieldvalue" select="CustomerItemNumber"></xsl:with-param> <xsl:with-param name="char" select="string(' ')"></xsl:with-param> </xsl:call-template> <xsl:text>  </xsl:text> <xsl:call-template name="rightpadchar"> <xsl:with-param name="fieldsize" select="20"/> <xsl:with-param name="fieldvalue" select="ProductId"></xsl:with-param> <xsl:with-param name="char" select="string(' ')"></xsl:with-param> </xsl:call-template> <!--<xsl:call-template name="addspace"> <xsl:with-param name="repeat" select="12"/> </xsl:call-template>--> <xsl:variable name="ScheduleFound" select="count(AcknowledgementSubItems/AcknowledgementSubItem/Type[.='Schedule'])"></xsl:variable> <xsl:for-each select="AcknowledgementSubItems/AcknowledgementSubItem"> <!-- Schedule Date Begin--> <xsl:if test="substring(Type, 1) = 'Schedule'"> <xsl:call-template name="rightpadchar"> <xsl:with-param name="fieldsize" select="10"/> <xsl:with-param name="fieldvalue" select="ReferenceDate"></xsl:with-param> <xsl:with-param name="char" select="string(' ')"></xsl:with-param> </xsl:call-template> </xsl:if> <!-- Schedule Date End--> <!--<xsl:value-of select="ReferenceDate"></xsl:value-of>--> </xsl:for-each> <!-- Schedule Date NOT Schedule--> <xsl:if test="number($ScheduleFound)=0"> <xsl:call-template name="paddingleft"> <xsl:with-param name="value" select="10"/> <xsl:with-param name="char" select="string(' ')"></xsl:with-param> </xsl:call-template> </xsl:if> <xsl:text>  </xsl:text> <!--<xsl:value-of select="Status"></xsl:value-of>--> <xsl:choose> <xsl:when test="Status='ItemAcceptedAndShipped'">Shipped</xsl:when> <xsl:when test="Status='ItemAccepted'">Scheduled</xsl:when> <xsl:otherwise> <xsl:value-of select="Status"></xsl:value-of> </xsl:otherwise> </xsl:choose> <xsl:text>

</xsl:text> <xsl:call-template name="paddingleft"> <xsl:with-param name="value" select="20"/> <xsl:with-param name="char" select="string(' ')"></xsl:with-param> </xsl:call-template> <xsl:text>Cust ID: </xsl:text> <xsl:value-of select="CustomerProductId"></xsl:value-of> <xsl:text>

</xsl:text> <xsl:variable name="TotalQuantityShipped"> <xsl:value-of select="TotalQuantityShipped"></xsl:value-of> </xsl:variable> <xsl:for-each select="AcknowledgementSubItems/AcknowledgementSubItem"> <!-- Shipment Related Information Begin--> <xsl:if test="substring(Type, 1) = 'Shipment'"> <xsl:call-template name="paddingleft"> <xsl:with-param name="value" select="6"/> <xsl:with-param name="char" select="string(' ')"></xsl:with-param> </xsl:call-template> <xsl:text>Quantity Shipped: </xsl:text> <xsl:call-template name="rightpadchar"> <xsl:with-param name="fieldsize" select="32"/> <xsl:with-param name="fieldvalue" select="ReferenceQuantity"></xsl:with-param> <xsl:with-param name="char" select="string(' ')"></xsl:with-param> </xsl:call-template> <xsl:text>Date Shipped: </xsl:text> <xsl:value-of select="ReferenceDate"></xsl:value-of> <xsl:text>
</xsl:text> <xsl:call-template name="paddingleft"> <xsl:with-param name="value" select="6"/> <xsl:with-param name="char" select="string(' ')"></xsl:with-param> </xsl:call-template> <xsl:text>Carrier and B/L #: </xsl:text> <xsl:value-of select="normalize-space(CarrierName)"></xsl:value-of> <xsl:if test="string-length(CarrierName) > 0"> <xsl:text>, </xsl:text> </xsl:if> <xsl:value-of select="normalize-space(CarrierNumber)"></xsl:value-of> <xsl:variable name="CarrierNameLength" select="string-length(normalize-space(CarrierName))" /> <xsl:variable name="CarrierNumberLength" select="string-length(normalize-space(CarrierNumber))" /> <xsl:variable name="TotalCarrierLength" select="number($CarrierNameLength) + number($CarrierNumberLength)" /> <xsl:call-template name="addspace"> <xsl:with-param name="repeat" select="29 - number($TotalCarrierLength)"/> </xsl:call-template> <xsl:text>Total Quantity Shipped: </xsl:text> <xsl:value-of select="$TotalQuantityShipped"></xsl:value-of> </xsl:if> </xsl:for-each> <xsl:for-each select="AcknowledgementSubItems/AcknowledgementSubItem/Type[.='Schedule']"> <!-- Schedule related Information Begin--> <xsl:call-template name="paddingleft"> <xsl:with-param name="value" select="6"/> <xsl:with-param name="char" select="string(' ')"></xsl:with-param> </xsl:call-template> <xsl:text>Sub-line # </xsl:text> <xsl:value-of select="position()"></xsl:value-of> <xsl:text> Qty </xsl:text> <xsl:value-of select="parent::*/ReferenceQuantity"></xsl:value-of> <xsl:text> = </xsl:text> <xsl:value-of select="parent::*/ReferenceDate"></xsl:value-of> <xsl:text>
</xsl:text> <!-- Schedule related Information END--> </xsl:for-each> </xsl:for-each> <xsl:text>
</xsl:text> <xsl:text>
</xsl:text> <xsl:text>This is an automated notification. Any questions or comments should be directed to your .</xsl:text> <xsl:text> </xsl:text> <xsl:value-of select="Acknowledgement/SysAddress/EmailAddress"></xsl:value-of> </xsl:template> </xsl:stylesheet>
friends please help me to design the xsl as the expected result text.
Thanks a lot in Advance.
Mar 18, 2013 05:07 AM|varun.indoria|LINK
Hi,
I have solved the above XSL.
Thanks
None
0 Points
2 Posts
Need to group by in XSL 1.0
Mar 12, 2013 08:10 AM|varun.indoria|LINK
Hello,
I had a requirement where in i want to use group by with some elements and display result.
my input is an XML and out put should be Text.
Current Output is something like
================================
=====================================================================================
Line # | Cust Line # | Product ID | Schedule | Status
=====================================================================================
1 88 JCXFMER 12/28/2029 ItemAccepted
Cust ID: HANDWARMER
1 88 JCXFMER 12/28/2029 ItemAccepted
Cust ID: HANDWARMER
1 88 JCXFMER 04/27/2012 ItemAccepted
Cust ID: HANDWARMER
1 88 JCXFMER 04/27/2012 ItemAccepted
Cust ID: HANDWARMER
1 88 JCXFMER 04/27/2012 ItemAccepted
Cust ID: HANDWARMER
1 88 JCXFMER 12/28/2029 ItemAccepted
Cust ID: HANDWARMER
1 88 JCXFMER 12/28/2029 ItemAccepted
Cust ID: HANDWARMER
2 88 JCXFMER 12/28/2029 ItemAccepted
Cust ID: HANDWARMER
2 88 JCXFMER 12/28/2029 ItemAccepted
Cust ID: HANDWARMER
2 88 JCXFMER 12/28/2029 ItemAccepted
Cust ID: HANDWARMER
2 88 JCXFMER 12/28/2029 ItemAccepted
Cust ID: HANDWARMER
2 88 JCXFMER 12/28/2029 ItemAccepted
Cust ID: HANDWARMER
2 88 JCXFMER 12/28/2029 ItemAccepted
Cust ID: HANDWARMER
2 88 JCXFMER 12/28/2029 ItemAccepted
Cust ID: HANDWARMER
2 88 JCXFMER 12/28/2029 ItemAccepted
Cust ID: HANDWARMER
This is an automated notification. Any questions or comments should be directed to your
================================
And expected output should be
==========================
Please note the status on following line items:
=====================================================================================
Line # | Cust Line # | Product ID | Qty | Schedule | Status
=====================================================================================
1 88 JCXFMER 7 Various See below
Cust ID: HANDWARMER
Split qty 3 04/27/2012 Scheduled
Split qty 4 12/28/2029 Schedule to follow
Drawing Status: Drawing Due Date to Customer: Customer return Date:
A 2/22/2012 3/7/2012
2 88 JCXFMER 8 Various See below
Cust ID: HANDWARMER
Split qty 8 12/28/2029 Schedule to follow
This is an automated notification. Any questions or comments should be directed to your ABB representative.
==========================
Need to group by all item with same line number, and show split result grouping by Schedule date.
Below is my input XML
Below is the existing Xsl file:
friends please help me to design the xsl as the expected result text.
Thanks a lot in Advance.
None
0 Points
2 Posts
Re: Need to group by in XSL 1.0
Mar 18, 2013 05:07 AM|varun.indoria|LINK
Hi,
I have solved the above XSL.
Thanks