Conversation
For this one, the double restriction does not work as it generates a weird loop by adding <xsd:attribute name="ref" type="TypeOfValueIdType" use="required"> under the restriction
Undo the restriction on AllTransportOrganisationsRefStructure, AllPublicTransportOrganisationsRefStructure, and AllOperatorsRefStructure due to it creating a double contraints with the complexType
|
Your interpretation is not correct. A restriction must name everything under it, hence if it is not named, it does not exist. There is no double constraint. So while I can agree with the change, because it seems that those element in fact have a meaning, the reason why you are proposing it, is wrong. |
Chances are very high that I express my understanding wrongly. But, the way I read it is the above mentioned xxxRef or xxxRefStructure were part of Substition Groups for which the restriction was already existing. |
Then you just understand it wrong. There are never double constraints. |
Apologies if the way I express what I see is using the wrong word. Sharing how I found the errors and the interpertation I had.
At step 2, these errors were flagged: And, when I went to the XSD schema, I read this: So, the way I interpreted it is the 2 times restriction on Is is clearer for review, @skinkie? |
|
Lets say first, these errors should be reported in xmllint too, they are not on this topic, and I am very sure they were on others. So that is interesting. The first error mentions that an anonymous (thus a ComplexType as part of an element) is not valid. What I think that it wants to explain you is that the AllTransportOrganisationsRefStructure has a different restriction. Or that name="nameOfRefClass" type="NameOfClass" may not be the correct restriction. This is not a fix, it is just reverting what it was. And since extension essentially copies the restriction 1:1 it resolves it. My suggestion if you are in xmlspy maybe there is an option to convert the extension to a restriction, and see what the differences are. @ue71603 anything you know that is possible? |
|
@TuThoThai @skinkie I see the error as well |
ue71603
left a comment
There was a problem hiding this comment.
I just replicated the work. so I agree
|
@ue71603 this is not something to agree with. The proposed is not a fix, it is just reverting what has been created. The question was: can xmlspy suggest what the restriction should look like to be correctly derived. |
|
a lot was missing the fixed="All" in ref. |
|
@skinkie, I did spent a bit of time trying all combination that you have in the drop-down list of XMLSpy to make a valid schema. And the only correct sequence is: <xsd:element name="AllCountriesRef">
<xsd:annotation>
<xsd:documentation>Reference to a country ISO 3166-1 Note that GB is used for UK . May be qualified with a 3166-2 subdivision e.g. gb +m ENG, GB + SCT, GB See www.iso.org/iso/country_codes/iso_3166_code_lists.htm.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:simpleContent>
<xsd:restriction base="AllCountriesRefStructure" />
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="AllCountriesRefStructure">
<xsd:annotation>
<xsd:documentation>Type for a reference All Countries.</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:restriction base="TypeOfValueRefStructure">
<xsd:attribute name="ref" type="TypeOfValueIdType" use="required" fixed="All">
<xsd:annotation>
<xsd:documentation>Iso 3166-1 Two Character country code.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>Which equals to reverting your PR on 4 elements only. I think it would be best to accept this for now and rework that part for v2.1 or v3.0. |
This is wrong. Because all attributes below are then ommited. |
The way I read it is that the XSD sends you to the restrictions listed below in the <xsd:restriction base="TypeOfValueRefStructure">
<xsd:attribute name="ref" type="TypeOfValueIdType" use="required" fixed="All">
<xsd:annotation>
<xsd:documentation>Iso 3166-1 Two Character country code.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:restriction> |
* undoing two problems he identified.
|
Thanks for fixing the last items, @ue71603! Looks good to me 🙏 |
|
@skinkie sorry. still not clear. the fixed="All" is gone at that location. |
Remove the entire ref attribute, if possible. |
skinkie
left a comment
There was a problem hiding this comment.
I am unhappy with the complexContent to simpleContent. But if it works, I am ok.





This fixes small bugs I have found after we merged #975, mostly due to the fact that it creates a double contraint on xxxRefStructure for items for which the restriction is defined just after in the XSD by using:
<xsd:restriction base="xxxRefStructure"/>that is linked to acomplexTypein which the attributes restrictions are alreay listed.Namely, I am undoing the restriction for:
It also removes some files in the project file that no longer exist.
It fixes some problems with the WSDL generation from the project