Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » xsd2ttcn on RFC5874(xsd2ttcn fails to convert the XSD in RFC 5874)
xsd2ttcn on RFC5874 [message #1824222] Fri, 10 April 2020 07:02 Go to next message
Olaf Bergengruen is currently offline Olaf BergengruenFriend
Messages: 59
Registered: November 2018
Member
Hello XSD experts,

xsd2ttcn fails to convert the XSDs in RFC 5874, attached the modules.

These XSDs are need in our MCPTT Tester when producing the XMLs as shown as example in TS 24.484 Annex A Table A.2.3-7.

We will appreciate any comment, or workaround to this issue.

Thanks,
Olaf @ ETSI STF160
  • Attachment: MCX_XSD.zip
    (Size: 1.81KB, Downloaded 10 times)
Re: xsd2ttcn on RFC5874 [message #1824247 is a reply to message #1824222] Fri, 10 April 2020 16:04 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1063
Registered: January 2015
Senior Member
Hi Olaf,

-the first problem is that in RFC5261-patch-ops.xsd there is no target namespace declared, which does not correctly reflect the intentions :
as RFC5261-patch-ops.xsd is included in RFC5874-xcap-diff.xsd , both should use the same target namespace "urn:ietf:params:xml:ns:xcap-diff"
In lack of a target namespace specified, all elements are generated into a special "NoTargetNamespace" namespace, with no prefix (meaning that any reference
without a prefix should be looked up in this namespace - kind of a garbage dump of XML).
To rectify this , I have added a namespace declaration to RFC5261-patch-ops.xsd:
<xsd:schema
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:ns1="urn:ietf:params:xml:ns:xcap-diff"
     targetNamespace="urn:ietf:params:xml:ns:xcap-diff"
     elementFormDefault="qualified">
:
:

and prefixed all type references with ns1 (the prefix is arbitrary, but has to be consistent)
(see attached archive).

To maintain consistency, I had to prefix also in RFC5874-xcap-diff.xsd any reference to definitions from RFC5261-patch-ops.xsd or to itself.
At this stage, the converter generated the TTCN-3 files. However it does make a mistake when generating urn_ietf_params_xml_ns_xcap_diff.ttcn as revealed
by the below compilation error:

make
/home/james00/titan.core/Install/bin/compiler -L  \
urn_ietf_params_xml_ns_xcap_diff.ttcn UsefulTtcn3Types.ttcn XSD.ttcn  - urn_ietf_params_xml_ns_xcap_diff.ttcn UsefulTtcn3Types.ttcn XSD.ttcn
Notify: Parsing TTCN-3 module `urn_ietf_params_xml_ns_xcap_diff.ttcn'...
Notify: Parsing TTCN-3 module `UsefulTtcn3Types.ttcn'...
Notify: Parsing TTCN-3 module `XSD.ttcn'...
Notify: Checking modules...
urn_ietf_params_xml_ns_xcap_diff.ttcn: In TTCN-3 module `urn_ietf_params_xml_ns_xcap_diff':
 urn_ietf_params_xml_ns_xcap_diff.ttcn:140.1-154.1: In type definition `Xcap_diff':
  urn_ietf_params_xml_ns_xcap_diff.ttcn:144.2-153.20: In record field `sequence':
   urn_ietf_params_xml_ns_xcap_diff.ttcn:145.3-151.17: In record field `sequence_list':
    urn_ietf_params_xml_ns_xcap_diff.ttcn:145.3-151.3: In embedded type of record of:
     urn_ietf_params_xml_ns_xcap_diff.ttcn:146.4-150.11: In record field `choice':
      urn_ietf_params_xml_ns_xcap_diff.ttcn:147.5-25: In union field `document':
       urn_ietf_params_xml_ns_xcap_diff.ttcn:173.1-206.1: In type definition `DocumentType':
        urn_ietf_params_xml_ns_xcap_diff.ttcn:183.5-190.5: error: A type with EMBED-VALUES must be a sequence type. The first component of the sequence shall be SEQUENCE OF UTF8String and shall not be marked DEFAULT
        urn_ietf_params_xml_ns_xcap_diff.ttcn:196.5-201.5: error: A type with EMBED-VALUES must be a sequence type. The first component of the sequence shall be SEQUENCE OF UTF8String and shall not be marked DEFAULT



As it turns out , a wrong order in DocumentType is generated:


type record DocumentType
{
	XSD.String new_etag optional,
	XSD.String previous_etag optional,
	XSD.AnyURI sel,
	record of XSD.String attr optional,
	union {
		EmptyType body_not_changed,
		record of record {
			union {
				record {					
					Pos pos optional,
					Xpath_add sel,
					Type type_ optional,
					record of XSD.String attr optional,
                    record of XSD.String embed_values_1,  
					record of XSD.String elem_list
				} add,
				record {
					Xpath sel,
					Ws ws optional,
					record of XSD.String attr optional
				} remove,
				record {
					Xpath sel,
					record of XSD.String attr optional,
				    record of XSD.String embed_values_1, 			
					XSD.String elem optional
				} replace_,
				XSD.String elem
			} choice
		} sequence_list
	} choice optional
}
:


Luckily , that is simple to fix by restoring the correct order:

type record DocumentType
{
	XSD.String new_etag optional,
	XSD.String previous_etag optional,
	XSD.AnyURI sel,
	record of XSD.String attr optional,
	union {
		EmptyType body_not_changed,
		record of record {
			union {
				record {
					record of XSD.String embed_values_1,  //has to be first!!!!
					Pos pos optional,
					Xpath_add sel,
					Type type_ optional,
					record of XSD.String attr optional,

					record of XSD.String elem_list
				} add,
				record {
					Xpath sel,
					Ws ws optional,
					record of XSD.String attr optional
				} remove,
				record {
				    record of XSD.String embed_values_1, //has to be first!!!
					Xpath sel,
					record of XSD.String attr optional,
					
					XSD.String elem optional
				} replace_,
				XSD.String elem
			} choice
		} sequence_list
	} choice optional
}
:



At this stage , the TTCN-3 files will compile. For the converter error, I will issue a trouble report.

The amended schemas and the generated and corrected TTCN-3 files are attached.
I hope this helps.


Best regards
Elemer
Re: xsd2ttcn on RFC5874 [message #1824248 is a reply to message #1824247] Fri, 10 April 2020 16:33 Go to previous message
Olaf Bergengruen is currently offline Olaf BergengruenFriend
Messages: 59
Registered: November 2018
Member
Wow, Elemer, this incredible! Thanks, you solved all problems :-)

Have a nice week-end, as far as corona allows,
Olaf
Previous Topic:Eclipse Titan product structure part 3
Next Topic:RDF-related encodings in Titan
Goto Forum:
  


Current Time: Thu Jul 09 20:57:58 GMT 2020

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

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

Back to the top