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.

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

Re: Should I use XML or not? by Carlos

Carlos
Wed Mar 23 04:07:01 CST 2005

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" <response@myrealbox.com> escribió en el mensaje
news:3a9bn2F65l8r9U1@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.