Skip to content

Commit 35f2185

Browse files
MohamadAssanihoward
authored andcommitted
Disallow empty and space-only item names (#9)
1 parent 2669d68 commit 35f2185

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>com.findologic</groupId>
55
<artifactId>xml-export</artifactId>
66
<packaging>jar</packaging>
7-
<version>1.0-SNAPSHOT</version>
7+
<version>1.1-SNAPSHOT</version>
88
<name>xml-export</name>
99
<url>http://maven.apache.org</url>
1010
<dependencies>

src/main/resources/findologic.xsd

+16-3
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
<!-- Names -->
110110
<xs:complexType name="namesType">
111111
<xs:sequence>
112-
<xs:element type="stringWithUsergroup" name="name" minOccurs="0" maxOccurs="unbounded"/>
112+
<xs:element type="nameWithUsergroup" name="name" minOccurs="1" maxOccurs="unbounded"/>
113113
</xs:sequence>
114114
</xs:complexType>
115115

@@ -200,7 +200,7 @@
200200
<xs:simpleType name="usergroupHash">
201201
<xs:restriction base="xs:string">
202202
<xs:minLength value="1"/>
203-
</xs:restriction>
203+
</xs:restriction>
204204
</xs:simpleType>
205205
<xs:complexType name="stringWithUsergroup">
206206
<xs:simpleContent>
@@ -209,6 +209,19 @@
209209
</xs:extension>
210210
</xs:simpleContent>
211211
</xs:complexType>
212+
<xs:simpleType name="nonEmptyString">
213+
<xs:restriction base="xs:string">
214+
<xs:minLength value="1"/>
215+
<xs:whiteSpace value="collapse"/>
216+
</xs:restriction>
217+
</xs:simpleType>
218+
<xs:complexType name="nameWithUsergroup">
219+
<xs:simpleContent>
220+
<xs:extension base="nonEmptyString">
221+
<xs:attribute type="usergroupHash" name="usergroup" use="optional"/>
222+
</xs:extension>
223+
</xs:simpleContent>
224+
</xs:complexType>
212225
<xs:complexType name="moneyWithUsergroup">
213226
<xs:simpleContent>
214227
<xs:extension base="money">
@@ -280,7 +293,7 @@
280293

281294
<xs:complexType name="usergroupsType">
282295
<xs:sequence>
283-
<xs:element type="usergroupHash" name="usergroup" minOccurs="0" maxOccurs="unbounded" />
296+
<xs:element type="usergroupHash" name="usergroup" minOccurs="0" maxOccurs="unbounded" />
284297
</xs:sequence>
285298
</xs:complexType>
286299

0 commit comments

Comments
 (0)