grim/gir-tools
Clone
Summary
Browse
Changes
Graph
Use a better test for micro versions that QuLogic came up with
default
tip
2 months ago, Gary Kramlich
24bd9dad8f11
Use a better test for micro versions that QuLogic came up with
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:gir=
"http://www.gtk.org/introspection/core/1.0"
xmlns:exsl=
"http://exslt.org/common"
version=
"1.0"
exclude-result-prefixes=
"exsl"
extension-element-prefixes=
"exsl"
>
<xsl:output
method=
"text"
/>
<xsl:strip-space
elements=
"*"
/>
<xsl:variable
name=
"newline"
select=
"' '"
/>
<xsl:variable
name=
"tab"
select=
"'	'"
/>
<xsl:variable
name=
"newline-tab"
>
<xsl:value-of
select=
"$newline"
/>
<xsl:value-of
select=
"$tab"
/>
</xsl:variable>
<xsl:template
match=
"gir:property"
>
<xsl:value-of
select=
"@name"
/>
<xsl:text
>
:
</xsl:text>
<xsl:value-of
select=
"gir:type/@name"
/>
<xsl:text
>
<
br/
>
</xsl:text>
</xsl:template>
<xsl:template
match=
"gir:parameter"
>
<xsl:value-of
select=
"@name"
/>
<xsl:text
>
:
</xsl:text>
<xsl:value-of
select=
"gir:type/@name"
/>
</xsl:template>
<xsl:template
match=
"gir:instance-parameter"
/>
<xsl:template
match=
"gir:parameters"
>
<xsl:apply-templates
select=
"(gir:instance-parameter|gir:parameter)"
/>
</xsl:template>
<xsl:template
name=
"common-method"
>
<xsl:param
name=
"name"
/>
<xsl:value-of
select=
"$name"
/>
<xsl:text
>
(
</xsl:text>
<xsl:apply-templates
select=
"gir:parameters"
/>
<xsl:text
>
)
</xsl:text>
<xsl:if
test=
"gir:return-value"
>
<xsl:text
>
:
</xsl:text>
<xsl:value-of
select=
"gir:return-value/gir:type/@name"
/>
</xsl:if>
<xsl:text
>
<
br/
>
</xsl:text>
</xsl:template>
<xsl:template
match=
"gir:method"
>
<xsl:call-template
name=
"common-method"
>
<xsl:with-param
name=
"name"
select=
"@name"
/>
</xsl:call-template>
</xsl:template>
<xsl:template
match=
"gir:virtual-method"
>
<xsl:variable
name=
"name"
>
<xsl:text
>
<
i
>
</xsl:text>
<xsl:value-of
select=
"@name"
/>
<xsl:text
>
<
/i
>
</xsl:text>
</xsl:variable>
<xsl:call-template
name=
"common-method"
>
<xsl:with-param
name=
"name"
select=
"$name"
/>
</xsl:call-template>
</xsl:template>
<xsl:template
match=
"gir:class"
>
<xsl:variable
name=
"filename"
>
<xsl:value-of
select=
"@name"
/>
<xsl:text
>
.dot
</xsl:text>
</xsl:variable>
<exsl:document
href=
"{$filename}"
method=
"text"
>
<xsl:text
>
digraph
{
</xsl:text>
<xsl:value-of
select=
"$newline-tab"
/>
<xsl:value-of
select=
"$tab"
/>
<xsl:value-of
select=
"@name"
/>
<xsl:text
>
[shape="plaintext"
label=
<<
table
BORDER="0"
CELLBORDER="1"
CELLSPACING="0"
CELLPADDING="2"
>
</xsl:text>
<xsl:text
>
<
tr
><
td
>
</xsl:text>
<xsl:value-of
select=
"@name"
/>
<xsl:if
test=
"@abstract = '1'"
>
<xsl:text
>
<
br/
><
i
>
abstract
<
/i
>
</xsl:text>
</xsl:if>
<xsl:text
>
<
/td
><
/tr
>
</xsl:text>
<xsl:text
>
<
tr
><
td
ALIGN="LEFT"
BALIGN="LEFT"
>
</xsl:text>
<xsl:apply-templates
select=
"gir:property"
/>
<xsl:text
>
<
/td
><
/tr
>
</xsl:text>
<xsl:text
>
<
tr
><
td
ALIGN="LEFT"
BALIGN="LEFT"
>
</xsl:text>
<xsl:apply-templates
select=
"(gir:method|gir:virtual-method)"
/>
<xsl:text
>
<
/td
><
/tr
>
</xsl:text>
<xsl:text
>
<
/table
>>
]
</xsl:text>
<xsl:value-of
select=
"$newline"
/>
<xsl:value-of
select=
"$newline"
/>
<xsl:text
>
}
</xsl:text>
<xsl:value-of
select=
"$newline"
/>
</exsl:document>
</xsl:template>
<xsl:template
match=
"gir:namespace"
>
<xsl:apply-templates
select=
"gir:class"
/>
</xsl:template>
<xsl:template
match=
"gir:repository"
>
<xsl:apply-templates
select=
"gir:namespace"
/>
</xsl:template>
<xsl:template
match=
"/"
>
<xsl:apply-templates
select=
"gir:repository"
/>
</xsl:template>
</xsl:stylesheet>