NLLOM service

1.1.1 2020-02-27 13:52 UTC

This package is auto-updated.

Last update: 2022-04-27 18:45:19 UTC


Build Status


NL LOM is the Dutch applicationprofile of LOM. This profile was constructed after a project by Stichting Kennisnet and SURFfoundation.

In NL LOM the agreements 'Content-zoekprofiel' and 'LORElom' are merged to form a metadata agreement for Dutch education based on IEEE-LOM.


This library offers a couple classes to simplify creating and parsing Lom objects and XML.

The Lom class consists of multiple setters/getters which rely on data wrapped in a class. For example, setting the general language uses a value wrapped in a LomString object:

$lom = new NLLOM();
$lom->addGeneralLanguage(new LomString('nl'));

There are multiple types of these Lom wrapper classes, which can be found in the Library folder. For an example of creating a complete Lom record this way, check the unittest NLLOMTest.php in tests.


Creating a new Lom object

namespace Example;

use Kennisnet\NLLOM;

//---Example: new lom with some properties set---

// Create an options array: only possible option is 'language', which has a default setting of 'nl'
$options = [
    'language' => 'en'

$lom = new NLLOM\NLLOM($options);

    new LomMultiLanguage([
        //Create different titles
        new LomLanguageString('Dit is een titel', 'nl'), //override default language
        new LomLanguageString('This is a title')

Converting a Lom object to DomDocument

namespace Example;

use Kennisnet\NLLOM;

//---Example: convert lom  object to XML ---
$lom = new NLLOM\NLLOM();

$mapper = new NLLOM\LomToDomMapper();
$dom = $mapper->lomToDom($lom);

$result = $dom->saveXML();

Converting existing Lom XML/DomDocument to Lom object

namespace Example;

use Kennisnet\NLLOM;

//---Example: convert DomDocument to lom object ---
$domDocument = new \DOMDocument('1.0', 'utf-8');

$mapper = new NLLOM\DomToLomMapper();
$lom = $mapper->domToLom($domDocument);


namespace Example;

use Kennisnet\NLLOM;

//---Example: validate Lom XML

$xml = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<lom xmlns="" xmlns:xsi="" xsi:schemaLocation="">
            <langstring xml:lang="nl">Foobar</langstring>



Kennisnet Developers Wiki