xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
- From: "Galip Aydin" <gaydin AT grids.ucs.indiana.edu>
- To: <xom-interest AT lists.ibiblio.org>
- Subject: Re: [XOM-interest] BNUX Question
- Date: Tue, 11 Apr 2006 23:37:46 -0400
Wolfgang,
Thanks for the reply. I am trying to serialize individual GML fragments which do not contain namespace declarations, as following;
<gml:featureMember>
<Entity>
<Bus>
<location>
<gml:Point srsName="null">
<gml:coord>
<gml:X>-82.3773</gml:X>
<gml:Y>28.0804</gml:Y>
<gml:Z>1.0</gml:Z>
</gml:coord>
</gml:Point>
</location>
</Bus>
</Entity>
</gml:featureMember>
When I use the method described in the samples it gives an error about the namespace gml. So what is the best way to convert this XML fragment to bnux?
Thanks again,
Galip.
----- Original Message ----- From: "Wolfgang Hoschek" <wolfgang.hoschek AT mac.com>
To: "Galip Aydin" <gaydin AT grids.ucs.indiana.edu>
Cc: <xom-interest AT lists.ibiblio.org>
Sent: Tuesday, April 11, 2006 11:03 PM
Subject: Re: [XOM-interest] BNUX Question
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.
-
[XOM-interest] BNUX Question,
Galip Aydin, 04/11/2006
-
Re: [XOM-interest] BNUX Question,
Wolfgang Hoschek, 04/11/2006
-
Re: [XOM-interest] BNUX Question,
Galip Aydin, 04/11/2006
-
Re: [XOM-interest] BNUX Question,
Wolfgang Hoschek, 04/12/2006
- Re: [XOM-interest] BNUX Question, John Cowan, 04/12/2006
-
Re: [XOM-interest] BNUX Question,
Wolfgang Hoschek, 04/12/2006
-
Re: [XOM-interest] BNUX Question,
Galip Aydin, 04/11/2006
-
Re: [XOM-interest] BNUX Question,
Wolfgang Hoschek, 04/11/2006
Archive powered by MHonArc 2.6.24.