Fix issues with XSD schemas.
This commit is contained in:
parent
c0deb4d27a
commit
3a88048952
|
@ -41,7 +41,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^\-()–+−=?:;'\\"]){1,1}([^\p{Zs}*/&|!<>^\-()–+−=?:;\\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^\-()–+−=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^\-()–+−=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="formatVersion">
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="formatVersion">
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="formatVersion">
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="formatVersion">
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -757,7 +757,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^\()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^\()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^\()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^\()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -760,7 +760,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^\()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^\()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -763,7 +763,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -773,7 +773,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -751,7 +751,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^\()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^\()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^\()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^\()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -754,7 +754,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^\()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^\()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^\()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^\()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -754,7 +754,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^\()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^\()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^\()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^\()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -755,7 +755,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^\()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^\()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^\()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^\()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -776,7 +776,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -791,7 +791,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -775,7 +775,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="uuid">
|
||||
|
|
|
@ -780,7 +780,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="uuid">
|
||||
|
|
|
@ -781,7 +781,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="uuid">
|
||||
|
|
|
@ -781,7 +781,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="uuid">
|
||||
|
|
|
@ -795,7 +795,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -801,7 +801,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -801,7 +801,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -841,7 +841,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -827,7 +827,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -829,7 +829,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
|
|
|
@ -761,7 +761,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="uuid">
|
||||
|
|
|
@ -767,7 +767,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="uuid">
|
||||
|
|
|
@ -808,7 +808,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="uuid">
|
||||
|
@ -836,7 +836,7 @@
|
|||
</xs:simpleType>
|
||||
<xs:simpleType name="contentType">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="image\/[-\w]+(\.[-\w]+)*([+][-\w]+)?"/>
|
||||
<xs:pattern value="image\\/[-\w]+(\.[-\w]+)*([+][-\w]+)?"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="colors">
|
||||
|
|
|
@ -817,7 +817,7 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="uuid">
|
||||
|
@ -845,7 +845,7 @@
|
|||
</xs:simpleType>
|
||||
<xs:simpleType name="contentType">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="image\/[-\w]+(\.[-\w]+)*([+][-\w]+)?"/>
|
||||
<xs:pattern value="image\\/[-\w]+(\.[-\w]+)*([+][-\w]+)?"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="colors">
|
||||
|
|
|
@ -822,12 +822,12 @@
|
|||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\\"]){1,1}([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="pieceShortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Zs}*\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
<xs:pattern value="([^\p{Zs}*\\/&|!<>^ \()\-−+.,٫, ٬.’=?:;\\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="uuid">
|
||||
|
@ -855,7 +855,7 @@
|
|||
</xs:simpleType>
|
||||
<xs:simpleType name="contentType">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="image\/[-\w]+(\.[-\w]+)*([+][-\w]+)?"/>
|
||||
<xs:pattern value="image\\/[-\w]+(\.[-\w]+)*([+][-\w]+)?"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="colors">
|
||||
|
|
|
@ -240,12 +240,11 @@ void VAbstractConverter::ValidateXML(const QString &schema) const
|
|||
throw VException(errorMsg);
|
||||
}
|
||||
|
||||
VParserErrorHandler messageHandler;
|
||||
QXmlSchema sch;
|
||||
sch.setMessageHandler(&messageHandler);
|
||||
sch.setMessageHandler(&parserErrorHandler);
|
||||
if (sch.load(&fileSchema, QUrl::fromLocalFile(fileSchema.fileName()))==false)
|
||||
{
|
||||
VException e(messageHandler.StatusMessage());
|
||||
VException e(parserErrorHandler.StatusMessage());
|
||||
e.AddMoreInformation(tr("Could not load schema file '%1'.").arg(fileSchema.fileName()));
|
||||
throw e;
|
||||
}
|
||||
|
@ -267,9 +266,9 @@ void VAbstractConverter::ValidateXML(const QString &schema) const
|
|||
|
||||
if (errorOccurred)
|
||||
{
|
||||
VException e(messageHandler.StatusMessage());
|
||||
e.AddMoreInformation(tr("Validation error file %3 in line %1 column %2").arg(messageHandler.Line())
|
||||
.arg(messageHandler.Column()).arg(m_originalFileName));
|
||||
VException e(parserErrorHandler.StatusMessage());
|
||||
e.AddMoreInformation(tr("Validation error file %3 in line %1 column %2").arg(parserErrorHandler.Line())
|
||||
.arg(parserErrorHandler.Column()).arg(m_originalFileName));
|
||||
throw e;
|
||||
}
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
|
@ -360,3 +359,15 @@ void VAbstractConverter::SetVersion(const QString &version)
|
|||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VAbstractConverter::XSDSchema(unsigned int ver) const
|
||||
{
|
||||
const QHash <unsigned, QString> schemas = Schemas();
|
||||
if (schemas.contains(ver))
|
||||
{
|
||||
return schemas.value(ver);
|
||||
}
|
||||
|
||||
InvalidVersion(ver);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include <QtGlobal>
|
||||
|
||||
#include "vdomdocument.h"
|
||||
#include "../vmisc/projectversion.h"
|
||||
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_GCC("-Wsuggest-final-types")
|
||||
|
@ -69,12 +68,14 @@ protected:
|
|||
virtual QString MinVerStr() const =0;
|
||||
virtual QString MaxVerStr() const =0;
|
||||
|
||||
virtual QString XSDSchema(unsigned ver) const =0;
|
||||
virtual QString XSDSchema(unsigned ver) const;
|
||||
virtual void ApplyPatches() =0;
|
||||
virtual void DowngradeToCurrentMaxVersion() =0;
|
||||
|
||||
virtual bool IsReadOnly() const =0;
|
||||
|
||||
virtual auto Schemas() const -> QHash <unsigned, QString> =0;
|
||||
|
||||
void Replace(QString &formula, const QString &newName, vsizetype position, const QString &token,
|
||||
vsizetype &bias) const;
|
||||
void CorrectionsPositions(vsizetype position, vsizetype bias, QMap<vsizetype, QString> &tokens) const;
|
||||
|
|
|
@ -51,6 +51,17 @@ VLabelTemplateConverter::VLabelTemplateConverter(const QString &fileName)
|
|||
ValidateInputFile(CurrentSchema);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VLabelTemplateConverter::XSDSchemas() -> QHash<unsigned int, QString>
|
||||
{
|
||||
static const auto schemas = QHash <unsigned, QString>
|
||||
{
|
||||
std::make_pair(FormatVersion(1, 0, 0), CurrentSchema)
|
||||
};
|
||||
|
||||
return schemas;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
unsigned VLabelTemplateConverter::MinVer() const
|
||||
{
|
||||
|
@ -75,20 +86,6 @@ QString VLabelTemplateConverter::MaxVerStr() const
|
|||
return LabelTemplateMaxVerStr;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VLabelTemplateConverter::XSDSchema(unsigned ver) const
|
||||
{
|
||||
switch (ver)
|
||||
{
|
||||
case (FormatVersion(1, 0, 0)):
|
||||
return CurrentSchema;
|
||||
default:
|
||||
InvalidVersion(ver);
|
||||
break;
|
||||
}
|
||||
return QString();//unreachable code
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VLabelTemplateConverter::ApplyPatches()
|
||||
{
|
||||
|
@ -108,3 +105,9 @@ void VLabelTemplateConverter::DowngradeToCurrentMaxVersion()
|
|||
SetVersion(LabelTemplateMaxVerStr);
|
||||
Save();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VLabelTemplateConverter::Schemas() const -> QHash<unsigned int, QString>
|
||||
{
|
||||
return XSDSchemas();
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#define VLABELTEMPLATECONVERTER_H
|
||||
|
||||
#include "vabstractconverter.h"
|
||||
#include "../vmisc/projectversion.h"
|
||||
|
||||
class VLabelTemplateConverter : public VAbstractConverter
|
||||
{
|
||||
|
@ -42,6 +43,8 @@ public:
|
|||
static Q_DECL_CONSTEXPR const unsigned LabelTemplateMinVer = FormatVersion(1, 0, 0);
|
||||
static Q_DECL_CONSTEXPR const unsigned LabelTemplateMaxVer = FormatVersion(1, 0, 0);
|
||||
|
||||
static auto XSDSchemas() -> QHash <unsigned, QString>;
|
||||
|
||||
protected:
|
||||
virtual unsigned MinVer() const override;
|
||||
virtual unsigned MaxVer() const override;
|
||||
|
@ -49,12 +52,13 @@ protected:
|
|||
virtual QString MinVerStr() const override;
|
||||
virtual QString MaxVerStr() const override;
|
||||
|
||||
virtual QString XSDSchema(unsigned ver) const override;
|
||||
virtual void ApplyPatches() override;
|
||||
virtual void DowngradeToCurrentMaxVersion() override;
|
||||
|
||||
virtual bool IsReadOnly() const override {return false;}
|
||||
|
||||
auto Schemas() const -> QHash <unsigned, QString> override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(VLabelTemplateConverter) // NOLINT
|
||||
static const QString LabelTemplateMinVerStr;
|
||||
|
|
|
@ -117,6 +117,20 @@ auto VLayoutConverter::GetFormatVersionStr() const -> QString
|
|||
return QStringLiteral("0.0.0");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VLayoutConverter::XSDSchemas() -> QHash<unsigned int, QString>
|
||||
{
|
||||
static auto schemas = QHash <unsigned, QString>
|
||||
{
|
||||
std::make_pair(FormatVersion(0, 1, 0), QStringLiteral("://schema/layout/v0.1.0.xsd")),
|
||||
std::make_pair(FormatVersion(0, 1, 1), QStringLiteral("://schema/layout/v0.1.1.xsd")),
|
||||
std::make_pair(FormatVersion(0, 1, 2), QStringLiteral("://schema/layout/v0.1.2.xsd")),
|
||||
std::make_pair(FormatVersion(0, 1, 3), CurrentSchema),
|
||||
};
|
||||
|
||||
return schemas;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VLayoutConverter::SetVersion(const QString &version)
|
||||
{
|
||||
|
@ -133,25 +147,6 @@ void VLayoutConverter::SetVersion(const QString &version)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VLayoutConverter::XSDSchema(unsigned ver) const -> QString
|
||||
{
|
||||
QHash <unsigned, QString> schemas =
|
||||
{
|
||||
std::make_pair(FormatVersion(0, 1, 0), QStringLiteral("://schema/layout/v0.1.0.xsd")),
|
||||
std::make_pair(FormatVersion(0, 1, 1), QStringLiteral("://schema/layout/v0.1.1.xsd")),
|
||||
std::make_pair(FormatVersion(0, 1, 2), QStringLiteral("://schema/layout/v0.1.2.xsd")),
|
||||
std::make_pair(FormatVersion(0, 1, 3), CurrentSchema),
|
||||
};
|
||||
|
||||
if (schemas.contains(ver))
|
||||
{
|
||||
return schemas.value(ver);
|
||||
}
|
||||
|
||||
InvalidVersion(ver);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VLayoutConverter::ApplyPatches()
|
||||
{
|
||||
|
@ -183,6 +178,12 @@ auto VLayoutConverter::IsReadOnly() const -> bool
|
|||
return false;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VLayoutConverter::Schemas() const -> QHash<unsigned int, QString>
|
||||
{
|
||||
return XSDSchemas();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VLayoutConverter::ConvertPiecesToV0_1_3()
|
||||
{
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#define VLAYOUTCONVERTER_H
|
||||
|
||||
#include "vabstractconverter.h"
|
||||
#include "../vmisc/projectversion.h"
|
||||
|
||||
class QDomElement;
|
||||
class QString;
|
||||
|
@ -47,6 +48,8 @@ public:
|
|||
static Q_DECL_CONSTEXPR const unsigned LayoutMinVer = FormatVersion(0, 1, 0);
|
||||
static Q_DECL_CONSTEXPR const unsigned LayoutMaxVer = FormatVersion(0, 1, 3);
|
||||
|
||||
static auto XSDSchemas() -> QHash <unsigned, QString>;
|
||||
|
||||
protected:
|
||||
void SetVersion(const QString &version) override;
|
||||
|
||||
|
@ -56,12 +59,13 @@ protected:
|
|||
auto MinVerStr() const -> QString override;
|
||||
auto MaxVerStr() const -> QString override;
|
||||
|
||||
auto XSDSchema(unsigned ver) const -> QString override;
|
||||
void ApplyPatches() override;
|
||||
void DowngradeToCurrentMaxVersion() override;
|
||||
|
||||
auto IsReadOnly() const -> bool override;
|
||||
|
||||
auto Schemas() const -> QHash <unsigned, QString> override;
|
||||
|
||||
void ConvertPiecesToV0_1_3();
|
||||
void ConvertPathToV0_1_3(QDomElement &node);
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VParserErrorHandler::StatusMessage() const
|
||||
auto VParserErrorHandler::StatusMessage() const -> QString
|
||||
{
|
||||
QTextDocument doc;
|
||||
doc.setHtml(m_description);
|
||||
|
@ -37,17 +37,23 @@ QString VParserErrorHandler::StatusMessage() const
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qint64 VParserErrorHandler::Line() const
|
||||
auto VParserErrorHandler::Line() const -> qint64
|
||||
{
|
||||
return m_sourceLocation.line();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qint64 VParserErrorHandler::Column() const
|
||||
auto VParserErrorHandler::Column() const -> qint64
|
||||
{
|
||||
return m_sourceLocation.column();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VParserErrorHandler::HasError() const -> bool
|
||||
{
|
||||
return m_hasError;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
// cppcheck-suppress unusedFunction
|
||||
void VParserErrorHandler::handleMessage(QtMsgType type, const QString &description, const QUrl &identifier,
|
||||
|
@ -59,6 +65,7 @@ void VParserErrorHandler::handleMessage(QtMsgType type, const QString &descripti
|
|||
m_messageType = type;
|
||||
m_description = description;
|
||||
m_sourceLocation = sourceLocation;
|
||||
m_hasError = true;
|
||||
}
|
||||
|
||||
#else
|
||||
|
|
|
@ -38,17 +38,20 @@ class VParserErrorHandler : public QAbstractMessageHandler
|
|||
public:
|
||||
VParserErrorHandler() =default;
|
||||
|
||||
QString StatusMessage() const;
|
||||
qint64 Line() const;
|
||||
qint64 Column() const;
|
||||
auto StatusMessage() const -> QString;
|
||||
auto Line() const -> qint64;
|
||||
auto Column() const -> qint64;
|
||||
|
||||
auto HasError() const -> bool;
|
||||
protected:
|
||||
// cppcheck-suppress unusedFunction
|
||||
virtual void handleMessage(QtMsgType type, const QString &description,
|
||||
void handleMessage(QtMsgType type, const QString &description,
|
||||
const QUrl &identifier, const QSourceLocation &sourceLocation) override;
|
||||
private:
|
||||
QtMsgType m_messageType{};
|
||||
QString m_description{};
|
||||
QSourceLocation m_sourceLocation{};
|
||||
bool m_hasError{false};
|
||||
};
|
||||
|
||||
#else
|
||||
|
@ -61,16 +64,16 @@ XERCES_CPP_NAMESPACE_USE
|
|||
class VParserErrorHandler : public ErrorHandler
|
||||
{
|
||||
public:
|
||||
QString StatusMessage() const;
|
||||
XMLFileLoc Line() const;
|
||||
XMLFileLoc Column() const;
|
||||
auto StatusMessage() const -> QString;
|
||||
auto Line() const -> XMLFileLoc;
|
||||
auto Column() const -> XMLFileLoc;
|
||||
|
||||
void warning(const SAXParseException& ex) override;
|
||||
void error(const SAXParseException& ex) override;
|
||||
void fatalError(const SAXParseException& ex) override;
|
||||
void resetErrors() override;
|
||||
|
||||
bool HasError() const;
|
||||
auto HasError() const -> bool;
|
||||
|
||||
private:
|
||||
XMLFileLoc m_line{0};
|
||||
|
|
|
@ -181,25 +181,9 @@ VPatternConverter::VPatternConverter(const QString &fileName)
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPatternConverter::Save()
|
||||
auto VPatternConverter::XSDSchemas() -> QHash<unsigned int, QString>
|
||||
{
|
||||
try
|
||||
{
|
||||
TestUniqueId();
|
||||
}
|
||||
catch (const VExceptionWrongId &e)
|
||||
{
|
||||
Q_UNUSED(e)
|
||||
throw VException(tr("Error no unique id."));
|
||||
}
|
||||
|
||||
VAbstractConverter::Save();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VPatternConverter::XSDSchema(unsigned ver) const -> QString
|
||||
{
|
||||
QHash <unsigned, QString> schemas =
|
||||
static const auto schemas = QHash <unsigned, QString>
|
||||
{
|
||||
std::make_pair(FormatVersion(0, 1, 4), QStringLiteral("://schema/pattern/v0.1.4.xsd")),
|
||||
std::make_pair(FormatVersion(0, 2, 0), QStringLiteral("://schema/pattern/v0.2.0.xsd")),
|
||||
|
@ -271,12 +255,23 @@ auto VPatternConverter::XSDSchema(unsigned ver) const -> QString
|
|||
std::make_pair(FormatVersion(0, 9, 2), CurrentSchema)
|
||||
};
|
||||
|
||||
if (schemas.contains(ver))
|
||||
return schemas;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPatternConverter::Save()
|
||||
{
|
||||
try
|
||||
{
|
||||
return schemas.value(ver);
|
||||
TestUniqueId();
|
||||
}
|
||||
catch (const VExceptionWrongId &e)
|
||||
{
|
||||
Q_UNUSED(e)
|
||||
throw VException(tr("Error no unique id."));
|
||||
}
|
||||
|
||||
InvalidVersion(ver);
|
||||
VAbstractConverter::Save();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -414,6 +409,12 @@ bool VPatternConverter::IsReadOnly() const
|
|||
return GetParametrBool(pattern, *strReadOnly, falseStr);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VPatternConverter::Schemas() const -> QHash<unsigned int, QString>
|
||||
{
|
||||
return XSDSchemas();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPatternConverter::ToV0_2_0()
|
||||
{
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include <QtGlobal>
|
||||
|
||||
#include "vabstractconverter.h"
|
||||
#include "../vmisc/projectversion.h"
|
||||
|
||||
class QDomElement;
|
||||
|
||||
|
@ -55,6 +56,8 @@ public:
|
|||
static Q_DECL_CONSTEXPR const unsigned PatternMinVer = FormatVersion(0, 1, 4);
|
||||
static Q_DECL_CONSTEXPR const unsigned PatternMaxVer = FormatVersion(0, 9, 2);
|
||||
|
||||
static auto XSDSchemas() -> QHash <unsigned, QString>;
|
||||
|
||||
protected:
|
||||
void Save() override;
|
||||
|
||||
|
@ -64,12 +67,13 @@ protected:
|
|||
virtual QString MinVerStr() const override;
|
||||
virtual QString MaxVerStr() const override;
|
||||
|
||||
virtual QString XSDSchema(unsigned ver) const override;
|
||||
virtual void ApplyPatches() override;
|
||||
virtual void DowngradeToCurrentMaxVersion() override;
|
||||
|
||||
virtual bool IsReadOnly() const override;
|
||||
|
||||
auto Schemas() const -> QHash <unsigned, QString> override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(VPatternConverter) // NOLINT
|
||||
static const QString PatternMinVerStr;
|
||||
|
|
|
@ -76,9 +76,9 @@ VVITConverter::VVITConverter(const QString &fileName)
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VVITConverter::XSDSchema(unsigned ver) const
|
||||
auto VVITConverter::XSDSchemas() -> QHash<unsigned int, QString>
|
||||
{
|
||||
QHash <unsigned, QString> schemas =
|
||||
static auto schemas = QHash <unsigned, QString>
|
||||
{
|
||||
std::make_pair(FormatVersion(0, 2, 0), QStringLiteral("://schema/individual_measurements/v0.2.0.xsd")),
|
||||
std::make_pair(FormatVersion(0, 3, 0), QStringLiteral("://schema/individual_measurements/v0.3.0.xsd")),
|
||||
|
@ -91,14 +91,7 @@ QString VVITConverter::XSDSchema(unsigned ver) const
|
|||
std::make_pair(FormatVersion(0, 5, 2), CurrentSchema),
|
||||
};
|
||||
|
||||
if (schemas.contains(ver))
|
||||
{
|
||||
return schemas.value(ver);
|
||||
}
|
||||
else
|
||||
{
|
||||
InvalidVersion(ver);
|
||||
}
|
||||
return schemas;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -156,6 +149,12 @@ bool VVITConverter::IsReadOnly() const
|
|||
return UniqueTagText(*strTagRead_Only, falseStr) == trueStr;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VVITConverter::Schemas() const -> QHash<unsigned int, QString>
|
||||
{
|
||||
return XSDSchemas();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VVITConverter::AddNewTagsForV0_3_0()
|
||||
{
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <QtGlobal>
|
||||
|
||||
#include "vabstractmconverter.h"
|
||||
#include "vabstractconverter.h"
|
||||
#include "../vmisc/projectversion.h"
|
||||
|
||||
class QDomElement;
|
||||
|
||||
|
@ -51,6 +51,8 @@ public:
|
|||
static Q_DECL_CONSTEXPR const unsigned MeasurementMinVer = FormatVersion(0, 2, 0);
|
||||
static Q_DECL_CONSTEXPR const unsigned MeasurementMaxVer = FormatVersion(0, 5, 2);
|
||||
|
||||
static auto XSDSchemas() -> QHash <unsigned, QString>;
|
||||
|
||||
protected:
|
||||
virtual unsigned MinVer() const override;
|
||||
virtual unsigned MaxVer() const override;
|
||||
|
@ -58,11 +60,12 @@ protected:
|
|||
virtual QString MinVerStr() const override;
|
||||
virtual QString MaxVerStr() const override;
|
||||
|
||||
virtual QString XSDSchema(unsigned ver) const override;
|
||||
virtual void ApplyPatches() override;
|
||||
virtual void DowngradeToCurrentMaxVersion() override;
|
||||
virtual bool IsReadOnly() const override;
|
||||
|
||||
auto Schemas() const -> QHash <unsigned, QString> override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(VVITConverter) // NOLINT
|
||||
static const QString MeasurementMinVerStr;
|
||||
|
|
|
@ -73,9 +73,9 @@ VVSTConverter::VVSTConverter(const QString &fileName)
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VVSTConverter::XSDSchema(unsigned ver) const -> QString
|
||||
auto VVSTConverter::XSDSchemas() -> QHash<unsigned int, QString>
|
||||
{
|
||||
QHash <unsigned, QString> schemas =
|
||||
static auto schemas = QHash <unsigned, QString>
|
||||
{
|
||||
std::make_pair(FormatVersion(0, 3, 0), QStringLiteral("://schema/multisize_measurements/v0.3.0.xsd")),
|
||||
std::make_pair(FormatVersion(0, 4, 0), QStringLiteral("://schema/multisize_measurements/v0.4.0.xsd")),
|
||||
|
@ -90,12 +90,7 @@ auto VVSTConverter::XSDSchema(unsigned ver) const -> QString
|
|||
std::make_pair(FormatVersion(0, 5, 4), CurrentSchema),
|
||||
};
|
||||
|
||||
if (schemas.contains(ver))
|
||||
{
|
||||
return schemas.value(ver);
|
||||
}
|
||||
|
||||
InvalidVersion(ver);
|
||||
return schemas;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -153,6 +148,12 @@ auto VVSTConverter::IsReadOnly() const -> bool
|
|||
return UniqueTagText(*strTagRead_Only, falseStr) == trueStr;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VVSTConverter::Schemas() const -> QHash<unsigned int, QString>
|
||||
{
|
||||
return XSDSchemas();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VVSTConverter::AddNewTagsForV0_4_0()
|
||||
{
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <QtGlobal>
|
||||
|
||||
#include "vabstractmconverter.h"
|
||||
#include "vabstractconverter.h"
|
||||
#include "../vmisc/projectversion.h"
|
||||
|
||||
class QDomElement;
|
||||
|
||||
|
@ -51,6 +51,8 @@ public:
|
|||
static Q_DECL_CONSTEXPR const unsigned MeasurementMinVer = FormatVersion(0, 3, 0);
|
||||
static Q_DECL_CONSTEXPR const unsigned MeasurementMaxVer = FormatVersion(0, 5, 4);
|
||||
|
||||
static auto XSDSchemas() -> QHash <unsigned, QString>;
|
||||
|
||||
protected:
|
||||
virtual unsigned MinVer() const override;
|
||||
virtual unsigned MaxVer() const override;
|
||||
|
@ -58,11 +60,12 @@ protected:
|
|||
virtual QString MinVerStr() const override;
|
||||
virtual QString MaxVerStr() const override;
|
||||
|
||||
virtual QString XSDSchema(unsigned ver) const override;
|
||||
virtual void ApplyPatches() override;
|
||||
virtual void DowngradeToCurrentMaxVersion() override;
|
||||
virtual bool IsReadOnly() const override;
|
||||
|
||||
auto Schemas() const -> QHash <unsigned, QString> override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(VVSTConverter) // NOLINT
|
||||
static const QString MeasurementMinVerStr;
|
||||
|
|
|
@ -52,6 +52,18 @@ VWatermarkConverter::VWatermarkConverter(const QString &fileName)
|
|||
ValidateInputFile(CurrentSchema);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VWatermarkConverter::XSDSchemas() -> QHash<unsigned int, QString>
|
||||
{
|
||||
static auto schemas = QHash <unsigned, QString>
|
||||
{
|
||||
std::make_pair(FormatVersion(1, 0, 0), QStringLiteral("://schema/watermark/v1.0.0.xsd")),
|
||||
std::make_pair(FormatVersion(1, 1, 0), CurrentSchema)
|
||||
};
|
||||
|
||||
return schemas;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
unsigned VWatermarkConverter::MinVer() const
|
||||
{
|
||||
|
@ -76,23 +88,6 @@ QString VWatermarkConverter::MaxVerStr() const
|
|||
return WatermarkMaxVerStr;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VWatermarkConverter::XSDSchema(unsigned ver) const
|
||||
{
|
||||
QHash <unsigned, QString> schemas =
|
||||
{
|
||||
std::make_pair(FormatVersion(1, 0, 0), QStringLiteral("://schema/watermark/v1.0.0.xsd")),
|
||||
std::make_pair(FormatVersion(1, 1, 0), CurrentSchema)
|
||||
};
|
||||
|
||||
if (schemas.contains(ver))
|
||||
{
|
||||
return schemas.value(ver);
|
||||
}
|
||||
|
||||
InvalidVersion(ver);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VWatermarkConverter::ApplyPatches()
|
||||
{
|
||||
|
@ -116,6 +111,12 @@ void VWatermarkConverter::DowngradeToCurrentMaxVersion()
|
|||
Save();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VWatermarkConverter::Schemas() const -> QHash<unsigned int, QString>
|
||||
{
|
||||
return XSDSchemas();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VWatermarkConverter::ToV1_1_0()
|
||||
{
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#define VWATERMARKCONVERTER_H
|
||||
|
||||
#include "vabstractconverter.h"
|
||||
#include "../vmisc/projectversion.h"
|
||||
|
||||
class VWatermarkConverter final : public VAbstractConverter
|
||||
{
|
||||
|
@ -41,6 +42,8 @@ public:
|
|||
static Q_DECL_CONSTEXPR const unsigned WatermarkMinVer = FormatVersion(1, 0, 0);
|
||||
static Q_DECL_CONSTEXPR const unsigned WatermarkMaxVer = FormatVersion(1, 1, 0);
|
||||
|
||||
static auto XSDSchemas() -> QHash <unsigned, QString>;
|
||||
|
||||
protected:
|
||||
virtual unsigned MinVer() const override;
|
||||
virtual unsigned MaxVer() const override;
|
||||
|
@ -48,12 +51,13 @@ protected:
|
|||
virtual QString MinVerStr() const override;
|
||||
virtual QString MaxVerStr() const override;
|
||||
|
||||
virtual QString XSDSchema(unsigned ver) const override;
|
||||
virtual void ApplyPatches() override;
|
||||
virtual void DowngradeToCurrentMaxVersion() override;
|
||||
|
||||
virtual bool IsReadOnly() const override {return false;}
|
||||
|
||||
auto Schemas() const -> QHash <unsigned, QString> override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(VWatermarkConverter) // NOLINT
|
||||
static const QString WatermarkMinVerStr;
|
||||
|
|
|
@ -16,6 +16,11 @@ VTestApp {
|
|||
condition: Utilities.versionCompare(Qt.core.version, "6") >= 0
|
||||
}
|
||||
|
||||
Depends {
|
||||
name: "Qt.xmlpatterns"
|
||||
condition: Utilities.versionCompare(Qt.core.version, "6") < 0
|
||||
}
|
||||
|
||||
name: "ValentinaTest"
|
||||
buildconfig.appTarget: qbs.targetOS.contains("macos") ? "ValentinaTest" : "valentinaTest"
|
||||
targetName: buildconfig.appTarget
|
||||
|
@ -70,6 +75,8 @@ VTestApp {
|
|||
"tst_vtranslatevars.h",
|
||||
"tst_vabstractpiece.h",
|
||||
"tst_vtooluniondetails.h",
|
||||
"tst_xsdschema.cpp",
|
||||
"tst_xsdschema.h",
|
||||
]
|
||||
|
||||
Group {
|
||||
|
|
|
@ -28,6 +28,10 @@
|
|||
|
||||
#include <QtTest>
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
#include <xercesc/util/PlatformUtils.hpp>
|
||||
#endif
|
||||
|
||||
#include "tst_vposter.h"
|
||||
#include "tst_vabstractpiece.h"
|
||||
#include "tst_vspline.h"
|
||||
|
@ -52,6 +56,7 @@
|
|||
#include "tst_vtooluniondetails.h"
|
||||
#include "tst_vdomdocument.h"
|
||||
#include "tst_dxf.h"
|
||||
#include "tst_xsdschema.h"
|
||||
|
||||
#include "../vmisc/def.h"
|
||||
#include "../qmuparser/qmudef.h"
|
||||
|
@ -62,6 +67,12 @@ int main(int argc, char** argv)
|
|||
{
|
||||
Q_INIT_RESOURCE(schema);
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
XERCES_CPP_NAMESPACE::XMLPlatformUtils::Initialize();
|
||||
|
||||
auto Terminate = qScopeGuard([](){ XERCES_CPP_NAMESPACE::XMLPlatformUtils::Terminate(); });
|
||||
#endif
|
||||
|
||||
TestVApplication app( argc, argv );// For QPrinter
|
||||
|
||||
QResource::registerResource(QCoreApplication::applicationDirPath() + QStringLiteral("/test_data.rcc"));
|
||||
|
@ -96,6 +107,7 @@ int main(int argc, char** argv)
|
|||
ASSERT_TEST(new TST_VTranslateVars());
|
||||
ASSERT_TEST(new TST_VToolUnionDetails());
|
||||
ASSERT_TEST(new TST_DXF());
|
||||
ASSERT_TEST(new TST_XSDShema());
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
269
src/test/ValentinaTest/tst_xsdschema.cpp
Normal file
269
src/test/ValentinaTest/tst_xsdschema.cpp
Normal file
|
@ -0,0 +1,269 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file tst_xsdschema.cpp
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 10 2, 2023
|
||||
**
|
||||
** @brief
|
||||
** @copyright
|
||||
** This source code is part of the Valentina project, a pattern making
|
||||
** program, whose allow create and modeling patterns of clothing.
|
||||
** Copyright (C) 2023 Valentina project
|
||||
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
|
||||
**
|
||||
** Valentina is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** Valentina is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
||||
**
|
||||
*************************************************************************/
|
||||
#include "tst_xsdschema.h"
|
||||
|
||||
#include "../ifc/xml/vpatternconverter.h"
|
||||
#include "../ifc/xml/vlabeltemplateconverter.h"
|
||||
#include "../ifc/xml/vlayoutconverter.h"
|
||||
#include "../ifc/xml/vvitconverter.h"
|
||||
#include "../ifc/xml/vvstconverter.h"
|
||||
#include "../ifc/xml/vwatermarkconverter.h"
|
||||
#include "../ifc/xml/vparsererrorhandler.h"
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
#include <xercesc/parsers/XercesDOMParser.hpp>
|
||||
|
||||
#include <QMap>
|
||||
#else
|
||||
#include <QXmlSchema>
|
||||
#include <QXmlSchemaValidator>
|
||||
#endif // QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
|
||||
namespace
|
||||
{
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void ValidateSchema(const QString &schema)
|
||||
{
|
||||
QFile fileSchema(schema);
|
||||
if (not fileSchema.open(QIODevice::ReadOnly))
|
||||
{
|
||||
QFAIL(qUtf8Printable(QStringLiteral("Can't open file %1:\n%2.").arg(schema, fileSchema.errorString())));
|
||||
}
|
||||
|
||||
VParserErrorHandler parserErrorHandler;
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
QScopedPointer<QTemporaryFile> tempSchema(QTemporaryFile::createNativeFile(fileSchema));
|
||||
if (tempSchema == nullptr)
|
||||
{
|
||||
QFAIL(qUtf8Printable(QStringLiteral("Can't create native file for schema file %1:\n%2.")
|
||||
.arg(schema, fileSchema.errorString())));
|
||||
}
|
||||
|
||||
if (tempSchema->open())
|
||||
{
|
||||
XercesDOMParser domParser;
|
||||
domParser.setErrorHandler(&parserErrorHandler);
|
||||
|
||||
if (domParser.loadGrammar(
|
||||
tempSchema->fileName().toUtf8().constData(), Grammar::SchemaGrammarType, true) == nullptr)
|
||||
{
|
||||
QFAIL(qUtf8Printable(QStringLiteral("%1 Could not load schema file '%2'.")
|
||||
.arg(parserErrorHandler.StatusMessage(), fileSchema.fileName())));
|
||||
}
|
||||
|
||||
QVERIFY2(not parserErrorHandler.HasError(),
|
||||
qUtf8Printable(QStringLiteral("%1 Schema file %2 invalid in line %3 column %4.")
|
||||
.arg(parserErrorHandler.StatusMessage(), fileSchema.fileName())
|
||||
.arg(parserErrorHandler.Line())
|
||||
.arg(parserErrorHandler.Column())));
|
||||
}
|
||||
else
|
||||
{
|
||||
QFAIL("Unable to open native file for schema");
|
||||
}
|
||||
#else
|
||||
QXmlSchema sch;
|
||||
sch.setMessageHandler(&parserErrorHandler);
|
||||
if (not sch.load(&fileSchema, QUrl::fromLocalFile(fileSchema.fileName())))
|
||||
{
|
||||
QFAIL(qUtf8Printable(QStringLiteral("%1 Could not load schema file '%2'.")
|
||||
.arg(parserErrorHandler.StatusMessage(), fileSchema.fileName())));
|
||||
}
|
||||
|
||||
QVERIFY2(sch.isValid(), qUtf8Printable(QStringLiteral("%1 Validation error file %2 in line %3 column %4.")
|
||||
.arg(parserErrorHandler.StatusMessage(), fileSchema.fileName())
|
||||
.arg(parserErrorHandler.Line())
|
||||
.arg(parserErrorHandler.Column())));
|
||||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto HashToMap(const QHash<unsigned int, QString> &hash) -> QMap<unsigned int, QString>
|
||||
{
|
||||
QMap<unsigned int, QString> map;
|
||||
|
||||
auto i = hash.constBegin();
|
||||
while (i != hash.constEnd())
|
||||
{
|
||||
map.insert(i.key(), i.value());
|
||||
++i;
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
TST_XSDShema::TST_XSDShema(QObject *parent)
|
||||
:QObject(parent)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TST_XSDShema::TestPatternSchema_data()
|
||||
{
|
||||
QTest::addColumn<QString>("schema");
|
||||
|
||||
const QMap<unsigned int, QString> schemas = HashToMap(VPatternConverter::XSDSchemas());
|
||||
|
||||
auto i = schemas.constBegin();
|
||||
while (i != schemas.constEnd())
|
||||
{
|
||||
QFileInfo f(i.value());
|
||||
QTest::newRow(qUtf8Printable(f.fileName())) << i.value();
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TST_XSDShema::TestPatternSchema()
|
||||
{
|
||||
QFETCH(QString, schema);
|
||||
|
||||
ValidateSchema(schema);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TST_XSDShema::TestPatternLabelSchema_data()
|
||||
{
|
||||
QTest::addColumn<QString>("schema");
|
||||
|
||||
const QMap<unsigned int, QString> schemas = HashToMap(VLabelTemplateConverter::XSDSchemas());
|
||||
|
||||
auto i = schemas.constBegin();
|
||||
while (i != schemas.constEnd())
|
||||
{
|
||||
QFileInfo f(i.value());
|
||||
QTest::newRow(qUtf8Printable(f.fileName())) << i.value();
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TST_XSDShema::TestPatternLabelSchema()
|
||||
{
|
||||
QFETCH(QString, schema);
|
||||
|
||||
ValidateSchema(schema);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TST_XSDShema::TestLayoutSchema_data()
|
||||
{
|
||||
QTest::addColumn<QString>("schema");
|
||||
|
||||
const QMap<unsigned int, QString> schemas = HashToMap(VLayoutConverter::XSDSchemas());
|
||||
|
||||
auto i = schemas.constBegin();
|
||||
while (i != schemas.constEnd())
|
||||
{
|
||||
QFileInfo f(i.value());
|
||||
QTest::newRow(qUtf8Printable(f.fileName())) << i.value();
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TST_XSDShema::TestLayoutSchema()
|
||||
{
|
||||
QFETCH(QString, schema);
|
||||
|
||||
ValidateSchema(schema);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TST_XSDShema::TestVITSchema_data()
|
||||
{
|
||||
QTest::addColumn<QString>("schema");
|
||||
|
||||
const QMap<unsigned int, QString> schemas = HashToMap(VVITConverter::XSDSchemas());
|
||||
|
||||
auto i = schemas.constBegin();
|
||||
while (i != schemas.constEnd())
|
||||
{
|
||||
QFileInfo f(i.value());
|
||||
QTest::newRow(qUtf8Printable(f.fileName())) << i.value();
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TST_XSDShema::TestVITSchema()
|
||||
{
|
||||
QFETCH(QString, schema);
|
||||
|
||||
ValidateSchema(schema);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TST_XSDShema::TestVSTSchema_data()
|
||||
{
|
||||
QTest::addColumn<QString>("schema");
|
||||
|
||||
const QMap<unsigned int, QString> schemas = HashToMap(VVSTConverter::XSDSchemas());
|
||||
|
||||
auto i = schemas.constBegin();
|
||||
while (i != schemas.constEnd())
|
||||
{
|
||||
QFileInfo f(i.value());
|
||||
QTest::newRow(qUtf8Printable(f.fileName())) << i.value();
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TST_XSDShema::TestVSTSchema()
|
||||
{
|
||||
QFETCH(QString, schema);
|
||||
|
||||
ValidateSchema(schema);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TST_XSDShema::TestWatermarkSchema_data()
|
||||
{
|
||||
QTest::addColumn<QString>("schema");
|
||||
|
||||
const QMap<unsigned int, QString> schemas = HashToMap(VWatermarkConverter::XSDSchemas());
|
||||
|
||||
auto i = schemas.constBegin();
|
||||
while (i != schemas.constEnd())
|
||||
{
|
||||
QFileInfo f(i.value());
|
||||
QTest::newRow(qUtf8Printable(f.fileName())) << i.value();
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TST_XSDShema::TestWatermarkSchema()
|
||||
{
|
||||
QFETCH(QString, schema);
|
||||
|
||||
ValidateSchema(schema);
|
||||
}
|
62
src/test/ValentinaTest/tst_xsdschema.h
Normal file
62
src/test/ValentinaTest/tst_xsdschema.h
Normal file
|
@ -0,0 +1,62 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file tst_xsdschema.h
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 10 2, 2023
|
||||
**
|
||||
** @brief
|
||||
** @copyright
|
||||
** This source code is part of the Valentina project, a pattern making
|
||||
** program, whose allow create and modeling patterns of clothing.
|
||||
** Copyright (C) 2023 Valentina project
|
||||
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
|
||||
**
|
||||
** Valentina is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** Valentina is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
||||
**
|
||||
*************************************************************************/
|
||||
#ifndef TST_XSDSCHEMA_H
|
||||
#define TST_XSDSCHEMA_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class TST_XSDShema :public QObject
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
public:
|
||||
explicit TST_XSDShema(QObject *parent = nullptr);
|
||||
~TST_XSDShema() override = default;
|
||||
|
||||
private slots:
|
||||
void TestPatternSchema_data();
|
||||
void TestPatternSchema();
|
||||
void TestPatternLabelSchema_data();
|
||||
void TestPatternLabelSchema();
|
||||
void TestLayoutSchema_data();
|
||||
void TestLayoutSchema();
|
||||
void TestVITSchema_data();
|
||||
void TestVITSchema();
|
||||
void TestVSTSchema_data();
|
||||
void TestVSTSchema();
|
||||
void TestWatermarkSchema_data();
|
||||
void TestWatermarkSchema();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(TST_XSDShema) // NOLINT
|
||||
};
|
||||
|
||||
#endif // TST_XSDSCHEMA_H
|
Loading…
Reference in New Issue
Block a user