Properly escape names in generated SDMX-ML message for categorizations
When categorising a dataflow in the DLM, if a dataflow name contains the &
character, then the auto-generated categorisation SDMX-ML message is malformed and rejected by the NSI (with the error Error while attempting to process SDMX-ML Structure file
) because the categorisation name is not properly xml-escaped. Since the &
character has a meaning and is interpreted it needs to be escaped to &
.
Instead of the currently generated incorrect XML:
<structure:Categorisation id="CAT_OECD_STI_STP__DSD_ANBERD@DF_ANBERDi4__1_0@OECD__OECDCS1__2_0__INT_INT_IND" agencyID="OECD.STI.STP" version="1.0" isFinal="false">
<common:Name xml:lang="en">Analytical Business Enterprise R&D by ISIC Rev.4 industry (ANBERD database)</common:Name>
<structure:Source>
<Ref id="DSD_ANBERD@DF_ANBERDi4" version="1.0" agencyID="OECD.STI.STP" package="datastructure" class="Dataflow" />
</structure:Source>
<structure:Target>
<Ref id="INT.INT_IND" maintainableParentID="OECDCS1" maintainableParentVersion="2.0" agencyID="OECD" package="categoryscheme" class="Category" />
</structure:Target>
</structure:Categorisation>
It is expected to get:
<structure:Categorisation id="CAT_OECD_STI_STP__DSD_ANBERD@DF_ANBERDi4__1_0@OECD__OECDCS1__2_0__INT_INT_IND" agencyID="OECD.STI.STP" version="1.0" isFinal="false">
<common:Name xml:lang="en">Analytical Business Enterprise R&D by ISIC Rev.4 industry (ANBERD database)</common:Name>
<structure:Source>
<Ref id="DSD_ANBERD@DF_ANBERDi4" version="1.0" agencyID="OECD.STI.STP" package="datastructure" class="Dataflow" />
</structure:Source>
<structure:Target>
<Ref id="INT.INT_IND" maintainableParentID="OECDCS1" maintainableParentVersion="2.0" agencyID="OECD" package="categoryscheme" class="Category" />
</structure:Target>
</structure:Categorisation>
Example files
- Full structure :OECD.STI.STP-DSD_ANBERD-1.0-all.xml
- Dataset :OECD.STI.STP-DSD_ANBERD_DF_ANBERDi4-1.0-data.csv
- Category Scheme (v2.0):OECD-OECDCS1-2.0.xml
Edited by Jens Dossé