XProc steps

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

p:make-absolute-uris

<p:declare-step type="p:make-absolute-uris">
   <p:input port="source"/>
   <p:output port="result"/>
   <p:option name="match" required="true"/> <!-- XSLTMatchPattern -->
   <p:option name="base-uri"/> <!-- anyURI -->
</p:declare-step>
 

The <p:make-absolute-uris> step generates absolute links of the content which is indicated by an appropriate XSLT expression. The “base-uri“ option gives the user the possibility to indicate a base URl. This value is prepended to all entries which are transformed into an absolute path.

Example

In the following example all film directors shall be transformed into absolute URIs with the base address "http://www.fh-worms.de".

<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0">
   <p:input port="source">
      <p:document href="FilmCollection.xml"/>
   </p:input>
   <p:output port="result"/>
   <p:make-absolute-uris base-uri="http://www.fh-worms.de/" match="/FilmCollection/Film/Director"/>
</p:declare-step>

The result of this process is as follows (excerpt):

<FilmCollection>
   <Film>
      <Title>Star Wars: Episode IV - A New Hope</Title>
      <Year>1978</Year>
      <Genre>SciFi</Genre>
      <Director>http://www.fh-worms.de/George%20Lucas</Director>
      <Producer>George Lucas</Producer>
      <Cast>
[...]