blob: 4f5d92f0e0119ed211bbaffb8480ccce30f34085 [file] [log] [blame]
<html>
<head>
<style type="text/css">
body, table {
font-family: Verdana, sans-serif;
font-size: 100%;
padding-left: 2mm;
}
#footer {
font-size: 95%;
padding-top: 10px;
}
</style>
</head>
<body>
<p>
This inspection checks for any implicit conversions between the predefined XPath-types STRING, NUMBER, BOOLEAN and
NODESET. While this is usually not a problem as the conversions are well-defined by the standard, this inspection can
help to write XSLT scripts that are more expressive about types and can even help to avoid subtle bugs:
</p>
<p>
<code>&lt;xsl:if test="<b>foo</b>" /></code> is not the same as <code>&lt;xsl:if test="<b>string(foo)</b>" /></code>
</p>
<p>
The first test checks whether the element "foo" exists (<code>count(foo) > 0)</code>, the latter one however is only
true if the element actually contains any text (<code>string-length(foo) > 0</code>). The plugin will then offer to
make the type-conversion more explicit.
</p>
<p>
There are several options to adjust the inspection to personal preferences by offering the possibility to
individually enable it for implicit conversions between certain types.<br>
</p>
<p>
The plugin can also be told to always flag explicit conversions that do not result in the actually expected type, such
as <code>&lt;xsl:if test="number(foo)" /></code> and provides a special option to ignore the conversion from NODESET
to BOOLEAN by using the <code>string()</code> function as a shortcut for writing <code>string-length() > 0</code>.
</p>
<p id="footer">Powered by XPathView + XSLT-Support</p>
</body>
</html>