All pastes #147731 Raw Edit

Anonymous

public text v1 · immutable
#147731 ·published 2006-08-24 16:24 UTC
rendered paste body
XSL Template:

    <xsl:template match="cat">
        <xsl:if test="methods">
            <li class="direct_parent"><xsl:value-of select="@value"/>
                <ul>
                    <xsl:apply-templates/>
                </ul>
            </li>                    
        </xsl:if>
        <xsl:if test="not(methods)">
            <li><xsl:value-of select="@value"/>
                <ul>
                    <xsl:apply-templates/>
                </ul>
            </li>                
        </xsl:if>
    </xsl:template>

XML:

<cat value="jQuery">
 <methods short='Adds each of the Elements in the array to the set of matched elements.' type='jQuery' name='add' cat='jQuery'>
  <params type='Array&lt;Element&gt;' name='els'>
   <desc>An array of Elements to add</desc>
  </params>
  <desc>Adds each of the Elements in the array to the set of matched elements.
   This is used to add a set of Elements to a jQuery object.</desc>
  <examples>
   <code>$("p").add([document.getElementById("a"), document.getElementById("b")])</code>
   <result>[ &lt;p&gt;Hello&lt;/p&gt;, &lt;span id="a"&gt;Hello Again&lt;/span&gt;, &lt;span id="b"&gt;And Again&lt;/span&gt; ]</result>
   <before>&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;&lt;span id="a"&gt;Hello Again&lt;/span&gt;&lt;span id="b"&gt;And Again&lt;/span&gt;&lt;/p&gt;</before>
  </examples>
 </methods>
</cat>


<cat value="DOM">
 <cat value="Attributes">
  <methods short='Get the current value of the first matched element.' type='String' name='val' cat='DOM/Attributes'>
   <desc>Get the current value of the first matched element.</desc>
   <examples>
    <code>$("input").val();</code>
    <result>"some text"</result>
    <before>&lt;input type="text" value="some text"/&gt;</before>
   </examples>
  </methods>
 </cat>
</cat>