How can i write multiple values in the same line and value should be write between specific position.
<?xml version="1.0" encoding="us-ascii" standalone="yes"?> <Invoice> <InvoiceHeader CustomerName="Pankaj" Address="Address1" City="SURAT" BillNo= "123" Date="02/08/2018"></InvoiceHeader > <Product ID="1" Name="KeyBoard" Qty="25" Price="250.00"></Product> <Product ID="2" Name="Monitor" Qty="15" Price="6700.00"></Product> <Product ID="3" Name="CPU" Qty="5" Price="11000.00"></Product> </Invoice>
Customer: PANKAJ Date: 02/08/2018 Address: ADDRESS1 BillNo: 123 City: SURAT SrNo Item QTY Price Amount ========================================================= 1 keyboard 0025 000250.00 00006250.00 2 Monitor 0015 006700.00 00100500.00 3 CPU 0005 011000.00 00055000.00 =========================================================== Total 0045 00461750.00
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"/> <xsl:template match="/"> <xsl:text> Customer: </xsl:text><xsl:value-of select="Invoice/InvoiceHeader/@CustomerName" /><xsl:text> </xsl:text><xsl:text> </xsl:text> <xsl:text> Date: </xsl:text><xsl:value-of select="Invoice/InvoiceHeader/@Date" /><xsl:text></xsl:text><xsl:text></xsl:text> <xsl:text> Address: </xsl:text><xsl:value-of select="Invoice/InvoiceHeader/@Address" /><xsl:text></xsl:text> <xsl:text> City: </xsl:text><xsl:value-of select="Invoice/InvoiceHeader/@City" /><xsl:text> </xsl:text><xsl:text> </xsl:text> <xsl:text>BillNo: </xsl:text><xsl:value-of select="Invoice/InvoiceHeader/@BillNo" /> <xsl:text></xsl:text> <xsl:text> City: </xsl:text><xsl:value-of select="Invoice/InvoiceHeader/@City" /><xsl:text></xsl:text> <xsl:text>SrNo</xsl:text><xsl:text> </xsl:text> <xsl:text>Item</xsl:text><xsl:text> </xsl:text> <xsl:text>Qty</xsl:text><xsl:text> </xsl:text> <xsl:text>Price</xsl:text><xsl:text> </xsl:text> <xsl:text>Amount</xsl:text> <xsl:text></xsl:text> <xsl:text>=====================================================================</xsl:text><xsl:text></xsl:text> <xsl:for-each select="Invoice/Product"> <xsl:value-of select="./@ID" /><xsl:text> </xsl:text> <xsl:value-of select="./@Name" /><xsl:text> </xsl:text> <xsl:value-of select="./@Qty" /><xsl:text> </xsl:text> <xsl:value-of select="./@Price" /><xsl:text> </xsl:text> <xsl:value-of select="./@Qty * ./@Price" /><xsl:text></xsl:text> </xsl:for-each> </xsl:template> </xsl:stylesheet>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)