Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Displaying XML in Word 2003 - exposing attributes of elements

1 view
Skip to first unread message

Eric Safern

unread,
Nov 7, 2003, 3:46:07 PM11/7/03
to
Hi,

We're considering using Word 2003 as an xml editor to create and modify xml documents authored in our existing schema.

The problem is, we make heavy use of attributes in our xml, and these are not visible in the default data view.

To elaborate, our xml looks something like this:

<textelement id="question1">
Who are you?
</textelement><textelement id="question2">
Where do you live?
</textelement>

etc.

This shows up as

<<textelement>>Who are you?<<textelement>><<textelement>>Where do you live?<<textelement>>

Without the 'id' attributes being visible, I can't tell one element from the next when editing the xml without right-clicking on each element.

If I used an xslt, I could generate some kind of new xml file with the attributes visible. But wouldn't that change the actual xml so that the schema would be changed when I went to save the xml?

I suppose I could then write another xslt to re-transform the data into the old schema before I save, but that seems like a pain. Is there another way?


Thanks,

Eric Safern

MARY MCRAE

unread,
Nov 9, 2003, 10:36:54 AM11/9/03
to
Hi Eric,

My suggestion would be to create an MS version of your schema that
replaces your current element identifiers with the values of the id
attributes. You can then incorporate this into your transform that you would
apply when opening an xml instance. When you save, you can hook in another
transform that would perform the reverse operation - transforming the
element identifiers into the id attributes on the very generic textelement.

If you build all this into a smart document solution (along with styles to
enhance editing, a document actions task pane, etc.) the end user won't have
to worry about any of this. It also allows the end user to quickly create
XML without having to continually edit attributes, which your existing users
may appreciate as well.

--
Mary McRae


Lars-Eric Gisslén

unread,
Nov 9, 2003, 11:03:05 AM11/9/03
to
Eric,

If you are only going to edit the content of the XML only you may take a
look at InfoPath (included in at least Office 2003 Proffesional). InfoPath
is an XML content editor in which you can create a nice user interface and
very easy to add validation and business logic. I think InfoPath is a much
better solution than Word in your case.

Regards,
Lars-Eric

"Eric Safern" <anon...@discussions.microsoft.com> skrev i meddelandet
news:538DB453-CB2D-4CA2...@microsoft.com...

Cindy M -WordMVP-

unread,
Nov 10, 2003, 7:26:18 AM11/10/03
to
Hi =?Utf-8?B?RXJpYyBTYWZlcm4=?=,

> We're considering using Word 2003 as an xml editor to create and modify xml
documents authored in our existing schema.
>

Word 2003 was not designed to be an XML editor, and really isn't the proper
tool. The real purpose of XML in Word (besides being able to save to "WordML" so
that Word docs can be read/written without having Word), is to support the new
SmartDocument feature.

Besides the workaround your describe, the only other option that occurs to me
would be to display the attribute information in a non-modal UserForm, or
possibly in toolbar controls. Which would mean having VBA code running...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)

0 new messages