|
Re: Issues with xsd2ttcn [message #1791546 is a reply to message #1791539] |
Mon, 02 July 2018 07:22   |
Eclipse User |
|
|
|
Hi Yann,
indeed , when I run xsd2ttcn over your files, results in:
xsd2ttcn *.xsd
Notify: Checking documents...
Notify: Parsing XML schema document `GML-pidf-lo-shape.xsd'...
Notify: Parsing XML schema document `RFC3863_pidf.xsd'...
Notify: Parsing XML schema document `RFC4119_geopriv10.xsd'...
Notify: Parsing XML schema document `RFC4119_geopriv10_basic_policy.xsd'...
Notify: Parsing XML schema document `RFC4119_geopriv10_civiloc.xsd'...
Notify: Parsing XML schema document `RFC5985_held.xsd'...
Notify: Parsing XML schema document `RFC6155_held_id.xsd'...
Notify: Parsing XML schema document `RFC7459_pidf_lo.xsd'...
Notify: Parsing XML schema document `basicTypes.xsd'...
Notify: Parsing XML schema document `geometryBasic0d1d.xsd'...
Notify: Parsing XML schema document `geometryBasic2d.xsd'...
Notify: Parsing XML schema document `geometryPrimitives.xsd'...
Notify: Parsing XML schema document `gmlBase.xsd'...
Notify: Parsing XML schema document `measures.xsd'...
Notify: Parsing XML schema document `xml_2001.xsd'...
I/O error : Attempt to load network entity http://www.w3.org/2001/xml.xsd
WARNING:
RFC3863_pidf.xsd (in line 10): Element '{http://www.w3.org/2001/XMLSchema}import': Failed to locate a schema at location 'http://www.w3.org/2001/xml.xsd'. Skipping the import.
I/O error : Attempt to load network entity http://www.w3.org/2001/xml.xsd
WARNING:
RFC4119_geopriv10.xsd (in line 12): Element '{http://www.w3.org/2001/XMLSchema}import': Failed to locate a schema at location 'http://www.w3.org/2001/xml.xsd'. Skipping the import.
I/O error : Attempt to load network entity http://www.w3.org/2001/xml.xsd
WARNING:
RFC4119_geopriv10_basic_policy.xsd (in line 9): Element '{http://www.w3.org/2001/XMLSchema}import': Failed to locate a schema at location 'http://www.w3.org/2001/xml.xsd'. Skipping the import.
WARNING:
RFC3863_pidf.xsd (in type Qvalue): Pattern restriction is not supported on type 'decimal'.
Notify: Generating TTCN-3 modules...
Notify: File 'http_www_opengis_net_gml.ttcn' was generated.
Notify: File 'http_www_opengis_net_pidflo_1_0.ttcn' was generated.
Notify: File 'http_www_w3_org_XML_1998_namespace.ttcn' was generated.
Notify: File 'urn_ietf_params_xml_ns_geopriv_conf.ttcn' was generated.
Notify: File 'urn_ietf_params_xml_ns_geopriv_held.ttcn' was generated.
Notify: File 'urn_ietf_params_xml_ns_geopriv_held_id.ttcn' was generated.
Notify: File 'urn_ietf_params_xml_ns_pidf.ttcn' was generated.
Notify: File 'urn_ietf_params_xml_ns_pidf_geopriv10.ttcn' was generated.
Notify: File 'urn_ietf_params_xml_ns_pidf_geopriv10_basicPolicy.ttcn' was generated.
Notify: File 'urn_ietf_params_xml_ns_pidf_geopriv10_civicLoc.ttcn' was generated.
Notify: File 'UsefulTtcn3Types.ttcn' was generated.
Notify: File 'XSD.ttcn' was generated.
Notify: No errors and 4 warnings were detected.
Note though that only warnings are issued and the *.ttcn files are generated.
Now if we look into the warning:
RFC3863_pidf.xsd (in line 10): Element '{http://www.w3.org/2001/XMLSchema}import': Failed to locate a schema at location 'http://www.w3.org/2001/xml.xsd'. Skipping the import.
this only means that the converter cannot follow links or hyperlinks, all XSD's have to be present and located in the same directory. Import links and hyperlinks will have to be replaced with a direct local reference.
In this case , all
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
are to be replaced with:
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="xml_2001.xsd"/>
With this done,
one warning remains:
RFC3863_pidf.xsd (in type Qvalue): Pattern restriction is not supported on type 'decimal'.
which is kinda self-explanatory.
Commenting out the offending code:
<xs:simpleType name="qvalue">
<xs:restriction base="xs:decimal">
<!-- xs:pattern value="0(.[0-9]{0,3})?"/>
<xs:pattern value="1(.0{0,3})?"/ !-->
</xs:restriction>
</xs:simpleType>
will get rid of this warning too.
See attached archive.
Best regards
Elemer
Attachment: xml.tgz
(Size: 16.78KB, Downloaded 110 times)
|
|
|
|
|
|
|
|
|
Re: Issues with xsd2ttcn [message #1792338 is a reply to message #1792335] |
Mon, 16 July 2018 05:02  |
Eclipse User |
|
|
|
Hi Yann,
in fact if this option is used in a smart way, the advantage of generating one file per namespace can be retained:
If you look at the import/include dependencies you can see that your package contains two sets of files that are unconnected so we can convert them in two steps:
xsd2ttcn -o basicTypes.xsd gmlBase.xsd measures.xsd geometryBasic0d1d.xsd geometryBasic2d.xsd geometryPrimitives.xsd GML-pidf-lo-shape.xsd
Notify: Checking documents...
Notify: Parsing XML schema document `basicTypes.xsd'...
Notify: Parsing XML schema document `gmlBase.xsd'...
Notify: Parsing XML schema document `measures.xsd'...
Notify: Parsing XML schema document `geometryBasic0d1d.xsd'...
Notify: Parsing XML schema document `geometryBasic2d.xsd'...
Notify: Parsing XML schema document `geometryPrimitives.xsd'...
Notify: Parsing XML schema document `GML-pidf-lo-shape.xsd'...
Notify: Generating TTCN-3 modules...
Notify: File 'XSD_Definitions.ttcn' was generated.
Notify: File 'UsefulTtcn3Types.ttcn' was generated.
Notify: File 'XSD.ttcn' was generated.
xsd2ttcn xml_2001.xsd RFC3863_pidf.xsd RFC4119_geopriv10_basic_policy.xsd RFC4119_geopriv10.xsd RFC5985_held.xsd RFC6155_held_id.xsd RFC7459_pidf_lo.xsd
Notify: Checking documents...
Notify: Parsing XML schema document `xml_2001.xsd'...
Notify: Parsing XML schema document `RFC3863_pidf.xsd'...
Notify: Parsing XML schema document `RFC4119_geopriv10_basic_policy.xsd'...
Notify: Parsing XML schema document `RFC4119_geopriv10.xsd'...
Notify: Parsing XML schema document `RFC5985_held.xsd'...
Notify: Parsing XML schema document `RFC6155_held_id.xsd'...
Notify: Parsing XML schema document `RFC7459_pidf_lo.xsd'...
Notify: Generating TTCN-3 modules...
Notify: File 'http_www_w3_org_XML_1998_namespace.ttcn' was generated.
Notify: File 'urn_ietf_params_xml_ns_geopriv_conf.ttcn' was generated.
Notify: File 'urn_ietf_params_xml_ns_geopriv_held.ttcn' was generated.
Notify: File 'urn_ietf_params_xml_ns_geopriv_held_id.ttcn' was generated.
Notify: File 'urn_ietf_params_xml_ns_pidf.ttcn' was generated.
Notify: File 'urn_ietf_params_xml_ns_pidf_geopriv10.ttcn' was generated.
Notify: File 'urn_ietf_params_xml_ns_pidf_geopriv10_basicPolicy.ttcn' was generated.
Notify: File 'UsefulTtcn3Types.ttcn' was generated.
Notify: File 'XSD.ttcn' was generated.
The result will compile.
see generated files in the attached archive.
BR
Elemer
|
|
|
Powered by
FUDForum. Page generated in 0.06616 seconds