Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » XSD anyElement trouble(TTCN-3 XSD xs:any tag)
XSD anyElement trouble [message #1856170] Thu, 24 November 2022 08:22 Go to next message
Yann Garcia is currently offline Yann GarciaFriend
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

Re: XSD anyElement trouble [message #1856195 is a reply to message #1856170] Fri, 25 November 2022 12:28 Go to previous messageGo to next message
Olaf Bergengruen is currently offline Olaf BergengruenFriend
Messages: 122
Registered: November 2018
Senior Member
Hi Yann,

two comments:

- the XSD for your blabla message is missing, this is important for the analysis
- You generated the blabla message types using Titan translator version 6B, but you compile the complete TTCN using version 8.2?

Olaf
Re: XSD anyElement trouble [message #1856201 is a reply to message #1856195] Sat, 26 November 2022 16:35 Go to previous messageGo to next message
Yann Garcia is currently offline Yann GarciaFriend
Messages: 145
Registered: June 2016
Senior Member
Hello Olaf,

Many thanks for your feedback. I'll come back to you soon with an update based on the latest version of Titan/xsd2tccn.

Yann
Re: XSD anyElement trouble [message #1856211 is a reply to message #1856201] Mon, 28 November 2022 07:43 Go to previous messageGo to next message
Yann Garcia is currently offline Yann GarciaFriend
Messages: 145
Registered: June 2016
Senior Member
Hello Olaf,

Please find attached the updated example with the xsd file and the correct version of xsd2ttcn.

The problem is still present.

Thanks a lot,

Yann
Re: XSD anyElement trouble [message #1856212 is a reply to message #1856211] Mon, 28 November 2022 08:35 Go to previous messageGo to next message
Olaf Bergengruen is currently offline Olaf BergengruenFriend
Messages: 122
Registered: November 2018
Senior Member
Hi Yann,

I had similar problems in my MCX projects with tons of extremly complex XSDs.
Most of the time, the problem was incorrect data, i.e. data that does not match the XSDs.
This is also the case in your projects: Your data in vl_received is incorrect as follows:

Your blabla XSD defines an extension element which is mandatory (normally these extensions are optional):

 <xs:any namespace="##other" processContents="skip" />


This means that your data must contain this extension element which must be an XML subtree belonging to a different namespace.

I added in vl_received missing data after field4 and, now it works :-)

 <ns2:extelem xmlns:ns2=\"http://www.namespace2.xx/message\"><a>aval</a></ns2:extelem>\n


Regards,
Olaf
Re: XSD anyElement trouble [message #1856240 is a reply to message #1856212] Tue, 29 November 2022 08:59 Go to previous message
Yann Garcia is currently offline Yann GarciaFriend
Messages: 145
Registered: June 2016
Senior Member
Hello Olaf,

Many thanks for your help.

Yann
Previous Topic:GRE-in-UDP for MCData IP Connectivity
Next Topic:Titan 8.3.0 release notification
Goto Forum:
  


Current Time: Fri Apr 26 04:20:21 GMT 2024

Powered by FUDForum. Page generated in 0.03307 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top