From f37443b0b7590e48b78ff27f718144d301a9b1fb Mon Sep 17 00:00:00 2001 From: Botond Baranyi <botond.baranyi@ericsson.com> Date: Thu, 27 May 2021 18:27:03 +0200 Subject: [PATCH] Documented XML namespace attribute changes (issue #545) Signed-off-by: Botond Baranyi <botond.baranyi@ericsson.com> --- .../4-ttcn3_language_extensions.adoc | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/usrguide/referenceguide/4-ttcn3_language_extensions.adoc b/usrguide/referenceguide/4-ttcn3_language_extensions.adoc index 92fd92b50..5b5acd948 100644 --- a/usrguide/referenceguide/4-ttcn3_language_extensions.adoc +++ b/usrguide/referenceguide/4-ttcn3_language_extensions.adoc @@ -4920,6 +4920,56 @@ const S jrh := { "John", "Doe", "M" } */ ---- +NOTE: Global XML namespace identification attributes are ignored for type references (i.e. subtypes, type aliases, `record`/`set`/`union` fields and `record of`/`set of` element types) if the referenced type also has an XML namespace identification attribute. + +Example: +[source] +---- +module A { + +type record T1 { + universal charstring s +} + +} +with { + encode "XML"; + variant "namespace as 'http://www.somewhere.com/A' prefix 'nsA'"; + variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'"; + variant "elementFormQualified"; +} +---- +[source] +---- +module B { + +import from A all; + +type record T2 { + T1 t1 // uses the namespace attribute of type A.T1, not the global namespace attribute of this module +} + +const T2 val := { t1 := { s := "abc" } }; + +/* XML encoding + +<nsB:T2 xmlns:nsB='http://www.somewhere.com/B' xmlns:nsA='http://www.somewhere.com/A'> + <nsA:t1> + <nsA:s>abc</nsA:s> + </nsA:t1> +</nsB:T2> + +*/ + +} +with { + encode "XML"; + variant "namespace as 'http://www.somewhere.com/B' prefix 'nsB'"; + variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'"; + variant "elementFormQualified"; +} +---- + *Nillable elements* Attribute syntax: useNil -- GitLab