[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XSL to analyse some XML log files

Subject: RE: XSL to analyse some XML log files
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 4 Dec 2005 09:05:43 -0000
xml log files
> I would like to do the following and hope that you can help me:
> 
> 1) Generate another XML file that does not contain logs 
> (<log> tag defines a
> log) that belong to the test mode (<change> tag with value 
> "mode TEST").
> That means all log files between the test mode and any other mode.

<xsl:copy-of select="log[not(change='TEST' or (not(change) and
(preceding-sibling::log/change)[last()]='TEST')))]"/>
> 
> 2) Generate one XML file for each mode, one for "mode TEST", 
> one of "mode
> A", one for "mode B") with all the logs that belong to each 
> mode. That means
> e.g. that all the logs after <change>mode B</change> are 
> stored into the
> "mode B" file, equeally for the others.

This is a classic grouping problem (www.jenitennison.com/xslt/grouping) in
which the grouping key is the most recent CHANGE element, calculated as
above. In XSLT 2.0

<xsl:for-each-group select="log"
group-by="((.|preceding-sibling::log)/change)[last()]"/>

> 
> 3) Calcuate the time difference in seconds (<time> value is 
> also provide in
> seconds) between the <useraction>Start</useraction> and the
> <useraction>Stop</useraction> of the "mode A".
> 
I'll pass on that one, got to be off to Mass.

Michael Kay
http://www.saxonica.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.