This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

conversion of xml document using xsl


how to convert a given xml document to other xmldocument using XSL?

for example my XML document xmlA should be Converted to xmlB .how to write 
an XSL for this?

The following are the Xml documents xmlA and xmlB:

xmlA:
<invoice>
  <InvoiceHeader>
    <InvoiceDate>19990517</InvoiceDate>
    <ContractNumber>ABC124</ContractNumber>
  </InvoiceHeader>
  <ListOfInvoiceDetail>
      <InvoiceDetail>
         <BaseItemDetail>
           <LineItemNumber>1</LineItemNumber>
           <SupplierPartNum> SKU123  </SupplierPartNum>
           <Quantity>10  </Quantity>
         </BaseItemDetail>
         <InvoiceUnitPrice>13.95</InvoiceUnitPrice>
     </InvoiceDetail>
     <InvoiceDetail>
       <BaseItemDetail>
         <LineItemNumber>10</LineItemNumber>
         <SupplierPartNum> SKUABC</SupplierPartNum>
         <Quantity>12</Quantity>
       </BaseItemDetail>
       <InvoiceUnitPrice>15.75</InvoiceUnitPrice>
    </InvoiceDetail>
</ListOfInvoiceDetail>
<InvoiceSummary_r>
    <SubTotal_r>328.50</SubTotal_r>
    <Tax>26.947</Tax>
    <Total>355.437</Total>
</InvoiceSummary>
</Invoice>

The output xml(i.e)xmlB should be as follows:

<Inv>
  <InvHead>
     <InvDate>19990517</InvDate>
  </InvHead>
  <InvDetails>
     <ItemNumber>1</ItemNumber>
     <PartNum> SKU123</PartNum>
     <Qty>10</Qty>
  </InvDetails>
  <InvDetails>
     <ItemNumber>10</ItemNumber>
     <PartNum> SKUABC</PartNum>
     <Qty>12</Qty>
  </InvDetails>
  <total>355.437</total>
</Inv>

END


________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]