Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: sub totals with xsl

From: JasonBurr@-----------.---------.---
To: 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?
> > 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent