Use JAXP + SAX for serialization

Description

See : http://www.javazoom.net/services/newsletter/xmlgeneration.html - http://www.javazoom.net/services/newsletter/xmlgeneration.html

(last example).

This approach permits to get rid of most XML serialization problems like the one reported in http://jira.codehaus.org/secure/ViewIssue.jspa?key=GEOS-16 - http://jira.codehaus.org/secure/ViewIssue.jspa?key=GEOS-16.

It also permits automatic pretty printing and... it's fast.

p.b.

Environment

None

Activity

Show:
codehaus
April 10, 2015, 4:50 PM

CodeHaus Comment From: brihaye - Time: Fri, 11 Jun 2004 06:39:11 -0500
---------------------
<p>Hi,</p>

<p>A good start would be to rewrite org.vfny.geoserver.responses.XmlResponseHandler and to get rid of these unnecessary (and, for some of them, dangerous) :</p>

<p>private static final int TAB_SIZE = 2;

private char[] cr = new char<span class="error">&#91;0&#93;</span>;

private char[] tab = new char<span class="error">&#91;0&#93;</span>;

private int indentLevel = 0;</p>

<p>protected void handleSingleElem(...)

protected void characters(String s)

protected void indent(...)

protected void unIndent()

protected void cReturn()

public void setPrettyPrint(boolean newLines, boolean indent)</p>

<p>It would also be nice to have access to a DTDHandler, since the capabilities response has such a constraint.</p>

<p>See the 5th example from <a href="http://www.javazoom.net/services/newsletter/xmlgeneration.html" class="external-link" rel="nofollow">http://www.javazoom.net/services/newsletter/xmlgeneration.html</a> for general guidelines.</p>

<p>Cheers,</p>

<p>p.b.</p>

codehaus
April 10, 2015, 4:50 PM

CodeHaus Comment From: groldan - Time: Sun, 13 Jun 2004 18:21:49 -0500
---------------------
<p>thanks Pierrick.

I just started branch 'getcaps_jaxp' on package org.vfny.geoserver.responses in order to get rid of all that uggly stuff and rewrite the GetCapabilities encoding by sticking to the great XML stuff developed for WFS, based on TransformerBase.</p>

<p>By this way, we'll have a common approach to xml encoding.</p>

<p>So be attent to this thread since I'll log work progress and ideas here. </p>

<p>best regards,</p>

<p>gabriel.</p>

codehaus
April 10, 2015, 4:50 PM

CodeHaus Comment From: brihaye - Time: Mon, 14 Jun 2004 03:08:02 -0500
---------------------
<p>Hi Gabriel,</p>

<p>No problem : I will watch every committed line <img class="emoticon" src="https://jira.codehaus.org/images/icons/emoticons/wink.gif" height="16" width="16" align="absmiddle" alt="" border="0"/></p>

<p>Unfortunately, I will be out for one week, starting wednesday.</p>

<p>After this, I think I will find time to have a better involvement in Geoserver (WMS stuff and embedded Jetty support).</p>

<p>Cheers,</p>

<p>p.b.</p>

codehaus
April 10, 2015, 4:50 PM

CodeHaus Comment From: groldan - Time: Mon, 24 Jan 2005 14:48:54 -0600
---------------------
<p>So I reimplemented the capabilities response handling making use of the org.geotools.xml.transform framework. As a result, the following modifications were done on the code base:</p>

<p>deleted classes:

org/vfny/geoserver/responses/CapabilitiesResponse.java

org/vfny/geoserver/responses/CapabilitiesResponseHandler.java

org/vfny/geoserver/responses/ResponseHandler.java

org/vfny/geoserver/responses/XmlResponseHandler.java

org/vfny/geoserver/responses/wfs/Capabilities.java

org/vfny/geoserver/responses/wfs/WfsCapabilitiesResponseHandler.java

org/vfny/geoserver/responses/wms/WmsCapabilitiesResponseHandler.java</p>

<p>modified classes:

org/vfny/geoserver/responses/wfs/WFSCapabilitiesResponse.java

org/vfny/geoserver/responses/wms/WMSCapabilitiesResponse.java</p>

<p>added classes:

org/vfny/geoserver/responses/wfs/WFSCapsTransformer.java

org/vfny/geoserver/responses/wms/helpers/WMSCapsTransformer.java</p>

<p>The only thing remains to be done is to correctly use namespace declaration in WFS capabilities. Currently it is exactly as it was previously, but I'm sure it could be done better with the facilities in TransformerBase and friends, although I need some more training on it to actually do it well. Some advice?</p>

codehaus
April 10, 2015, 4:50 PM

CodeHaus Comment From: aaime - Time: Thu, 29 Mar 2007 02:05:59 -0500
---------------------
<p>These issue has been in resolved state for at least one month (quite a bit, a lot more than one month). Batch transitioning them to closed state</p>

Fixed

Assignee

Unassigned

Reporter

codehaus

Triage

None

Fix versions

Affects versions

Components

Priority

Low