473,509 Members | 12,711 Online
Bytes | Software Development & Data Engineering Community
+ 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 1039
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
17421
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
2185
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
4077
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
2339
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
1110
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
6547
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
4582
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
4809
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
7417
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7074
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
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5659
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
4734
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
3219
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3210
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1572
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 ...
0
445
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.