File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes How to create a summary for XML data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to create a summary for XML data" Watch "How to create a summary for XML data" New topic

How to create a summary for XML data

Amit Agarwal
Ranch Hand

Joined: May 09, 2001
Posts: 92
I have a java program that generates an XML document containing information on various electrical components in a circuit. I want to make a summary of the components in the circuit and display a report. Is this possible using any of the XML technologies or do I have to write a pure java code for this?
Ajith Kallambella

Joined: Mar 17, 2000
Posts: 5782
If you know the structure of your XML file, then you can write a stylesheet that includes all the summarizing logic.

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Amit Agarwal
Ranch Hand

Joined: May 09, 2001
Posts: 92
Thanks Ajith,
I know the structure of my XML file. I just wanted to know whether it is possible to put a summarizing logic using XSL.
I need to get a sub-total quantity against each category in the summary. is it possible to compute the sub-totals etc. using XSL.
Please tell me any online resources available, which could help me in this. I have seen a tutorial at but it does not talk of any type of computations (totals / count).
[This message has been edited by Amit Agarwal (edited June 13, 2001).]
Mapraputa Is
Leverager of our synergies

Joined: Aug 26, 2000
Posts: 10065
You can use sum() and count() functions.
These are the best recourses for advanced XSLT:
XSLT Questions and Answers.
Jeni's XSLT Pages:

Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
I agree. Here's the link:
subject: How to create a summary for XML data
It's not a secret anymore!