1 <?xml version=
"1.0" encoding=
"iso-8859-15"?>
5 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
6 xmlns:
hop=
"http://www.helma.org/docs/guide/features/database"
9 <xsl:output method=
"html"/>
11 <xsl:variable name=
"id" select=
"/xmlroot/hopobject/@id"/>
12 <xsl:variable name=
"name" select=
"/xmlroot/hopobject/@name"/>
13 <xsl:variable name=
"prototype" select=
"/xmlroot/hopobject/@prototype"/>
14 <xsl:variable name=
"parent" select=
"/xmlroot/hopobject/hop:parent"/>
15 <xsl:variable name=
"children" select=
"/xmlroot/hopobject/hop:child"/>
17 <xsl:template match=
"/">
20 <title><xsl:value-of select=
"$id"/>.xml (Hop XML Database File)
</title>
21 <meta http-equiv=
"Content-Type" content=
"text/html; charset=iso-8859-15" />
23 <body bgcolor=
"white">
25 <!-- main navigation -->
27 <xsl:if test=
"$id = 0">root
</xsl:if>
28 <xsl:if test=
"$id > 0">
29 <a href=
"0.xml">root
</a> : HopObject
<xsl:value-of select=
"$id"/>
34 <table border=
"0" cellspacing=
"1" cellpadding=
"5" bgcolor=
"gray">
40 <!-- _name, _prototype and _parent properties -->
42 <xsl:call-template name=
"getOutputItem">
43 <xsl:with-param name=
"name">_name
</xsl:with-param>
44 <xsl:with-param name=
"value" select=
"$name"/>
47 <xsl:if test=
"$prototype">
48 <xsl:call-template name=
"getOutputItem">
49 <xsl:with-param name=
"name">_prototype
</xsl:with-param>
50 <xsl:with-param name=
"value" select=
"$prototype"/>
53 <xsl:if test=
"$parent">
54 <xsl:call-template name=
"getOutputItem">
55 <xsl:with-param name=
"name">_parent
</xsl:with-param>
56 <xsl:with-param name=
"value">
57 HopObject
<xsl:value-of select=
"$parent/@idref"/>
59 <xsl:with-param name=
"href">
60 <xsl:value-of select=
"$parent/@idref"/>.xml
65 <!-- _children collection -->
66 <xsl:if test=
"count($children) > 0">
68 <td valign=
"top" nowrap=
"nowrap">_children
</td>
70 <xsl:for-each select=
"$children">
71 <xsl:sort select=
"@idref" data-type=
"number"/>
72 <a href=
"{@idref}.xml"><nowrap><xsl:value-of select=
"@prototyperef"/>
73 <xsl:text> </xsl:text><xsl:value-of select=
"@idref"/></nowrap></a>
74 <xsl:if test=
"position() < count($children)">
75 <xsl:text>,
</xsl:text>
82 <!-- primitive properties -->
83 <xsl:for-each select=
"/xmlroot/hopobject/*">
84 <xsl:sort select=
"concat(@propertyname, name())"/>
86 <xsl:when test=
"name() = 'hop:parent'"/>
87 <xsl:when test=
"name() = 'hop:child'"/>
88 <xsl:when test=
"@idref">
89 <xsl:call-template name=
"getOutputItem">
90 <xsl:with-param name=
"name">
91 <xsl:call-template name=
"getPropertyName"/>
93 <xsl:with-param name=
"value">
94 HopObject
<xsl:value-of select=
"@idref"/>
96 <xsl:with-param name=
"href">
97 <xsl:value-of select=
"@idref"/>.xml
102 <xsl:call-template name=
"getOutputItem">
103 <xsl:with-param name=
"name">
104 <xsl:call-template name=
"getPropertyName"/>
106 <xsl:with-param name=
"value"><xsl:value-of select=
"text()"/></xsl:with-param>
117 <!-- helper template to compose a hopobject's name -->
118 <xsl:template name=
"getName">
119 <xsl:param name=
"name"/>
121 <xsl:when test=
"substring-after($name, 'HopObject ') = '0'">
125 <xsl:value-of select=
"$name"/>
130 <!-- helper template to compose a property's name: if the element's
131 name is "property", the property name is in an attribute called
132 "propertyname". Otherwise, the element name is the element's name -->
133 <xsl:template name=
"getPropertyName">
135 <xsl:when test=
"name() = 'property'">
136 <xsl:value-of select=
"@propertyname"/>
139 <xsl:value-of select=
"name()"/>
144 <!-- helper template to compose a table row containing a property's data -->
145 <xsl:template name=
"getOutputItem">
146 <xsl:param name=
"name"/>
147 <xsl:param name=
"value"/>
148 <xsl:param name=
"href"/>
150 <xsl:variable name=
"display">
151 <xsl:call-template name=
"getName">
152 <xsl:with-param name=
"name" select=
"$value"/>
157 <td valign=
"top" nowrap=
"nowrap"><xsl:value-of select=
"$name"/></td>
159 <xsl:when test=
"$href">
160 <a href=
"{$href}"><xsl:value-of select=
"$display"/></a>
163 <xsl:value-of select=
"$display"/>