1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4 <xsl:output method="xml" indent="yes" />
6 <!-- TODO convert @type array notation to bracket notation, eg. Array<DOMElement> to [DOMElement] -->
7 <xsl:template match="/*">
8 <api xmlns="http://openajax.org/metadata">
11 <xsl:for-each select="//function[@name='jQuery']">
13 <shortDescription><xsl:value-of select="desc" /></shortDescription>
14 <description><xsl:value-of select="longdesc" /></description>
15 <xsl:call-template name="parameters" />
16 <returnType datatype="{@return}" />
17 <xsl:call-template name="examples" />
22 <xsl:for-each select="//property">
23 <xsl:sort select="translate(@name,'$.','')"/>
24 <xsl:sort select="count(params)"/>
25 <property name="{@name}" readonly="true" datatype="{@return}" default="">
26 <xsl:call-template name="scope" />
27 <shortDescription><xsl:value-of select="desc" /></shortDescription>
28 <description><xsl:value-of select="longdesc" /></description>
29 <xsl:call-template name="examples" />
34 <xsl:for-each select="//function[@name!='jQuery']">
35 <xsl:sort select="translate(@name,'$.','')"/>
36 <xsl:sort select="count(params)"/>
37 <method name="{@name}">
38 <xsl:call-template name="scope" />
39 <shortDescription><xsl:value-of select="desc" /></shortDescription>
40 <description><xsl:value-of select="longdesc" /></description>
41 <xsl:call-template name="parameters" />
42 <returnType datatype="{@return}" />
43 <xsl:call-template name="examples" />
51 <xsl:template name="scope">
52 <xsl:attribute name="scope">
54 <xsl:when test="starts-with(@name, 'jQuery.')">static</xsl:when>
55 <xsl:when test="not(starts-with(@name, 'jQuery.'))">instance</xsl:when>
60 <xsl:template name="parameters">
62 <xsl:for-each select="params">
63 <parameter name="{@name}" datatype="{@type}">
64 <xsl:attribute name="usage">
66 <xsl:when test="not(@optional)">required</xsl:when>
67 <xsl:when test="@optional">optional</xsl:when>
70 <description><xsl:value-of select="desc" /></description>
71 <!-- TODO part of the spec, but with a very different interpretation -->
73 <xsl:when test="../option">
75 <xsl:for-each select="../option">
76 <property name="{@name}" datatype="{@type}" default="{@default}">
77 <description><xsl:value-of select="desc" /></description>
88 <xsl:template name="examples">
90 <xsl:for-each select="example">
92 <description><xsl:value-of select="desc" /></description>
93 <xsl:copy-of select="code|html|css" />