<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/sem.resolveIri.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>sem.resolveIri</api:function-name><api:suggest>sem.resolveiri</api:suggest><api:suggest>sem</api:suggest><api:suggest>resolveiri</api:suggest><api:function-link mode="xquery" fullname="sem:resolve-iri">/apidoc/8.0/sem:resolve-iri.xml</api:function-link><api:function mode="javascript" name="resolveIri" type="builtin" lib="sem" category="Extension" subcategory="Extension" hidden="false" bucket="MarkLogic Built-In Functions" prefix="sem" namespace="http://marklogic.com/semantics" fullname="sem.resolveIri"><api:summary>
  Resolves a relative URI against an absolute URI.  If $base is specified,
  the URI is resolved relative to that base.  If $base is not specified, the
  base is set to the base-uri property from the static context, if the
  property exists; if it does not exist, an error is thrown.
  This XQuery function backs up the SPARQL IRI() function.
</api:summary><api:params><api:param name="relative" type="xs:string"><api:param-description>
  A URI reference to resolve against the base.
  </api:param-description><api:param-name>relative</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="base" type="xs:string" optional="true"><api:param-description>
  An absolute URI to use as the base of the resolution.
  </api:param-description><api:param-name>base</api:param-name><api:param-type>String</api:param-type></api:param></api:params><api:return>sem.iri</api:return><api:usage>
<p xmlns="http://www.w3.org/1999/xhtml">
If $base is specified, it is assumed to be an absolute URI and
$relative is assumed to be an absolute or a relative URI reference.
If $relative is a relative URI reference, it is resolved against $base,
using an algorithm such as the ones described in
[<a href="http://www.w3.org/TR/xpath-functions/#rfc2396">RFC 2396</a>] or
[<a href="http://www.w3.org/TR/xpath-functions/#rfc3986">RFC 3986</a>], and
the resulting absolute URI reference is returned.
</p><p xmlns="http://www.w3.org/1999/xhtml">
Resolving a URI does not dereference it. This is merely a syntactic operation
on two character strings.
</p>
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
sem.resolveIri("hello/goodbye.xml",
     "/mycompany/default.xqy");

=&gt;  /mycompany/hello/goodbye.xml
</pre>
</api:example></api:function></api:function-page>