Topic: how do u use keys to group, the following code doesn't work for me... (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=25504" title="Pages that link to Topic: how do u use keys to group, the following code doesn&amp;#039;t work for me... (Page 1 of 1)" rel="nofollow" >Topic: how do u use keys to group, the following code doesn&#039;t work for me... <span class="small">(Page 1 of 1)</span>\

 
shaned
Neurotic (0) Inmate
Newly admitted

From:
Insane since: Apr 2005

posted posted 04-13-2005 17:47

I would expect

TestMachine_1

11.000.51
Stand Alone


TestMachine_2

11.000.51
Stand Alone

But the second set of build info doesn't appear.

any ideas?

I'm trying to group by:

machine
build
suite
script


code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="Events.xsl"?>
<logStart>
<events>
<event id="host">
<date_time>2005-04-11 16:11:41.641</date_time>
<host_address>111.16.33.113</host_address>
<host_name>TestMachine_1</host_name>
<jre_version>1.4.1_01</jre_version>
<os_name>Windows 2000</os_name>
<os_version>5.0</os_version>
<screen_rez>1024x768</screen_rez>
<user_name>peterson</user_name>
<timezone>BST</timezone>
</event>
<event id="info_event">
<date_time>2005-04-11 16:11:39.579</date_time>
<message>info event 1 1</message>
<script>AutomationUnitTests.UnitTest_EventLog1(1)</script>
<suite>independent</suite>
<build>Stand Alone</build>
</event>
<event id="info_event">
<date_time>2005-04-11 16:11:39.579</date_time>
<message>info event 1 2</message>
<script>AutomationUnitTests.UnitTest_EventLog1(1)</script>
<suite>independent</suite>
<build>Stand Alone</build>
</event>
<event id="info_event">
<date_time>2005-04-11 16:11:39.579</date_time>
<message>info event 1 3</message>
<script>AutomationUnitTests.UnitTest_EventLog1(2)</script>
<suite>independent2</suite>
<build>Stand Alone</build>
</event>
<event id="info_event">
<date_time>2005-04-11 16:11:39.579</date_time>
<message>info event 1 4</message>
<script>AutomationUnitTests.UnitTest_EventLog1(3)</script>
<suite>independent</suite>
<build>11.000.51</build>
</event>

</events>

<events>
<event id="host">
<date_time>2005-04-11 16:11:41.641</date_time>
<host_address>111.16.33.114</host_address>
<host_name>TestMachine_2</host_name>
<jre_version>1.4.1_01</jre_version>
<os_name>Windows 2000</os_name>
<os_version>5.0</os_version>
<screen_rez>1024x768</screen_rez>
<user_name>peterson</user_name>
<timezone>BST</timezone>
</event>
<event id="info_event">
<date_time>2005-04-11 16:11:39.579</date_time>
<message>info event 2 1</message>
<script>AutomationUnitTests.UnitTest_EventLog1(1)</script>
<suite>independent</suite>
<build>Stand Alone</build>
</event>
<event id="info_event">
<date_time>2005-04-11 16:11:39.579</date_time>
<message>info event 2 2</message>
<script>AutomationUnitTests.UnitTest_EventLog1(1)</script>
<suite>independent</suite>
<build>Stand Alone</build>
</event>
<event id="info_event">
<date_time>2005-04-11 16:11:39.579</date_time>
<message>info event 2 3</message>
<script>AutomationUnitTests.UnitTest_EventLog1(2)</script>
<suite>independent2</suite>
<build>Stand Alone</build>
</event>
<event id="info_event">
<date_time>2005-04-11 16:11:39.579</date_time>
<message>info event 2 4</message>
<script>AutomationUnitTests.UnitTest_EventLog1(3)</script>
<suite>independent</suite>
<build>11.000.51</build>
</event>
<event id="info_event">
<date_time>2005-04-11 16:11:39.579</date_time>
<message>info event 2 5</message>
<script>AutomationUnitTests.UnitTest_EventLog1(3)</script>
<suite>independent</suite>
<build>11.000.51</build>
</event>
<event id="xde_error_event">
<date_time>2005-04-11 16:19:59.766</date_time>
<aut_title>AUT pid not available.</aut_title>
<message>Now an XDE Error has occured.</message>
<screen_dump>
<date_time>2005-04-11 16:19:59.766</date_time>
<file_path>C:/images/AutomationUnitTests.UnitTest_EventLog1_20050411_161959766.jpg</file_path>
</screen_dump>
<script>AutomationUnitTests.UnitTest_EventLog1(2)</script>
<suite>independent</suite>
<build>Stand Alone</build>
</event>
</events>

</logStart>



<!--
File : Events.xsl

-->
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:key name="listBuilds" match="event" use="build" />

<xsl:template match="/">
<html>
<head>
<title>test</title>
</head>
<body>
<h1>Testing Logs</h1>
<br/>

<xsl:apply-templates select="logStart/events" />

</body>
</html>
</xsl:template>

<xsl:template match="events">

<xsl:value-of select="./event[@id = 'host']/host_name" /><br/><br/>

<xsl:for-each select="event[count(. | key('listBuilds', build)[1]) = 1]" >
<xsl:sort select="build" />

<xsl:value-of select="build"/><br/>

</xsl:for-each>

<br/><br/>

</xsl:template>

</xsl:stylesheet>

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 04-14-2005 22:17

After a quick look, it looks like you're doing things right. Are you sure the template's not being called and just not outputting anything? I'm not really sure what's wrong. Could you upload the xml/xslt files so we could actually see them in action?


 



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu