473,480 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Should I use XML or not?

Hello,

I am writing a word add-in in C#.
This add-in has to attach some metadata to bookmarks in the document. The metadata is stored in Word document variables.

Typical metadata can consist of a string identifier, three lists of [0 to 50] person-names each and about 5 Yes/No flags.

The problem is that I have to parse the metadata whenever the user moves the cursor onto bookmarked text so it has to be very fast, otherwise moving through the document will feel sluggish.

I was thinking of formatting the metadata using XmlTextWriter and parsing it using XmlTextReader.
However, I am not familiar with these classes and I am afraid that this approach may prove too slow on computers that are not state of the art.

The alternative is formatting and parsing the strings myself, perhaps using some combination of string.Split, string.Join, string.IndexOf and StringBuilder.

Since the metadata is only intended for the internal operation of the add-in, it can be as ugly as I want (in fact, I was thinking about obfuscating it do discourage users from messing with it but this may add another slowdown).

What would you suggest?

Thank you,
Alex.

--
Please replace myrealbox with alexoren to reply by email.

Jul 21 '05 #1
1 1036
I would suggest to learn and use those XML classes and if performance
problems appear, then optimize your code and if performance problems persist
then use the other alternative. XML is very flexible (to accommodate changes
in your data format), you have great support in the .NET Framework, and for
small data amounts as in your case it should perform fast, but you must
measure it.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"Alex" <re******@myrealbox.com> escribió en el mensaje
news:3a*************@individual.net...
Hello,

I am writing a word add-in in C#.
This add-in has to attach some metadata to bookmarks in the document. The
metadata is stored in Word document variables.

Typical metadata can consist of a string identifier, three lists of [0 to
50] person-names each and about 5 Yes/No flags.

The problem is that I have to parse the metadata whenever the user moves the
cursor onto bookmarked text so it has to be very fast, otherwise moving
through the document will feel sluggish.

I was thinking of formatting the metadata using XmlTextWriter and parsing it
using XmlTextReader.
However, I am not familiar with these classes and I am afraid that this
approach may prove too slow on computers that are not state of the art.

The alternative is formatting and parsing the strings myself, perhaps using
some combination of string.Split, string.Join, string.IndexOf and
StringBuilder.

Since the metadata is only intended for the internal operation of the
add-in, it can be as ugly as I want (in fact, I was thinking about
obfuscating it do discourage users from messing with it but this may add
another slowdown).

What would you suggest?

Thank you,
Alex.

--
Please replace myrealbox with alexoren to reply by email.
Jul 21 '05 #2

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

Similar topics

303
17409
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
3
2184
by: Andy Visniewski | last post by:
Should be easy, but I've been trying to figure this out for about half an hour with no luck. There is a table 'Cybex' which has all the Cybex products we sell, and a table 'Datasheets' which...
36
4072
by: Jack Hughes | last post by:
This argument has come up two or three times lately. We have a web standards document at our company that say "Use valid HTML 4; We don't recommend switching to DIV-based CSS-P for layout just...
12
2333
by: Sanjay | last post by:
hi, We are currently porting our project from VB6 to VB .NET. Earlier we used to make scale transformations on objects like pictureBox , forms etc.Now Such transformations are made on the...
8
1107
by: Chris Mayers | last post by:
I am trying to track a suspected memory leak in an application I'm writing and through repeated simplification of my project, I have found the following which is quite easily replicated should you...
20
1466
by: HKSHK | last post by:
Hi guys, I want to write a database application, which I later want to sell. Now I am looking for a nice, little database which would have to fullfil these requirements: * Either free or low...
24
6546
by: John | last post by:
I know this is a very fundamental question. I am still quite confused if the program call stack stack should always grows upwards from the bottom, or the opposite, or doesn't matter?? That means...
18
4579
by: Zytan | last post by:
I want the same function to be run whether you press Enter or double click the listbox. It seems really verbose to write both handlers to both events everytime, even if they both call the same...
8
2192
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - When should I use eval? ----------------------------------------------------------------------- The ` eval() `...
2
4806
by: JohnnyBR | last post by:
A particular talent competition has 5 judges, each of whom awards a score between 0 and 10 to each performer. Fractional scores, such as 8.3, are allowed. A performer's final score is determined by...
0
7046
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,...
0
6908
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...
0
7048
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,...
1
6741
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...
0
5342
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,...
0
4485
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2986
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
183
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.