Skip to content

Commit

Permalink
Support xs:int for WFS feature properties.
Browse files Browse the repository at this point in the history
xs:integer is an unbounded integer whereas xs:int is a signed 32 bits integer.
see : http://stackoverflow.com/questions/15336872/xsd-what-is-the-difference-between-xsinteger-and-xsint
The interpretation of what an xs:integer is can vary depending on the implementation. For example
Microsoft's System.Xml.Schema.XmlSchemaDataType.ValueType maps xs:integer to System.decimal
and xs:int to System.Int32
see : http://bytes.com/topic/net/answers/172493-xmlschemadatatype-xs-integer-system-decimal

This code change will remove any ambiguity when the property is known to be an int32.
  • Loading branch information
mathieudugal committed Jun 4, 2014
1 parent 5beb10e commit 5a3d2b4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mapwfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,9 @@ static const char* msWFSMapServTypeToXMLType(const char* type)
/* Map from MapServer types to XSD types */
if( strcasecmp(type,"Integer") == 0 )
element_type = "integer";
/* Note : xs:int and xs:integer differ */
else if ( EQUAL(item->type,"int") )
element_type = "int";
else if( EQUAL(type,"Real") ||
EQUAL(type,"double") /* just in case someone provided the xsd type directly */ )
element_type = "double";
Expand Down

0 comments on commit 5a3d2b4

Please sign in to comment.