Hi Chaitu
OK, having looked at the XML I guess what is probably confusing is that Word
stores the *result* of the field in with the field code. In the case of a
full-blown TOC that would list sections from the document, which obviously
you couldn't easily generate. However, there is no need to include the
correct result in the XML, only the correct field code.
Try the following:
Insert a TOC field in an otherwise empty document, and save as XML. In the
output, you will see the field appear towards the end of the file between
<w:fldChar w:fldCharType="begin"/>
and
<w:fldChar w:fldCharType="end"/>
The field code appears as
<w:instrText> TOC \o "1-3" </w:instrText> - this is what you might need
to adjust to match the actual field code you need to pick up your section
headings. You can get that information from the field code Help, or by
examining the code (toggle field codes to see it) in a working Word
document.
In the trial blank document, the field value appears as:
<w:t>Error! No table of contents entries found.</w:t>
That is the text that is displayed in the file. But you can edit this text
to anything you like, resave the file, and reopen in Word and the TOC field
will still work (i.e. generate the correct TOC when you add Headings to the
document.) So it's clear that if your XSLT simply puts any placeholder text
here, you will be generating a valid Word document with a 'live' TOC - you
just need to update the field to see it.
Hope this helps.

Signature
Margaret Aldis - Microsoft Word MVP
Syntagma partnership site: http://www.syntagma.co.uk
Word MVP FAQ site: http://www.word.mvps.org
> Hi Margaret,
>
[quoted text clipped - 46 lines]
> > > Thank You,
> > > Chaitu
Chaitu - 29 Nov 2004 14:41 GMT
Hi Margaret,
Sorry for not replying so long. I kind of gave up on this as its taking a
long time and it was kind of urgent. So I'm using visual basic to generate
the TOC instead. Its working fine for now.
Thanks a lot for your time,
Chaitu
> Hi Chaitu
>
[quoted text clipped - 94 lines]
> > > > Thank You,
> > > > Chaitu