I was just confused then where you said your "XSLT starts with 2010...". You apparently meant to say your XSLT does nothing, but this is what it needs to do. Are you looking for someone to write an entire XSL file for you, or what part are you struggling with?
-----Original Message----- From: CRANFORD, CHRIS [mailto:[email protected]] Sent: Friday, September 10, 2010 10:42 AM To: [email protected] Subject: RE: XSLT Help No, all I was showing was the expected output. I still need to code the XSLT to actually generate that. > -----Original Message----- > From: Eric Douglas [mailto:[email protected]] > Sent: Friday, September 10, 2010 9:33 AM > To: [email protected] > Subject: RE: XSLT Help > > You already have the XSL to print the months and years and all you need > is the method to add up the data fields? > It sounds like you have the hard part done. > Look up the sum method. > http://www.w3schools.com/Xpath/xpath_functions.asp > > -----Original Message----- > From: CRANFORD, CHRIS [mailto:[email protected]] > Sent: Friday, September 10, 2010 10:23 AM > To: [email protected] > Subject: XSLT Help > > > I am struggling with the best way to parse the following XML section > from my document with XSLT using FOP. > > <document> > <usage> > <record> > <year>2010</year> > <month>1</month> > <quantity>1</quantity> > </record> > <record> > <year>2009</year> > <month>3</month> > <quantity>2</quantity> > </record> > </usage> > </document> > > In the PDF output, what I actually need to be able to produce is to > take the current year (2010) and go backward a total of > 4 years. The XML document could contain data in this section that > dates back prior to 2006 and that information is just not used in this > output. > > > The PDF should look like the following: > > J F M A M J J A S O N D Total > - - - - - - - - - - - - ----- > 2010 1 0 0 0 0 0 0 0 0 0 0 0 1 > 2009 0 0 2 0 0 0 0 0 0 0 0 0 2 > > The XSLT starts with 2010, searches for data for month 1 and steps by 1 > until 12, keeping a total and then displays the yearly total, > decrements the year, resets the month to 1 and starts the process > over. > > During each step, I need to examine the XML document to find if data > exists for the year/month in /document/usage/record by those two data > values and if not, default a 0 usage; otherwise read the value of > /quantity from the record. > > Anyone have any suggestions on the best way to do this? > > Chris > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
