Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - RE: sub totals with xsl [Thread Next] RE: sub totals with xslTo: NULL Date: 11/1/2004 1:49:00 PM Actually I think you wanted to change @Net to @Total or use sum on @Vat and @Net and add them together. "Jason Burr" wrote: > I think this is what you want > > <xsl:value-of > select="sum(/Invoices/Invoice[Company/@Name=current()/Company/@Name]/@Net)"/> > > "Jack" wrote: > > > I have an xml document structured as: > > > > <Invoices> > > <Invoice ID="111" Date="12/12/2004" Net="600.00" Vat="105.00" > > Total="705.00"> > > <Company Name="Test1"> > > <Address> > > <Account> > > <Client> > > <Timesheets> > > <Invoice ID="112" Date="12/12/2004" Net="678.00" Vat="118.00" > > Total="796.65"> > > <Company Name="Test2"> > > <Address> > > <Account> > > <Client> > > <Timesheets> > > <Invoice> > > <Company Name="Test1"> > > etc.. > > > > I have only been using xsl for a few days and so far I can only > > generate a list of invoices ordered by company name and can get totals > > for all invoices but I need to get sub totals for each company. > > > > The output needs to look like: > > > > <company>(e.g test1) > > <invoice no.> <client> <date> <net> <vat> <total> > > <invoice no.> <client> <date> <net> <vat> <total> > > total: <net> <vat> <total> > > <comapny name> > > <invoice no.> <client> <date> <net> <vat> <total> > > <invoice no.> <client> <date> <net> <vat> <total> > > <invoice no.> <client> <date> <net> <vat> <total> > > total: <net> <vat> <total> > > > > Can anyone help to get the invoice totals for each company please? > > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
