Skip to content

Commit

Permalink
Adds guidance for namespaces in 2.03
Browse files Browse the repository at this point in the history
  • Loading branch information
andylolz committed Apr 18, 2018
1 parent 2d5ab90 commit 243283c
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion en/namespaces-extensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,50 @@ The first approach allows reporting organisations to invent any required markup
...
<acme:risk-level>3</acme:risk-level>
<acme:risk-level>3</acme:risk-level>
...
</iati-activity>
In this example, ACME has defined its own namespace using the URL ``http://example.org/acme/ns#`` and mapped that to the prefix ``acme``. It then adds the new element, ``acme:risk-level``, to provide information about its risk assessment for the activity. IATI users who don’t recognise the ``http://example.org/acme/ns#`` namespace are required to ignore the ``acme:risk element`` rather than reporting an error, so the extended markup does not harm compatibility. Users who are familiar with the namespace, however, can take advantage of the additional information.


Adding XML namespaces in versions 2.0x
--------------
Please note: elements must occur in the order they are specified in the Schema. When adding XML namespaces in versions 2.0x of the IATI standard, they should be placed as the last element. At the activity level, they must only be included at the end of the activity (before </iati-activity>). If added as a subelement, the namespace element must be placed as the last subelement. Example:

1) XML namespace at activity level

.. code-block:: xml
<iati-activity xmlns:acme="http://example.org/acme/ns#">
...
</fss>
<acme:risk-level>3</acme:risk-level>
...
</iati-activity>
2) XML namespace as a subelement within transaction

.. code-block:: xml
<iati-activity xmlns:acme="http://example.org/acme/ns#">
...
<transaction>
...
</value>
<acme:risk-level>3</acme:risk-level>
</transaction>
...
</iati-activity>

0 comments on commit 243283c

Please sign in to comment.