<?xml version="1.0" encoding="utf-8"?><!-- DWXMLSource="report.xml" --><!DOCTYPE xsl:stylesheet  [
	<!ENTITY nbsp   "&#160;">
	<!ENTITY copy   "&#169;">
	<!ENTITY reg    "&#174;">
	<!ENTITY trade  "&#8482;">
	<!ENTITY mdash  "&#8212;">
	<!ENTITY ldquo  "&#8220;">
	<!ENTITY rdquo  "&#8221;"> 
	<!ENTITY pound  "&#163;">
	<!ENTITY yen    "&#165;">
	<!ENTITY euro   "&#8364;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
<xsl:template match="/">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Opera Preferences Report</title>

<style type="text/css" media="all">
body {
	font-family: Geneva, Arial, Helvetica, sans-serif;
}


/* Tables */

table, td, th {
	border: none;
	empty-cells: show;
	border-collapse: collapse;
	border-color: #CCC;
	border-width: 1px;
}

table {
	margin-bottom: 1em;
	*margin-bottom: 0;
	*margin-top: 1em;
	border-bottom-style: solid;
	*border-top: 3px solid #BBB;
}

thead {
	border-top: 3px solid #BBB;
}

td, th {
/*	border-left-style: solid; */
	padding: .25em .5em
}

th {
/*	border-left: 1px solid #BBB; */
	background: #CCC;
}

table table th,
tbody th {
    background: #DDD;
}

td:first-child,
th:first-child {
	border-left: none;
}

tfoot {
	display: none;
}

td {
	vertical-align: top;
}

table caption {
	text-align: left;
/*	padding: .35em;*/
	font-weight: bold;
	color: #FFF;
	overflow: hidden;
	white-space: nowrap;
}

table caption span {
	background: #BBB;
	padding: .25em .5em;
	display: block;
	float:left;
}





.zebra tbody tr { background-color: #FFF }
/*.zebra tbody tr:nth-child(even) { background: #F5F5F5 }*/ /* It suppose to fill even rows in tables... Maybe some day in a future */
.zebra tbody tr.altrow { background-color: #F5F5F5 }

.zebra tbody tr:hover { background-color: #0FF }

.zebra tbody tr.highlight:hover,
.zebra tbody tr.altrow.highlight:hover { background-color: yellow }



.zebra tbody tr.attn { background-color: #FFD9DF }
.zebra tbody tr.altrow.attn { background-color: #FFCED5 }

.zebra tbody tr.attn.highlight { background-color: #FFB428 }
.zebra tbody tr.altrow.attn.highlight { background-color: Orange }


.zebra tbody tr.highlight { background-color: #ff9 }
.zebra tbody tr.altrow.highlight { background-color: #ff6 }


.zebra tbody tr.attn:hover,
.zebra tbody tr.attn.highlight:hover,
.zebra tbody tr.attn:hover a
{ background-color: #00008B; color: white }

.zebra tbody tr.removed,
.zebra tbody tr.removed a { color: #CCC }

.zebra tbody th { background: #CCC; text-align: left; vertical-align: top }
.zebra tbody th.altrow { background: #BBB }

</style>

</head>

<body>

<xsl:apply-templates/>

</body>
</html>

</xsl:template>


<xsl:template match="preferences">
<table border="1" class="zebra">
	<colgroup>
		<col align="left" />
		<col align="left" />
		<col align="right" />
	</colgroup>
	<thead>
		<tr>
			<th>Section</th>
			<th>Feature</th>
			<th>Value</th>
		</tr>
	</thead>
	<tbody>
		<xsl:for-each select="section/value">
			<xsl:element name="tr">
				<xsl:if test="position() mod 2 = 0">
					<xsl:attribute name="class">altrow</xsl:attribute>
				</xsl:if>
				<xsl:if test="parent::section/value[1]/@id = @id">
					<xsl:element name="th">
						<xsl:if test="count(parent::section/value) > 1">
							<xsl:attribute name="rowspan"><xsl:value-of select="count(parent::section/value)"/></xsl:attribute>
						</xsl:if>
						<xsl:if test="count(parent::section/preceding-sibling::section) mod 2 = 0">
							<xsl:attribute name="class">altrow</xsl:attribute>
						</xsl:if>
						<xsl:value-of select="parent::section/@id"/>
					</xsl:element>
				</xsl:if>
				<td><xsl:value-of select="@id"/></td>
				<td>
					<strong>
						<xsl:choose>
							<xsl:when test="@id = 'LastCreatedBookmark'
							             or @id = 'LastCreatedContact'
							             or @id = 'LastCreatedWidget'
							             or @id = 'LastCreatedNote'
							             or @id = 'FirstInstall'
							             ">
								<xsl:call-template name="date-iso-from-unix">
									<xsl:with-param name="unix_timestamp" select="text()"/>
								</xsl:call-template>
							</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="text()"/>
							</xsl:otherwise>
						</xsl:choose>
					</strong>
				</td>
			</xsl:element>
		</xsl:for-each>
	</tbody>
</table>
</xsl:template>


<xsl:template name="date-iso-from-unix">
	<xsl:param name="unix_timestamp"/>
	<xsl:variable name="jd19700101" select="2440588"/>
	<xsl:call-template name="float-to-date-time">
		<xsl:with-param name="value" select="$jd19700101 + ($unix_timestamp div(24 * 60 * 60))"/>
	</xsl:call-template>
</xsl:template>

<!--
==========================================================================
Template: float-to-date-time
Description:
  Convert a floating point value representing a date/time to a date/time string.
Parameters:
<value> the value to be converted
<round-seconds> if true then the seconds are not quoted on the output and,
  if the seconds are 59 then hour/minute is rounded (this is useful because some processors
  have limited floating point precision to cope with the seconds)
==========================================================================
-->

<xsl:template name="float-to-date-time">
	<xsl:param name="value" select="number(0)"/>
	<xsl:param name="round-seconds" select="false()"/>
	<xsl:variable name="date">
		<xsl:call-template name="julian-day-to-date">
			<xsl:with-param name="julian-day" select="floor($value)"/>
		</xsl:call-template>
	</xsl:variable>
	<xsl:variable name="t1" select="$value - floor($value)"/>
	<xsl:variable name="h" select="floor($t1 div (1 div 24))"/>
	<xsl:variable name="t2" select="$t1 - ($h * (1 div 24))"/>
	<xsl:variable name="m" select="floor($t2 div (1 div 1440))"/>
	<xsl:variable name="t3" select="$t2 - ($m * (1 div 1440))"/>
	
	<xsl:choose>
		<xsl:when test="$round-seconds">
			<xsl:variable name="s" select="$t3 div (1 div 86400)"/>
			<xsl:variable name="h2">
				<xsl:choose>
					<xsl:when test="($s &gt;= 59) and ($m = 59)"><xsl:value-of select="$h + 1"/></xsl:when>
					<xsl:otherwise><xsl:value-of select="$h"/></xsl:otherwise>
				</xsl:choose>
			</xsl:variable>
			<xsl:variable name="m2">
				<xsl:choose>
					<xsl:when test="($s &gt;= 59) and ($m = 59)">0</xsl:when>
					<xsl:when test="($s &gt;= 59)"><xsl:value-of select="$m + 1"/></xsl:when>
					<xsl:otherwise><xsl:value-of select="$m"/></xsl:otherwise>
				</xsl:choose>
			</xsl:variable>
			<!-- pad final time result -->
			<xsl:variable name="hh" select="concat(substring('00',1,2 - string-length(string($h2))),string($h2))"/>
			<xsl:variable name="mm" select="concat(substring('00',1,2 - string-length(string($m2))),string($m2))"/>
			<!-- final output resultant -->
			<xsl:value-of select="concat($date,'T',$hh,':',$mm)"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:variable name="s" select="floor($t3 div (1 div 86400))"/>
			<!-- pad final time result -->
			<xsl:variable name="hh" select="concat(substring('00',1,2 - string-length(string($h))),string($h))"/>
			<xsl:variable name="mm" select="concat(substring('00',1,2 - string-length(string($m))),string($m))"/>
			<xsl:variable name="ss" select="concat(substring('00',1,2 - string-length(string($s))),string($s))"/>
			<!-- final output resultant -->
			<xsl:value-of select="concat($date,'T',$hh,':',$mm,':',$ss)"/>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>

<!--
==========================================================================
Template: julian-day-to-date
Description:
  Convert a julian day to date
Parameters:
  <julian-day>
==========================================================================
-->

<xsl:template name="julian-day-to-date">
	<xsl:param name="julian-day" select="number(0)"/>
	<!-- pre-calcs -->
	<xsl:variable name="la" select="$julian-day + 68569"/>
	<xsl:variable name="n" select="floor((4 * $la) div 146097)"/>
	<xsl:variable name="lb" select="$la - floor((146097 * $n + 3) div 4)"/>
	<xsl:variable name="i" select="floor((4000 * ($lb + 1)) div 1461001)"/>
	<xsl:variable name="lc" select="$lb - floor((1461 * $i) div 4) + 31"/>
	<xsl:variable name="j" select="floor((80 * $lc) div 2447)"/>
	<xsl:variable name="day" select="$lc - floor((2447 * $j) div 80)"/>
	<xsl:variable name="ld" select="floor($j div 11)"/>
	<xsl:variable name="month" select="$j + 2 - (12 * $ld)"/>
	<xsl:variable name="year" select="100 * ($n - 49) + $i + $ld"/>
	<!-- whole days -->
	<xsl:variable name="iday" select="floor($day)"/>
	<!-- pad final result -->
	<xsl:variable name="sday" select="concat(substring('00',1,2 - string-length(string($iday))),string($iday))"/>
	<xsl:variable name="smonth" select="concat(substring('00',1,2 - string-length(string($month))),string($month))"/>
	<xsl:variable name="syear" select="concat(substring('00',1,4 - string-length(string($year))),string($year))"/>
	<!-- final output -->
	<xsl:value-of select="concat($syear,'-',$smonth,'-',$sday)"/>
</xsl:template>


</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2006. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="report.xml" htmlbaseurl="" outputurl="" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no" ><SourceSchema srcSchemaPath="report.xml" srcSchemaRoot="preferences" AssociatedInstance="" loaderFunction="document" loaderFunctionUsesURI="no"/></MapperInfo><MapperBlockPosition><template match="/"></template><template match="section"></template></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->