Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] BNUX Question

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Wolfgang Hoschek <wolfgang.hoschek AT mac.com>
  • To: Galip Aydin <gaydin AT grids.ucs.indiana.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] BNUX Question
  • Date: Tue, 11 Apr 2006 20:03:31 -0700

On Apr 11, 2006, at 7:49 PM, Galip Aydin wrote:

Hi All
I I am trying to use bnux in a GIS project to compress very large GML documents. GML documents are XML files with geographic information encoded according to OpenGIS standards. However because of the current architecture I am having trouble using bnux, and I was wondering if anybody has a suggestion. Here is the problem:
I am creating GML documents from MySQL ResultSets. There are several namespace declaration at the top of the GML documents and several hundred <gml:featureMember> elements. Each featureMember element is created using an individual database results. The system works as follows: I am retrieving the results from the MySQL database in a streaming fashion, for each result creating a featureMember element and publishing this to a publish/subscribe messaging system topic. The client accumulates the results to construct the whole GML document. However since each featureMember element does not contain the namespace declarations I can't use bnux.
Now, is there a way to create a Streaming Serializer Factory by providing the namespaces once and use it to compress elements of that document as they become available?

Thanks in advance for any suggestions.
Galip.


I'm not sure I understand the problem. On deserialization, bnux recreates whatever has been given to it before on serialization, including namespaces. There's no loss of information.

It works by feeding normal XOM nodes such as elements into bnux. Each XOM element can have namespaces, but it need not. Such namespaces can be given in the Element constructor and via Element.addNamespaceDeclaration(). In streaming fashion, you'll use a StreamingSerializer obtained from StreamingSerializerFactory.createBinaryXMLSerializer() to write bnux format. There's an example in the javadoc for StreamingSerializer.

BTW, you might want to get started with the bin/fire-bnux command line test tool, converting bnux to and from XML. You might also want to run the testsuite via "ant download-testdata test-bnux".

Wolfgang.




Archive powered by MHonArc 2.6.24.

Top of Page