From c4265f829af926fa228dc154b8dc0b0003c3f54c Mon Sep 17 00:00:00 2001 From: aschwinn <al.schwinn@gsi.de> Date: Wed, 21 Feb 2018 10:19:11 +0100 Subject: [PATCH] Restrictions for fesa-device-name to strict ( #44 ) --- silecs-model/src/xml/DeploySchema.xsd | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/silecs-model/src/xml/DeploySchema.xsd b/silecs-model/src/xml/DeploySchema.xsd index 4a185a3..8d75687 100644 --- a/silecs-model/src/xml/DeploySchema.xsd +++ b/silecs-model/src/xml/DeploySchema.xsd @@ -579,14 +579,31 @@ </xs:restriction> </xs:simpleType> - <xs:simpleType name="DeviceNameType"> + <!-- Base type which just forbid characters not supported by the DB --> + <xs:simpleType name="BaseType"> <xs:restriction base="xs:string"> + <xs:pattern value="[^&<>"]*" /> + </xs:restriction> + </xs:simpleType> + + <!-- Type for named item which are not transformed into Cpp object --> + <xs:simpleType name="NonIdentifierType"> + <xs:restriction base="BaseType"> + <!-- forbid leading and trailing space characters --> + <xs:pattern value="\S|(\S.*\S)" /> + </xs:restriction> + </xs:simpleType> + + <xs:simpleType name="DeviceNameType"> + <xs:restriction base="NonIdentifierType"> <xs:minLength value="1" /> <xs:maxLength value="30" /> <!-- In FESA the deviceName is restricted to max. 30 characters --> - <xs:pattern value="[_A-Za-z][_A-Za-z0-9]*" /> </xs:restriction> </xs:simpleType> + + + <xs:simpleType name="BothProtocolType"> <xs:restriction base="xs:string"> <xs:enumeration value="DEVICE_MODE" /> -- GitLab