|
Re: Issues with xsd2ttcn [message #1791546 is a reply to message #1791539] |
Mon, 02 July 2018 11:22 |
|
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 88 times)
|
|
|
|
|
Re: Issues with xsd2ttcn [message #1791560 is a reply to message #1791555] |
Mon, 02 July 2018 13:29 |
|
Hi Yann,
the definition of Ellipsoid is there, both in .xsd and .ttcn:
grep llipsoid *.xsd
GML-pidf-lo-shape.xsd: <xs:element name="Ellipsoid" type="gs:EllipsoidType"
GML-pidf-lo-shape.xsd: <xs:complexType name="EllipsoidType">
esekilxxen1845 [15:23] [YannGarcia/XSD@TTCN/xsd] ->
esekilxxen1845 [15:23] [YannGarcia/XSD@TTCN/xsd] ->
esekilxxen1845 [15:23] [YannGarcia/XSD@TTCN/xsd] -> grep llipsoid *.ttcn
http_www_opengis_net_gml.ttcn: Ellipsoid ellipsoid,
http_www_opengis_net_gml.ttcn: variant (ellipsoid) "name as capitalized";
http_www_opengis_net_pidflo_1_0.ttcn:type EllipsoidType Ellipsoid
http_www_opengis_net_pidflo_1_0.ttcn:type record EllipsoidType
but it's not imported:
module http_www_opengis_net_gml {
import from XSD all;
:
:
try to add "import from http_www_opengis_net_pidflo_1_0.ttcn all"
to http_www_opengis_net_gml.ttcn
BR
Elemer
|
|
|
|
Re: Issues with xsd2ttcn [message #1791651 is a reply to message #1791623] |
Tue, 03 July 2018 10:23 |
|
Hi Yann, you're right ,
there's a glitch, we are looking into it.
Some structures are generated into http_www_opengis_net_gml.ttcn
instead of http_www_opengis_net_pidflo_1_0.ttcn
I have moved them to their right place and then it compiles ( see attached)
I'll come back to you.
BR
Elemer
|
|
|
Re: Issues with xsd2ttcn [message #1792335 is a reply to message #1791651] |
Mon, 16 July 2018 08:38 |
|
Hi Yann,
ok , here's the update on this issue:
the problem is that in such cases the converter generates definitions in the wrong file.
As a countermeasure we have introduced a switch -o which will have to effect to force generation of single TTCN file with a set name XSD_Definitions.ttcn , not one file per namespace
as without the -o switch.
Namespaces are separated in groups though.
xsd2ttcn -o *.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'...
Notify: Generating TTCN-3 modules...
Notify: File 'XSD_Definitions.ttcn' was generated.
Notify: File 'UsefulTtcn3Types.ttcn' was generated.
Notify: File 'XSD.ttcn' was generated.
This fix has been committed to github, could you please test it?
Thank you and regards
Elemer
|
|
|
Re: Issues with xsd2ttcn [message #1792338 is a reply to message #1792335] |
Mon, 16 July 2018 09:02 |
|
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.03773 seconds