Word 2003 - RTF - This is not a valid Style name

G

Guest

am doing a complex XML/XSLT tranform into RTF. Please don't confuse this
with an XLM/XSLT question because it's not. It's actually an RTF question.
The output product of this transform is an entire mental health directory in
Word 2003 RTF Format. For some of the formatting I have to create a table.

The XSLT template has paragraph style definitions, Table Style Definitions,
Font definitions, color definitions and page setup information. I obtained
this header for my template by simply setting a page the way I wanted and cut
and pasting Word RTF output. This has worked very well for the first half of
the directory. But now I have a problem as the second half requires a table
definition.

When I attempt to add a new table definition to the XSLT template, when Word
2003 reads the output RTF file, it reports: "This is not a valid Style Name"
in reference to the newly introduced table style.

What checks is Word making that produces this error? What conditions evoke
this error. Btw I've slept with the Word RTF 2003 spec. The answer is not in
there. I have created the table I want in word and output it in RTF and I've
inserted the new table style right from the Word Output. But Word is making a
check on the output document that I don't know about.
 
B

Bob Buckland ?:-\)

Hi Renee,

That little error box does popup from time to time when you open a document (.doc or .rtf) in Word when there is minor corruption in
the file (if you open it, use File=>Save As and choose a new file name then close and open that new file do you still get the
error).

If so, if you then run a Compare from the Tools menu of your new saved file and your old one does Word find any differences between
the two?

What is the name of the Table style you're creating in Word?

You may also want to check the Tools=>Options=>Compatability settings in Word to see if they're set to Word 2003.

It can also occur depending a bit on the syntax from different versions of the RTF spec. (Word 2003 uses v1.8, for example).

====================
am doing a complex XML/XSLT tranform into RTF. Please don't confuse this
with an XLM/XSLT question because it's not. It's actually an RTF question.
The output product of this transform is an entire mental health directory in
Word 2003 RTF Format. For some of the formatting I have to create a table.

The XSLT template has paragraph style definitions, Table Style Definitions,
Font definitions, color definitions and page setup information. I obtained
this header for my template by simply setting a page the way I wanted and cut
and pasting Word RTF output. This has worked very well for the first half of
the directory. But now I have a problem as the second half requires a table
definition.

When I attempt to add a new table definition to the XSLT template, when Word
2003 reads the output RTF file, it reports: "This is not a valid Style Name"
in reference to the newly introduced table style.

What checks is Word making that produces this error? What conditions evoke
this error. Btw I've slept with the Word RTF 2003 spec. The answer is not in
there. I have created the table I want in word and output it in RTF and I've
inserted the new table style right from the Word Output. But Word is making a
check on the output document that I don't know about. >>
--

Bob Buckland ?:)
MS Office System Products MVP

*Courtesy is not expensive and can pay big dividends*
 
J

joeboon

Got it!!

The problem seems to be spaces between style definitions in the
\stylesheet element. I had my stylesheet entries on separate lines in
the XSLT file, which in the output RTF created spaces between the
elements instead of line breaks.

The fix is to put the whole stylesheet and all styles on one line in
the XSLT file. I also removed <xsl:text>...</xsl:text> but that didn't
help to start with.

Word doesn't mind having styles on separate lines, but it does mind if
they have a space after the closing "}" brace of a style. Strange but
true.

Really hope this helps you.

Joe


am doing a complex XML/XSLT tranform into RTF. Please don't confuse this
with an XLM/XSLT question because it's not. It's actually an RTF question.
The output product of this transform is an entire mental health directory in
Word 2003 RTF Format. For some of the formatting I have to create a table.
When I attempt to add a new table definition to the XSLT template, when Word
2003 reads the output RTF file, it reports: "This is not a valid Style Name"
in reference to the newly introduced table style.
<snip>
 

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