XML declaration in REST responses
---------------------------------
Key: GEOS-4056
URL: http://jira.codehaus.org/browse/GEOS-4056
Project: GeoServer
Issue Type: Improvement
Components: REST
Affects Versions: 2.0.x, 2.1.x
Reporter: Ben Caradoc-Davies
Assignee: Andrea Aime
Fix For: 2.0.x, 2.1.x
From the XML 1.0 Specification [Extensible Markup Language (XML) 1.0 (Fifth Edition)]:
"XML documents SHOULD begin with an XML declaration which specifies the version of XML being used."
http://www.w3.org/TR/REC-xml/#sec-prolog-dtd
Might be fiddly as these could come straight from XStream, which does not write declarations. XStream docs suggest direct insertion of the declaration into the output stream before serialising. Ask Justin.
The original request:
{code}
-------- Original Message --------
Subject: [Geoserver-users] XML declaration through REST
Date: Wed, 14 Jul 2010 15:59:13 +0800
From: Perkola Paula
To: geoserver-users@lists.sourceforge.net
Hi,
Is it possible to add an xml declaration (i.e. <?xml version="1.0" encoding="UTF-8"?>) to the beginning of a REST get-response?
My particular example involves the coveragestores.xml file, which is retrieved via the URL: http://localhost:8080/geoserver/rest/workspaces/<ws>/coveragestores\.xml and the current response is:
<coverageStores>
<coverageStore>
<name>cs1</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/<ws>/coveragestores/cs1\.xml<view\-source:http://localhost:8080/geoserver/rest/workspaces/syke/coveragestores/swe\_20100401\.xml>" type="application/xml"/>
</coverageStore>
<coverageStore>
<name>cs2</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/<ws>/coveragestores/cs2\.xml<view\-source:http://localhost:8080/geoserver/rest/workspaces/syke/coveragestores/swe\_20100401\.xml>" type="application/xml"/>
</coverageStore>
<coverageStore>
<name>cs3</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/<ws>/coveragestores/cs3\.xml<view\-source:http://localhost:8080/geoserver/rest/workspaces/syke/coveragestores/swe\_20100401\.xml>" type="application/xml"/>
</coverageStore>
</coverageStores>
The reason I need the declaration, is that I'm auto-processing the retrieved xml-file and my processor checks the file for the xml entity.
Thanks in advance.
Regards,
Paula
***************************************
Paula Perkola
Trainee Research Scientist
VTT
{code}
--
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