<?xml version="1.0"?> 

<!--
	description:

		"Implemented core functions"

	library: "Gobo Eiffel XPath Library"
	copyright: "Copyright (c) 2004-2025, Colin Adams and others"
	license: "MIT License"
-->

<chapter xmlns="https://www.gobosoft.com/eiffel/gobo/documentation" id="xpath_implemented_functions">
  <chapterinfo>
    <copyright>
      <year>2004-2016</year>
      <holder>Colin Adams and others</holder>
    </copyright>
    <author>
      <firstname>Colin</firstname>
      <surname>Adams</surname>
    </author>
    <email>colin@colina.demon.co.uk</email>
    <date>27 December 2016</date>
  </chapterinfo>
  <title>Core functions - implementation status</title>
  <para>This chapter lists all the core functions (functions provided by host lanages such as XSLT are not listed here)
  along with their implementation status.
  </para> 
  <para>The first column of the table gives the function's name, from <ulink url="http://www.w3.org/TR/xpath-functions/">XQuery 1.0 and XPath 2.0 Functions and Operators</ulink>.
  The fn prefix represents the namespace uri http://www.w3.org/2004/10/xpath-functions.</para>
  <para>To translate the function name into it's implementation class (which can be found in $GOBO/library/xpath/src/functions/), remove
  the leading fn:, uppercase the remaining part of the name, and translate any hyphens into underscores. Then prefix it with XM_XPATH_.
  For example, the function fn:normalize-space, is implemented by <classname>XM_XPATH_NORMALIZE_SPACE</classname>.
  </para>
  <para>All such classes are descendants of <classname>XM_XPATH_SYSTEM_FUNCTION</classname>. They also each have an entry in 
  <classname>XM_XPATH_SYSTEM_FUNCTION_FACTORY</classname>.
  </para>
  <para>The second column says whether or not the function has been implemented yet. The third column indicates
  whether there is a testing class set up for the function. If so, it will be in $GOBO/test/xml/xpath/, and will be named xm_xpath_test_&lt;function-name&gt;.e .
  </para>
  <para>The final column gives a link to the W3C draft or recommendation against which the tests have been checked, or &quot;None&quot;, if this has not been done. </para>
  
  <section>
    <title>Implemented XPath 2.0 core Functions</title>
    <table>
      <title>Table of functions</title>
      <tgroup cols="4">
	<thead>
	  <row>
	    <entry>Name</entry>
	    <entry>Implemented?</entry>
	    <entry>Tested?</entry>
	    <entry>Checked</entry>
	  </row>
	</thead>
	<tbody>
	  <row>
	    <entry>fn:abs</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:adjust-date-to-timezone</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>
	  <row>
	    <entry>fn:adjust-dateTime-to-timezone</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:adjust-time-to-timezone</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>
	  <row>
	    <entry>fn:avg</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:base-uri</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:boolean</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:ceiling</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>
	  <row>
	    <entry>fn:codepoint-equal</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:codepoints-to-string</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:collection</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:compare</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:concat</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:contains</entry>
	    <entry>Yes</entry>
	    <entry>Incidentallly</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:count</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:current-date</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:current-dateTime</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:current-time</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:data</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:dateTime</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:day-from-date</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:day-from-dateTime</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:days-from-duration</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:deep-equal</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:default-collation</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:distinct-values</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:doc</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:doc-available</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:document-uri</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:empty</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:encode-for-uri</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:ends-with</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:error</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>
	  <row>
	    <entry>fn:escape-html-uri</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:exactly-one</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:exists</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:false</entry>
	    <entry>Yes</entry>
	    <entry>Only incidentally</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:floor</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:hours-from-dateTime</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:hours-from-duration</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:hours-from-time</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:id</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:idref</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:implicit-timezone</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>
	  <row>
	    <entry>fn:in-scope-prefixes</entry>
	    <entry>Yes</entry>
	    <entry>Incidentally</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:index-of</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:insert-before</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:iri-to-uri</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:lang</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:last</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:local-name</entry>
	    <entry>Yes</entry>
	    <entry>Incidentally</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:local-name-from-QName</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:lower-case</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:matches</entry>
	    <entry>Yes (but unicode case stuff not implemented yet)</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:max</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:min</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:minutes-from-dateTime</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:minutes-from-duration</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:minutes-from-time</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:month-from-date</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:month-from-dateTime</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:months-from-duration</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:name</entry>
	    <entry>Yes</entry>
	    <entry>Only incidentally</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:namespace-uri</entry>
	    <entry>Yes</entry>
	    <entry>Incidentally</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:namespace-uri-for-prefix</entry>
	    <entry>Yes</entry>
	    <entry>Incidentally</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:namespace-uri-from-QName</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:nilled</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:node-name</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>
	  <row>
	    <entry>fn:normalize-space</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:normalize-unicode</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:not</entry>
	    <entry>Yes</entry>
	    <entry>Only incidentally</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:number</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:one-or-more</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:position</entry>
	    <entry>Yes</entry>
	    <entry>Incidentally, but extensively</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:prefix-from-QName</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:QName</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:remove</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:replace</entry>
	    <entry>Yes (but unicode case stuff not implemented yet)</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:resolve-QName</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:resolve-uri</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:reverse</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:root</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:round</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:round-half-to-even</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:seconds-from-dateTime</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:seconds-from-duration</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:seconds-from-time</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:starts-with</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:static-base-uri</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>
	  <row>
	    <entry>fn:string</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:string-join</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:string-length</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:string-to-codepoints</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:subsequence</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:substring</entry>
	    <entry>Yes</entry>
	    <entry>Incidentally</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:substring-after</entry>
	    <entry>Yes</entry>
	    <entry>Incidentally</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:substring-before</entry>
	    <entry>Yes</entry>
	    <entry>Incidentally</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:sum</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:timezone-from-date</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>
	  <row>
	    <entry>fn:timezone-from-dateTime</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:timezone-from-time</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>		
	  <row>
	    <entry>fn:tokenize</entry>
	    <entry>Yes (but unicode case stuff not implemented yet)</entry>
	    <entry>Partly</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:trace</entry>
	    <entry>Yes</entry>
	    <entry>Only by personal use</entry>
	    <entry>None</entry>
	  </row>
	  <row>
	    <entry>fn:translate</entry>
	    <entry>Yes</entry>
	    <entry>Incidentally</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:true</entry>
	    <entry>Yes</entry>
	    <entry>Only incidentally</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:unordered</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:upper-case</entry>
	    <entry>Yes</entry>
	    <entry>No</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:year-from-date</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:year-from-dateTime</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:years-from-duration</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	  <row>
	    <entry>fn:zero-or-one</entry>
	    <entry>Yes</entry>
	    <entry>Yes</entry>
	    <entry>None</entry>
	  </row>	
	</tbody>
      </tgroup>
    </table>
  </section>
</chapter>
