Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
not Function
Collapse the table of content
Expand the table of content

not Function

Returns true if the argument is false; otherwise false.

          boolean not(boolean)

In this example, the notexample.xsl stylesheet is applied to the books.xml document. For each book node, the value of the <price> element is evaluated. If it's not greater than 10, the value of the <title> element and the value of the <price> element are output to the browser.

XML File (books.xml)

<?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="notexample.xsl"?>
   <book id="bk101">
      <author>Gambardella, Matthew</author>
      <title>XML Developer's Guide</title>
      <description>An in-depth look at creating applications with
   <book id="bk102">
      <author>Ralls, Kim</author>
      <title>Midnight Rain</title>
      <description>A former architect battles corporate zombies,
 an evil sorceress, and her own childhood to become queen of the world.</description>

XSLT File (notexample.xsl)

<?xml version='1.0'?>
<xsl:stylesheet version="1.0"

<xsl:template match="/">
   <xsl:for-each select="//book[not(price &gt; 10)]">
      <xsl:value-of select="title"/> -
      $<xsl:value-of select="price"/><br/>


Formatted Output

Midnight Rain - $5.95

Processor Output

<?xml version="1.0" encoding="UTF-16"?>Midnight Rain - $5.95<br />

Build Date:

© 2015 Microsoft