Skip to content

Commit

Permalink
Disallow empty and space-only item names (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamadAssani authored and howard committed Apr 24, 2019
1 parent 2669d68 commit 35f2185
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.findologic</groupId>
<artifactId>xml-export</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<version>1.1-SNAPSHOT</version>
<name>xml-export</name>
<url>http://maven.apache.org</url>
<dependencies>
Expand Down
19 changes: 16 additions & 3 deletions src/main/resources/findologic.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<!-- Names -->
<xs:complexType name="namesType">
<xs:sequence>
<xs:element type="stringWithUsergroup" name="name" minOccurs="0" maxOccurs="unbounded"/>
<xs:element type="nameWithUsergroup" name="name" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

Expand Down Expand Up @@ -200,7 +200,7 @@
<xs:simpleType name="usergroupHash">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="stringWithUsergroup">
<xs:simpleContent>
Expand All @@ -209,6 +209,19 @@
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="nonEmptyString">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="nameWithUsergroup">
<xs:simpleContent>
<xs:extension base="nonEmptyString">
<xs:attribute type="usergroupHash" name="usergroup" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="moneyWithUsergroup">
<xs:simpleContent>
<xs:extension base="money">
Expand Down Expand Up @@ -280,7 +293,7 @@

<xs:complexType name="usergroupsType">
<xs:sequence>
<xs:element type="usergroupHash" name="usergroup" minOccurs="0" maxOccurs="unbounded" />
<xs:element type="usergroupHash" name="usergroup" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>

Expand Down

0 comments on commit 35f2185

Please sign in to comment.