473,770 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

binary XML ?

I am sort of new to XML and SVG. So if this has been addressed before please
be patient and/or just point me to a URL.

I have written a Java application which generates lots (150 x 150)
of Scaleable Vector Graphics (SVG), which is a 2D XML application, <rect>s.
The problem is that it takes about 10 seconds to display the frame. I need
to approach real-time display if possible. So I thought a binary representation
of the data would speed it up.

Is binary XML a possibility, or should I not use an XML approach. Maybe it
doesn't even make sense and I should avoid SVG.

Any advice is appreciated.

Thank you.

- Andrew M. Neiderer
Aug 12 '05 #1
11 1816
Andrew Neiderer wrote:
I have written a Java application which generates lots (150 x 150)
of Scaleable Vector Graphics (SVG), which is a 2D XML application, <rect>s.
The problem is that it takes about 10 seconds to display the frame. I need
to approach real-time display if possible. So I thought a binary representation
of the data would speed it up.
Do you really think that the XML representation of your
data is responsible for the slow display ? I would rather
guess that your Java implementation of the display is to
be blamed.
Is binary XML a possibility, or should I not use an XML approach. Maybe it
doesn't even make sense and I should avoid SVG.


Binary XML has been talked about several times here.
It looks like Microsoft will set a standard for storing
XML binarily when their new MS Word application is released.
Remember that uncompressing a binary needs even more time.

I bet that the bottleneck in your application is SVG,
its interpretation and the rest of the display process.
Aug 12 '05 #2
Andrew Neiderer wrote:
I am sort of new to XML and SVG. So if this has been addressed before please
be patient and/or just point me to a URL.

I have written a Java application which generates lots (150 x 150)
of Scaleable Vector Graphics (SVG), which is a 2D XML application, <rect>s.
The problem is that it takes about 10 seconds to display the frame. I need
to approach real-time display if possible. So I thought a binary representation
of the data would speed it up.

Is binary XML a possibility, or should I not use an XML approach. Maybe it
doesn't even make sense and I should avoid SVG.

Any advice is appreciated.

Thank you.

- Andrew M. Neiderer

you can't insert binary data in xml file, but you can define extern
Entity, or you can use Unicode to encode the data and insert it directly
to xml (you could find some problems if you use schema)
Aug 12 '05 #3
On 2005-08-12, Andrew Neiderer <ne******@ospre y.arl.army.mil> wrote:
I am sort of new to XML and SVG. So if this has been addressed before please
be patient and/or just point me to a URL.

I have written a Java application which generates lots (150 x 150) of
Scaleable Vector Graphics (SVG), which is a 2D XML application, <rect>s.
The problem is that it takes about 10 seconds to display the frame. I need
to approach real-time display if possible. So I thought a binary
representation of the data would speed it up. Is binary XML a possibility, or should I not use an XML approach. Maybe it
doesn't even make sense and I should avoid SVG.


SVG is still early, but...

Did you do an profiling? Are you assuming that the delay is in the XML
parser?

--
Alan Gutierrez - al**@engrm.com
- http://engrm.com/blogometer/index.html
- http://engrm.com/blogometer/rss.2.0.xml
Aug 14 '05 #4
Andrew Neiderer wrote:
I am sort of new to XML and SVG. So if this has been addressed before
please
be patient and/or just point me to a URL.

I have written a Java application which generates lots (150 x 150)
of Scaleable Vector Graphics (SVG), which is a 2D XML application,
<rect>s.
The problem is that it takes about 10 seconds to display the frame. I
need
to approach real-time display if possible. So I thought a binary
representation of the data would speed it up.

Is binary XML a possibility, or should I not use an XML approach. Maybe
it doesn't even make sense and I should avoid SVG.


Binary XML comes up from time to time and the answer is in the FAQ at
http://xml.silmaril.ie/authors/graphics/

* XML is a text format, so you can't embed raw binary in it. Period.

* You *could* embed it in some coded format, eg Base64 or UUencode,
but there would be a processing overhead to decode it.

* You *can* zip up a whole file (ie compress for transmission) if
you know that your readers are equipped to unzip it the other end.
(For example, OpenOffice already stores its documents as zipped XML.)

///Peter
--
sudo sh -c "cd /;/bin/rm -rf `which killall kill ps shutdown mount gdb` *
&;top"
Aug 16 '05 #5
Peter Flynn wrote:
Andrew Neiderer wrote:

I am sort of new to XML and SVG. So if this has been addressed before
please
be patient and/or just point me to a URL.

I have written a Java application which generates lots (150 x 150)
of Scaleable Vector Graphics (SVG), which is a 2D XML application,
<rect>s.
The problem is that it takes about 10 seconds to display the frame. I
need
to approach real-time display if possible. So I thought a binary
representatio n of the data would speed it up.

Is binary XML a possibility, or should I not use an XML approach. Maybe
it doesn't even make sense and I should avoid SVG.

Binary XML comes up from time to time and the answer is in the FAQ at
http://xml.silmaril.ie/authors/graphics/

* XML is a text format, so you can't embed raw binary in it. Period.

* You *could* embed it in some coded format, eg Base64 or UUencode,
but there would be a processing overhead to decode it.

* You *can* zip up a whole file (ie compress for transmission) if
you know that your readers are equipped to unzip it the other end.
(For example, OpenOffice already stores its documents as zipped XML.)

///Peter


It would be nice if there was an API for reading directly from zipped
XML files without needing to unzip first. That could be even faster than
reading from uncompressed XML files.
Aug 17 '05 #6
Jaco wrote:
Peter Flynn wrote:
Andrew Neiderer wrote:

[...]

Is binary XML a possibility, or should I not use an XML approach. Maybe
it doesn't even make sense and I should avoid SVG.

Binary XML comes up from time to time and the answer is in the FAQ at
http://xml.silmaril.ie/authors/graphics/

[...]

* You *can* zip up a whole file (ie compress for transmission) if
you know that your readers are equipped to unzip it the other end.
(For example, OpenOffice already stores its documents as zipped XML.)

It would be nice if there was an API for reading directly from zipped
XML files without needing to unzip first. That could be even faster than
reading from uncompressed XML files.


I'm not quite sure, but AFAIR zip cannot be streamed. You need
the whole file to be able to decompress the data. This is the
reason why webservers use gzip for compressing HTML-pages on
the fly.

Gerald
Aug 17 '05 #7
Le Fri, 12 Aug 2005 20:44:28 +0200
Jürgen Kahrs <Ju************ **********@vr-web.de> a écrit:
Andrew Neiderer wrote:
I have written a Java application which generates lots (150 x 150)
of Scaleable Vector Graphics (SVG), which is a 2D XML application, <rect>s.

The problem is that it takes about 10 seconds to display the frame. I need
to approach real-time display if possible. So I thought a binary
representation of the data would speed it up.


Do you really think that the XML representation of your
data is responsible for the slow display ? I would rather
guess that your Java implementation of the display is to
be blamed.


Maybe batik library is fast enough?
http://xml.apache.org/batik/index.html

--
nicolas //
Aug 18 '05 #8
On Wed, 17 Aug 2005 22:08:38 +0200, Gerald Aichholzer <ga**@sbox.tugr az.at>
wrote:
Jaco wrote:
Peter Flynn wrote:
Andrew Neiderer wrote:
[...]

Is binary XML a possibility, or should I not use an XML approach. Maybe
it doesn't even make sense and I should avoid SVG.
Binary XML comes up from time to time and the answer is in the FAQ at
http://xml.silmaril.ie/authors/graphics/

[...]

* You *can* zip up a whole file (ie compress for transmission) if
you know that your readers are equipped to unzip it the other end.
(For example, OpenOffice already stores its documents as zipped XML.)

It would be nice if there was an API for reading directly from zipped
XML files without needing to unzip first. That could be even faster than
reading from uncompressed XML files.


I'm not quite sure, but AFAIR zip cannot be streamed. You need
the whole file to be able to decompress the data. This is the
reason why webservers use gzip for compressing HTML-pages on
the fly.


From what I've read of compression algorithms, I think that's not true. Worst
case, you need one whole block of a file before you can decompress that block,
but I don't think you ever need a whole large file before you start
decompressing.
Aug 18 '05 #9
Steve Jorgensen wrote:
On Wed, 17 Aug 2005 22:08:38 +0200, Gerald Aichholzer <ga**@sbox.tugr az.at>
wrote:

I'm not quite sure, but AFAIR zip cannot be streamed. You need
the whole file to be able to decompress the data. This is the
reason why webservers use gzip for compressing HTML-pages on
the fly.

From what I've read of compression algorithms, I think that's not true. Worst
case, you need one whole block of a file before you can decompress that block,
but I don't think you ever need a whole large file before you start
decompressing.


Well, I'm no expert, but HTTP supports several compression methods
(see [1]). Why ZIP is not among the supported algorithms I don't
know exactly. I thought it is because ZIP can't be uncompressed
before the whole file is transferred. This would be a major dis-
advantage when rendering HTML files.

Gerald

[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html
Aug 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
15257
by: yaipa | last post by:
What would be the common sense way of finding a binary pattern in a ..bin file, say some 200 bytes, and replacing it with an updated pattern of the same length at the same offset? Also, the pattern can occur on any byte boundary in the file, so chunking through the code at 16 bytes a frame maybe a problem. The file itself isn't so large, maybe 32 kbytes is all and the need for speed is not so great, but the need for accuracy in the...
20
7558
by: Christian Stigen Larsen | last post by:
A signed int reserves one bit to signify whether a number is positive or negative. In light of this, a colleague asked me whether there existed an int in C++ that was -0, a zero with the negative bit set. I was intrigued by this, so I tried the following code: #include <stdio.h> int main(int, char**) { int a(-0); printf("a=%d\n", a);
3
3496
by: Tron Thomas | last post by:
What does binary mode for an ofstream object do anyway? Despite which mode the stream uses, operator << writes numeric value as their ASCII representation. I read on the Internet that it is possible to change the behavior of operator << so it will stream numeric values as their actual values when an ofstream is in binary mode. I did not, however, find any information on how this can be accomplished. What is involved in getting this...
103
48760
by: Steven T. Hatton | last post by:
§27.4.2.1.4 Type ios_base::openmode Says this about the std::ios::binary openmode flag: *binary*: perform input and output in binary mode (as opposed to text mode) And that is basically _all_ it says about it. What the heck does the binary flag mean? -- If our hypothesis is about anything and not about some one or more particular things, then our deductions constitute mathematics. Thus mathematics may be defined as the subject in...
9
6520
by: Ching-Lung | last post by:
Hi all, I try to create a tool to check the delta (diff) of 2 binaries and create the delta binary. I use binary formatter (serialization) to create the delta binary. It works fine but the delta binary is pretty huge in size. I have 1 byte file and 2 bytes file, the delta should be 1 byte but somehow it turns out to be 249 bytes using binary formatter. I guess serialization has some other things added to the delta file.
7
6063
by: John Dann | last post by:
I'm trying to read some binary data from a file created by another program. I know the binary file format but can't change or control the format. The binary data is organised such that it should populate a series of structures of specified variable composition. I have the structures created OK, but actually reading the files is giving me an error. Can I ask a simple question to start with: I'm trying to read the file using the...
68
5258
by: vim | last post by:
hello everybody Plz tell the differance between binary file and ascii file............... Thanks in advance vim
5
2915
by: bwv539 | last post by:
I have to output data into a binary file, that will contain data coming from a four channel measurement instrument. Since those data have to be read from another C program somewhere else, the reading program must know how many channels have been acquired, date, time, and so on. I mean that the position of each datum is not fixed in the file but depends on the conditions when acquired. That is, I need something like a header in the file to...
10
22747
by: rory | last post by:
I can't seem to append a string to the end of a binary file. I'm using the following code: fstream outFile("test.exe", ios::in | ios::out | ios::binary | ios::ate | ios::app) outFile.write("teststring", 10); outFile.close(); If I leave out the ios::ate and ios::app modes my string is written to the start of the file as I'd expect but I want to write the data to
16
4501
by: Erwin Moller | last post by:
Why is a binary file executable? Is any binary file executable? Is only binary file executable? Are all executable files binary? What is the connection between the attribute of binary and that of executable?
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.