grim/purple-objects-docbook
created class.xsl to turn an xml formatted .class file into input suitable for graphviz
created plugin.class based off of plugin-class.dot
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/class.xsl Fri Apr 17 22:55:04 2009 -0500
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <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"/> + <!-- scope template --> + <xsl:template name="scope"> + <xsl:when test="@scope = 'private'"> + <xsl:when test="@scope = 'public'"> + <xsl:when test="@scope = 'protected'"> + <!-- the actual matching --> + <xsl:template match="class"> + <!-- start the diagram --> + <xsl:text>digraph {</xsl:text> + <xsl:value-of select="$newline-tab"/> + <!-- set our node settings --> + <xsl:text>node[fontname="sans", fontsize="9", shape="record", style="filled", fillcolor="lightyellow"];</xsl:text> + <xsl:value-of select="$newline-tab"/> + <!-- handle the beginning of the class node --> + <xsl:text>class[label="{</xsl:text> + <xsl:value-of select="@name"/> + <!-- if the class is abstract, mark it as such --> + <xsl:if test="@abstract"> + <xsl:text>\n\<\< abstract \>\></xsl:text> + <!-- run through the properties --> + <xsl:for-each select="properties/property"> + <xsl:call-template name="scope"/> + <!-- now the rest of the property --> + <xsl:value-of select="@name"/> + <xsl:text> : </xsl:text> + <xsl:value-of select="@type"/> + <xsl:text>\l</xsl:text> + <!-- run through the methods --> + <xsl:for-each select="methods/method"> + <xsl:call-template name="scope"/> + <!-- start the method --> + <xsl:value-of select="@name"/> + <!-- start the arguments --> + <!-- run through the arguments --> + <xsl:for-each select="argument"> + <!-- put a comment at the end of the last text if this isn't + <xsl:if test="position() > 1"> + <xsl:text>, </xsl:text> + <xsl:value-of select="@name"/> + <xsl:text> : </xsl:text> + <xsl:value-of select="@type"/> + <!-- finish the arguments --> + <xsl:text>\l</xsl:text> + <!-- finish off the class node --> + <xsl:text>}"];</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/plugin.class Fri Apr 17 22:55:04 2009 -0500
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?> +<class name="PurplePlugin" abstract="true"> + <property name="state" type="PurplePluginState" scope="private"/> + <property name="filename" type="gchar *" scope="private"/> + <property name="info" type="PurplePluginInfo" scope="private"/> + <method name="purple_plugin_get_state" type="PurplePluginState" scope="public"> + <argument name="plugin" type="const PurplePlugin *"/> + <method name="purple_plugin_get_filename" type="const gchar *" scope="public"> + <argument name="plugin" type="const PurplePlugin *"/> + <method name="purple_plugin_get_info" type="PurplePluginInfo *" scope="public"> + <argument name="plugin" type="const PurplePlugin *"/>