XSD anyElement trouble [message #1856170] |
Thu, 24 November 2022 08:22 |
Yann Garcia Messages: 145 Registered: June 2016 |
Senior Member |
|
|
Dear All,
I have the following XSD description (see http_www_blabla_xx_message.ttcn in the archive attached) :
<ns4:ResponseMsg xmlns:ns4="http://www.blablabla.xx/v1/message/">
...
<xs:any namespace="##other" processContents="skip" />
...
<ResultCode>Success</ResultCode>
</ns4:ResponseMsg>
The TTCN-3 conversion produced the following code:
module www__blablabla__xx__v1__message {
type enumerated ResultCodeType {
...
}
type record ResponseMsg {
...
XSD.String elem,
...
ResultCodeType resultCode
} with {
...
variant (elem) "anyElement except unqualified, 'http://www.blabla.xx/message/'";
...
variant (resultCode) "name as capitalized";
};
}
with {
encode "XML";
variant "namespace as 'http://www.blablabla.xx/v1/message/' prefix 'tns'";
variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'";
}
When decoding the ResponseMsg below, I got the following warning and the ResultCode field is decoded into elem field:
Warning: While XER-decoding type '@http_www_blabla_xx_message.ResponseMsg': Component 'elem': While checking anyElement: The unqualified XML namespace is in the excluded namespace list.
Warning: While XER-decoding type '@http_www_blabla_xx_message.ResponseMsg': No data found for non-optional field 'resultCode'
decvalue: v_result: 2
decvalue: v_result: { field1 := omit, field2 := "2018-01-18T13:15:46.233+01:00", field3 := "e3c96fe8-dc6d-43ae-b1e2-7afe310634fd", field4 := "TestingMode", elem := "<ResultCode>Success</ResultCode>", resultCode := <unbound> }
ResultCode is decoded as part of Elem. My understanding is that ResultCode is qualified because of the top node ResponseMsg is qualified by ns4.
Am I correct?
Do you have any hint to fix it?
Many thanks in advance for your support
Yann Garcia
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04469 seconds