# Unencoded > in exported OPT for generic RM types **Category:** [CKM](https://discourse.openehr.org/c/ckm/89) **Created:** 2025-01-08 10:54 UTC **Views:** 60 **Replies:** 5 **URL:** https://discourse.openehr.org/t/unencoded-gt-in-exported-opt-for-generic-rm-types/6123 --- ## Post #1 by @borut.jures Generic types like `DV_INTERVAL` have inconsistently converted `<...>` for the generic part. Only the `<` is converted to `<`. The ending `>` is not encoded to `>`. In CKM on "OPT" tab: ``` DV_INTERVAL ``` OPT downloaded from CKM "Export Template" tab: ``` DV_INTERVAL<DV_DATE_TIME> ``` Notice that the ending `>` is not converted to `>`. Examples (search for `DV_INTERVAL`): - https://ckm.openehr.org/ckm/templates/1013.26.291/opt - https://ckm.openehr.org/ckm/templates/1013.26.376/opt --- ## Post #2 by @sebastian.garde In the OPT Tab, `<` is rendered as < by the browser. This is the same if I just type it in discourse, it will be rendered as < if I don't use preformatted text. If you copy or download and view in a text editor it will show you the `<` as you have noted. However if you open the exact same document in a browser etc. e.g. with an xml extension instead of opt it will also render it as >. Probably most xml editors would behave similarly and make this transparent to the user. < must be escaped in text within an xml document, whereas for > this is not required (within text) as far as I know. So this is what we are doing. We could make it more ugly by using `>` but this is not a requirement as far as I know. --- ## Post #3 by @borut.jures I would prefer ugly but consistent (`<...>`) :blush: But as you say the current variant is a valid XML :man_shrugging: I have updated my XML parser to handle the current format. Thank you for explaining that this is the expected output in OPT files. --- ## Post #4 by @borut.jures I did some more research :blush: When the same OPT is exported from the Archetype Designer, it encodes both `<` and `>`. When the archetype with `DV_INTERVAL` (https://ckm.openehr.org/ckm/archetypes/1013.1.614/export) is exported from CKM as XML, it also encodes both `<` and `>`. Only export to OPT from CKM leaves the `>` unencoded. --- ## Post #5 by @sebastian.garde In my understanding both are correct, any xml parser should deal with this transparently? --- ## Post #6 by @borut.jures @sebastian.garde I'm not saying it is a bug :blush: As you mentioned, it is a valid XML. I first stumbled on this with CKM OPTs but wanted to document it in case others stumble on the same thing. It took me some time debugging my code before I noticed that `>` is part of `DV_INTERVAL`: ``` DV_INTERVAL<DV_DATE_TIME> ``` However it would be interesting to check the code used to export archetypes to XML and the one that exports to OPT. I would expect the same code to be used for `rm_type_name` :thinking: --- **Canonical:** https://discourse.openehr.org/t/unencoded-gt-in-exported-opt-for-generic-rm-types/6123 **Original content:** https://discourse.openehr.org/t/unencoded-gt-in-exported-opt-for-generic-rm-types/6123