Skip to content

Commit 7970a0e

Browse files
committed
Moved notes into XSL, removes need for pre-processing.
1 parent 36b9aea commit 7970a0e

13 files changed

+43
-71
lines changed

entries2html.xsl

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<div class="longdesc">
6262
<ul>
6363
<xsl:for-each select="note">
64-
<li><xsl:apply-templates select="."/></li>
64+
<li><xsl:call-template name="note"/></li>
6565
</xsl:for-each>
6666
</ul>
6767
</div>
@@ -252,23 +252,6 @@
252252
</p>
253253
</xsl:template>
254254

255-
<!--
256-
Notes
257-
-->
258-
<xsl:template match="@* | note/node()">
259-
<xsl:copy>
260-
<xsl:apply-templates select="@* | node()"/>
261-
</xsl:copy>
262-
</xsl:template>
263-
<xsl:template match="note/note">
264-
<xsl:apply-templates select="@* | node()"/>
265-
</xsl:template>
266-
<xsl:template match="note//placeholder">
267-
<xsl:variable name="name" select="concat('data-',@name)"/>
268-
<xsl:value-of select="ancestor::note/@*[name()=$name]"/>
269-
</xsl:template>
270-
271-
272255
<!--
273256
Render type(s) for an argument element.
274257
Type can either by a @type attribute or one or more <type> child elements.
@@ -517,6 +500,48 @@
517500
</ul>
518501
</xsl:template>
519502

503+
<!--
504+
Notes
505+
TODO: Move into notes.xsl and pull in via <xsl:import>
506+
-->
507+
<xsl:template name="note">
508+
<xsl:choose>
509+
<xsl:when test="@id = 'document-order'">
510+
Selected elements are in the order of their appearance in the document.
511+
</xsl:when>
512+
<xsl:when test="@id = 'domlint'">
513+
Forms and their child elements should not use input names or ids that conflict with properties of a form, such as <code>submit</code>, <code>length</code>, or <code>method</code>. Name conflicts can cause confusing failures. For a complete list of rules and to check your markup for these problems, see <a href="http://kangax.github.com/domlint/">DOMLint</a>.
514+
</xsl:when>
515+
<xsl:when test="@id = 'jquery-selector-extension'">
516+
Because <code><xsl:value-of select="@data-selector"/></code> is a jQuery extension and not part of the CSS specification, queries using <code><xsl:value-of select="@data-selector"/></code> cannot take advantage of the performance boost provided by the native DOM <code>querySelectorAll()</code> method. To achieve the best performance when using <code><xsl:value-of select="@data-selector"/></code> to select elements, first select the elements using a pure CSS selector, then use <a href="http://api.jquery.com/filter/"><code>.filter("<xsl:value-of select="@data-selector"/>")</code></a>.
517+
</xsl:when>
518+
<xsl:when test="@id = 'jquery-selector-extension-alt'">
519+
Because <code><xsl:value-of select="@data-selector"/></code> is a jQuery extension and not part of the CSS specification, queries using <code><xsl:value-of select="@data-selector"/></code> cannot take advantage of the performance boost provided by the native DOM <code>querySelectorAll()</code> method. For better performance in modern browsers, use <code><xsl:value-of select="@data-alt"/></code> instead.
520+
</xsl:when>
521+
<xsl:when test="@id = 'jquery.fx.off'">
522+
All jQuery effects, including <code><xsl:value-of select="@data-title"/></code>, can be turned off globally by setting <code>jQuery.fx.off = true</code>, which effectively sets the duration to 0. For more information, see <a href="http://api.jquery.com/jquery.fx.off">jQuery.fx.off</a>.
523+
</xsl:when>
524+
<xsl:when test="@id = 'no-data-on-xml'">
525+
Note that this method currently does not provide cross-platform support for setting data on XML documents, as Internet Explorer does not allow data to be attached via expando properties.
526+
</xsl:when>
527+
<xsl:when test="@id = 'prop-memory-leaks'">
528+
In Internet Explorer prior to version 9, using <code><a href="http://api.jquery.com/prop/">.prop()</a></code> to set a DOM element property to anything other than a simple primitive value (number, string, or boolean) can cause memory leaks if the property is not removed (using <a href="http://api.jquery.com/removeProp/"><code>.removeProp()</code></a>) before the DOM element is removed from the document. To safely set values on DOM objects without memory leaks, use <a href="http://api.jquery.com/data/"><code>.data()</code></a>.
529+
</xsl:when>
530+
<xsl:when test="@id = 'propagation-for-live-or-delegate'">
531+
Since the <a href="http://api.jquery.com/live"><code>.live()</code></a> method handles events once they have propagated to the top of the document, it is not possible to stop propagation of live events. Similarly, events handled by <code><a href="http://api.jquery.com/delegate/">.delegate()</a></code> will propagate to the elements to which they are delegated; event handlers bound on any elements below it in the DOM tree will already have been executed by the time the delegated event handler is called. These handlers, therefore, may prevent the delegated handler from triggering by calling <code><a href="http://api.jquery.com/event.stopPropagation/">event.stopPropagation()</a></code> or returning <code>false</code>.
532+
</xsl:when>
533+
<xsl:when test="@id = 'same-origin-policy'">
534+
Due to browser security restrictions, most "Ajax" requests are subject to the <a title="Same Origin Policy on Wikipedia" href="http://en.wikipedia.org/wiki/Same_origin_policy">same origin policy</a>; the request can not successfully retrieve data from a different domain, subdomain, or protocol.
535+
</xsl:when>
536+
<xsl:when test="@id = 'same-origin-policy-exceptions'">
537+
Script and JSONP requests are not subject to the same origin policy restrictions.
538+
</xsl:when>
539+
<xsl:when test="@id = 'use-ajaxerror'">
540+
If a request with <xsl:value-of select="@data-title"/> returns an error code, it will fail silently unless the script has also called the global <a href="http://api.jquery.com/ajaxError/">.ajaxError() </a> method. Alternatively, as of jQuery 1.5, the <code>.error()</code> method of the <code>jqXHR</code> object returned by <xsl:value-of select="@data-title"/> is also available for error handling.
541+
</xsl:when>
542+
</xsl:choose>
543+
</xsl:template>
544+
520545
<!-- escape-string, from xml2json.xsl -->
521546
<xsl:template name="escape-string"><xsl:param name="s"/><xsl:text>"</xsl:text><xsl:call-template name="escape-bs-string"><xsl:with-param name="s" select="$s"/></xsl:call-template><xsl:text>"</xsl:text></xsl:template><xsl:template name="escape-bs-string"><xsl:param name="s"/><xsl:choose><xsl:when test="contains($s,'\')"><xsl:call-template name="escape-quot-string"><xsl:with-param name="s" select="concat(substring-before($s,'\'),'\\')"/></xsl:call-template><xsl:call-template name="escape-bs-string"><xsl:with-param name="s" select="substring-after($s,'\')"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:call-template name="escape-quot-string"><xsl:with-param name="s" select="$s"/></xsl:call-template></xsl:otherwise></xsl:choose></xsl:template><xsl:template name="escape-quot-string"><xsl:param name="s"/><xsl:choose><xsl:when test="contains($s,'&quot;')"><xsl:call-template name="encode-string"><xsl:with-param name="s" select="concat(substring-before($s,'&quot;'),'\&quot;')"/></xsl:call-template><xsl:call-template name="escape-quot-string"><xsl:with-param name="s" select="substring-after($s,'&quot;')"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:call-template name="encode-string"><xsl:with-param name="s" select="$s"/></xsl:call-template></xsl:otherwise></xsl:choose></xsl:template><xsl:template name="encode-string"><xsl:param name="s"/><xsl:choose><!-- tab --><xsl:when test="contains($s,'&#x9;')"><xsl:call-template name="encode-string"><xsl:with-param name="s" select="concat(substring-before($s,'&#x9;'),'\t',substring-after($s,'&#x9;'))"/></xsl:call-template></xsl:when><!-- line feed --><xsl:when test="contains($s,'&#xA;')"><xsl:call-template name="encode-string"><xsl:with-param name="s" select="concat(substring-before($s,'&#xA;'),'\n',substring-after($s,'&#xA;'))"/></xsl:call-template></xsl:when><!-- carriage return --><xsl:when test="contains($s,'&#xD;')"><xsl:call-template name="encode-string"><xsl:with-param name="s" select="concat(substring-before($s,'&#xD;'),'\r',substring-after($s,'&#xD;'))"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:value-of select="$s"/></xsl:otherwise></xsl:choose></xsl:template>
522547

notes/document-order.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

notes/domlint.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

notes/jquery-selector-extension-alt.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

notes/jquery-selector-extension.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

notes/jquery.fx.off.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

notes/no-data-on-xml.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

notes/prop-memory-leaks.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

notes/propagation-for-live-or-delegate.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

notes/same-origin-policy-exceptions.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

notes/same-origin-policy.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

notes/use-ajaxerror.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

preproc-xinclude.xsl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,4 @@
77
<xsl:apply-templates select="@* | node()"/>
88
</xsl:copy>
99
</xsl:template>
10-
<!-- Create note xinclude based on note id -> filename -->
11-
<xsl:template match="note">
12-
<xsl:copy>
13-
<xsl:apply-templates select="@* | node()"/>
14-
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude">
15-
<xsl:attribute name="href">../notes/<xsl:value-of select="@id"/>.xml</xsl:attribute>
16-
</xi:include>
17-
</xsl:copy>
18-
</xsl:template>
1910
</xsl:stylesheet>

0 commit comments

Comments
 (0)