need a root element, can't have a root element

G

Guest

Greetings. Word 2007 insists I use a root element, which is fine with me.
But I am trying to tag SOME text inside a table, but not ALL text inside a
table. For example, maybe I want to tag some text in column 1, skip columns
2 & 3, and tag a portion of the text in column 4.

If I apply the root element to the table, then some text is within that
element, and because the root element says I cannot have text inside of it, I
get confused.

Does anyone know how to deal with tagging some text but not all text? It
seems that having a root element means you will be tagging text that you
don't necessarily want.
 
P

Peter Jamieson

If by "tagging" you mean that you are applying the elements of a
user-defined XML schema to chunks of text in a Word document,
a. what is possible partly depends on your schema, and partly depends on
what Word is capable of doing
b. As far as I knowWord cannot put bits of text from several different
cells into a single XML element. In principle it could probably do so, but I
suspect the nXML necessary to support it would become extremely complex
because XML has to be nested. You can't have
<elementa>blah<elementb>blah</elementa>blah</elementb>. So either
- a cell has to contain the user-defined element, or
- the user-defined element has to contain the cell or
- Word has to create a higher-level container that encloses the cell,
and the user-defined selection, in a way that meets the nesting rule. And it
doesn't just have to get that right for cell boundaries. It has to maintain
the nesting whatever formattign changes you insert, whatever objects you
insert, wherever your selection boundaries begin and end, and so on.
c. you can see how Word actually simplifies things by trying to apply an
element to two adjacent cells in a table. The chances are that, as long as
your schema supports it, Word will create two elements, one for each cell.
d. in other words, to select multiple bits of text withina table, /your/
schema needs to support some way to tag multiple pieces of text, and
anything that consumes that XML needs to be able to process that XML the way
you expect. For example, your schema might allow multiple instances of an
element with the same name.

If you meant something else maybe you could say what it is.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top