[Geoserver-devel] [jira] Created: (GEOS-3026) Spaces in resource name breaks KML and GML output formats.

Spaces in resource name breaks KML and GML output formats.
----------------------------------------------------------

                 Key: GEOS-3026
                 URL: http://jira.codehaus.org/browse/GEOS-3026
             Project: GeoServer
          Issue Type: Bug
    Affects Versions: 2.0-alpha2
         Environment: Ubuntu Jaunty
            Reporter: Tim Coulter
            Assignee: Andrea Aime

If a space is added into the resource name of a layer, KML and GML output formats in the layer preview break, and they will break in different ways.

Steps to reproduce:
1) Install and run a fresh install of Geoserver.
2) On the Layers page, click on the "states" layer and then change the layer's resource name to "united states". Make sure you include the space, but ignore the quotes. Click Save.
3) Click on the Layer Preview page, and then preview the "topp:united states" layer in the formats below. Note that that each format errors in different ways. I've included the errors with the formats below

Discussion:

Justin said we should probably disallow having spaces in resource names. Sounds like a good plan. Do we know if customers rely on spaces?

Formats:

KML & GML quick links, and KML (plain) from the dropdown: Errors with a javascript error. http://localhost:8081/geoserver/web/?wicket:bookmarkablePage=:org.geoserver.web.demo.MapPreviewPage (line 1)

syntax error ../wms/kml_reflect?layers=topp:united states

KML (compressed): Google Earth shows a big X where the layer should be.

GML 2: New tab showing:

XML Parsing Error: not well-formed
Location: http://localhost:8081/geoserver/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=topp:united%20states&maxFeatures=50&outputFormat=GML2
Line Number 1, Column 642:

(I've suppressed the long string of XML)

GML3:

<ServiceExceptionReport version="1.2.0" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd&quot;&gt;
&#8722;
<ServiceException>

      java.lang.RuntimeException: Encode failed for _Feature. Cause: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
Encode failed for _Feature. Cause: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
</ServiceException>
</ServiceExceptionReport>

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira