473,785 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Generate html report from directory of XML docs

Hi,

I have a mail server that generates archives in a directory for every
message sent or received and each archive has an associated XML file
with <sender>, <receiver>, <subject> and other email related tags and
all files have same exact format. I would like to generate reports in
a web page based upon the content of these XML files but not sure where
to start. I know how to make an individual XML file display in browser
by linking a stylesheet with xsl and xslt but not sure how to go about
traversing the directory to collect the info and display aggregate
content into a report. Any pointers on a best approach and appropriate
documentation would be greatly appreciated. All of the tutorials and
samples I've located point to transforming single xml source files and
do not deal nor give any direction for hanling multiple xml sources.

Jan 13 '06 #1
4 1986
sy*******@gmail .com wrote:
Hi,

I have a mail server that generates archives in a directory for every
message sent or received and each archive has an associated XML file
with <sender>, <receiver>, <subject> and other email related tags and
all files have same exact format. I would like to generate reports in
a web page based upon the content of these XML files but not sure where
to start. I know how to make an individual XML file display in browser
by linking a stylesheet with xsl and xslt but not sure how to go about
traversing the directory to collect the info and display aggregate
content into a report. Any pointers on a best approach and appropriate
documentation would be greatly appreciated. All of the tutorials and
samples I've located point to transforming single xml source files and
do not deal nor give any direction for hanling multiple xml sources.


Shell is your friend, especially when dealing with "file". Post sample
input you have and output you want. And, we'll go from there.

--
William Park <op**********@y ahoo.ca>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
http://freshmeat.net/projects/bashdiff/
Jan 13 '06 #2
Thanks for the quick reply,

Unfortunately don't currently have access to files in question but I
think I can elaborate further based upon your response.
As noted previously each xml source contains tags for <sender>,
<receiver> and so on, and there on average 5,000 of these files
generated per day. So lets say I don't really care about formatting of
text other than having the contents of all files output to html in
tabular format so I get a listing of all emails transmitted and grouped
by <sender> so I end up with something like. Source file naming
convention is ARCH<msg-id>.XML.

Sent By Received By Subject > Headings
user1 bob test
user1 joe test2
user2 bob ..........

thx

Jan 13 '06 #3
sysxperts <sy*******@gmai l.com> wrote:
Thanks for the quick reply,

Unfortunately don't currently have access to files in question but I
think I can elaborate further based upon your response.
As noted previously each xml source contains tags for <sender>,
<receiver> and so on, and there on average 5,000 of these files
generated per day. So lets say I don't really care about formatting of
text other than having the contents of all files output to html in
tabular format so I get a listing of all emails transmitted and grouped
by <sender> so I end up with something like. Source file naming
convention is ARCH<msg-id>.XML.

Sent By Received By Subject > Headings
user1 bob test
user1 joe test2
user2 bob ..........


Printing out is pretty easy. But, I can't parse the input if I don't
have it.

--
William Park <op**********@y ahoo.ca>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
http://freshmeat.net/projects/bashdiff/
Jan 13 '06 #4
hi,

sy*******@gmail .com wrote:
Hi,

I have a mail server that generates archives in a directory for every
message sent or received and each archive has an associated XML file
with <sender>, <receiver>, <subject> and other email related tags and
all files have same exact format. I would like to generate reports in
a web page based upon the content of these XML files but not sure where
to start. I know how to make an individual XML file display in browser
by linking a stylesheet with xsl and xslt but not sure how to go about
traversing the directory to collect the info and display aggregate
content into a report. Any pointers on a best approach and appropriate
documentation would be greatly appreciated. All of the tutorials and
samples I've located point to transforming single xml source files and
do not deal nor give any direction for hanling multiple xml sources.

hmmm, it is a job for Active Tags !!!

Active Tags allow you to mix easily functional tags with litterals,
almost like XSLT does, but you can simply aggregate several XML files in
a single one

have a look at the RefleX web site, there are complete examples in the
tutorial section
http://reflex.gforge.inria.fr/
RefleX is a Java implementation of Active Tags

a simple Active Sheet looks like this :

<?xml version="1.0" encoding="iso-8859-1"?>
<xcl:active-sheet
xmlns:io="http://www.inria.fr/xml/active-tags/io"
xmlns:xcl="http ://www.inria.fr/xml/active-tags/xcl"

<!-- where are the XML files -->
<xcl:set name="base-dir" value="{ io:file( 'file:///path/to/dir' ) }"/>

<!-- create a single document that contains all the others -->
<xcl:document name="all" type="SAX">
<!--using SAX is better to process a large number of files-->

<document><!--the root element, as a litteral-->
<!-- select all XML files under the base dir -->
<xcl:for-each name="file" select="{
$base-dir//*[@io:is-file][@io:extension=' xml'] }">
<xcl:parse name="xml" source="{ $file }"/>
<!-- put the parsed file in the global document -->
{ $xml }
</xcl:for-each>
</document>
<!--XML to HTML-->
<xcl:transfor m output="file:///path/to/output.html" source="{ $all
}" stylesheet="fil e:///path/to/stylesheet.xsl"/>
<!--if you omit the stylesheet attribute, the XML document
will be simply serialized-->
</xcl:active-sheet>
Of course, by selecting the files, you can create an HTML output per day
or per XML file or a single one according to your needs

There are means to perform the same within a Web server instead of from
the command line like shown above

NOTE : for the moment, the value of the "type" attribute in
<xcl:document > is "SAX" or "DOM", but it might evolve to "event" or
"tree" in a future release, as specified in the documentation of the XCL
module

enjoy !

--
Cordialement,

///
(. .)
--------ooO--(_)--Ooo--------
| Philippe Poulard |
-----------------------------
http://reflex.gforge.inria.fr/
Have the RefleX !
Jan 13 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
9555
by: k.mitz | last post by:
Hi, I have a PHP application that allows users to generate a .pdf report of their database content. Normally, I've had to refresh a page to call the script to generate the report, so there's a second or so when the browser goes blank. I was wondering if it was possible to use AJAX to call the script to generate the report, then begin the download without refreshing the page (or in the case of I.E., leaving me with a blank window that...
4
4706
by: George Kinnear | last post by:
I am working on a project which relies on being able to generate several hundred simple HTML documents, based on records from an Access database. I'm new to VBA, so I'm not sure if it can do what I want - to insert values from the database into HTML (like <p>ValueFromField1</p>) and save the resulting code as .htm files. All I need to know is if it is vaguely possible, or if I should try another method (suggestions welcome!).
4
7338
by: Andrew | last post by:
My VB Application opens an Access Report and has an option to generate the report in PDF once the report is closed. This is accomplished by: - Switching over to the Acrobat Printer (i.e. PDFWriter) from the default printer. - Setting a string type sub key "PDFFilename" in the registry "HKEY_CURRENT_USER\Software\Adobe\Acrobat PDFWriter" to store the PDF in a user selected directory with a filename that's determined by VB codes.
5
3827
by: Hunter Hillegas | last post by:
I have a CSV file with 400,000 lines of email mailing list information that I need to migrate to a new PostgreSQL database. Each line has all the info I need except a PK (I usually use an int4 column for a PK). If the file were smaller I would probably just use Excel to pop in a PK and then just load into the table... Since Excel chokes on files greater than 65k lines, this won't work.
0
2262
by: ward | last post by:
Greetings. Ok, I admit it, I bit off a bit more than I can chew. I need to complete this "Generate Report" page for my employer and I'm a little over my head. I could use some additional assistance. I say additional because I've already had help which is greatly appreciated. I do try to take the time and understand the provided script in hopes on not having to trouble others on those. But here it goes...
1
1287
Coldfire
by: Coldfire | last post by:
Problem background: I am developing a windows application (in VisualStudio.Net 2005) that inserts an Institute Info and based on the query I need to generate a report featuring the Detailed Information of Institute. Description I have been trying to use Crystal Reports to generate reports but I dont want Column based report but Paragraph based report. e.g InstituteName: abcd Coursed Offered: List1: asdasdadjhskajhfdkj
5
70513
by: =?Utf-8?B?a3Jpcw==?= | last post by:
I created a simple webservice .asmx on Visual Studio 2005. As I plan to deploy it to Sharepoint Portal 2003, I copied asmx to \web server extensions\60\ISAPI directory of the server, where all other general webservices reside. Everything is just fine - i can access the service with the browser, method list is displayed as well as help texts for them. my question is - how do I generate .wsdl and .disco files for the service? I read...
2
2771
by: krishnakant Mane | last post by:
hello all, as I posted in my previous thread, I am generating html reports for my client software. I am yet to find a satisfactory module which can help me actually create headings, bold and italics etc without merging html with data variables. any ways I am right now doing the hamd coding myself. may be I have overlooked some module. right now I am in the process of trying templayer. but my main issue is that when I use the
4
1731
by: Nick | last post by:
I have a critical requirement where I need to club together 4 xml files and display them in an sibngle HTML report. The xmls are generated by Java application by a normal file I/O. Is there a way I can club them together in a presentable format for reporting purpose ? So for .g. a.xml, b.xml, c.xml and d.xml. These xmls I want to display in an html report say report.html in a 4 columns in java.
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10324
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10090
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9949
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.