Rich Text Conversion for Numbered Lists

Hi,

I have been using numbered lists in DOORS and when exporting using either RPE or WEXP the numbered lists are converted to bulleted lists. This is unaccepable to the clients so does anyone know how I can convert the numbered lists to plain text.

I'm hoping by identifying the rich text string i will be able to convert it to plain text before the export and it will keep the correct display.

The sample rtf string in DOORS is:

{\rtf1\ansi\ansicpg1252\deff0\deflang3081{\fonttbl{\f0\fnil\fcharset0 Tahoma;}}
\viewkind4\uc1\pard{\pntext\f0 a.\tab}{\*\pn\pnlvlbody\pnf0\pnindent0\pnstart1\pnlcltr{\pntxta.}}
\fi-360\li360\f0\fs20 abc\par
{\pntext\f0 b.\tab}def\par
{\pntext\f0 c.\tab}ghi\par
{\pntext\f0 d.\tab}jkl\par
{\pntext\f0 e.\tab}mno\par
}

Which is basicly a numbered list using lower case letters (imagine the below list as a proper numbered list, not with the letter typed in)
I'd like to convert this so it shows in DOORS as plain text as per below:

a. abc
b. def
c. ghi
d. jkl
e. mno

Regards,
Dan
dnmel0 - Tue Jan 24 00:52:55 EST 2012

Re: Rich Text Conversion for Numbered Lists
SystemAdmin - Tue Jan 24 01:34:34 EST 2012

Whilst I'm sure that there will be some clever DXL bods who can provide a DXL solution here - I'm just wondering if this is a case of MSWord's over eagerness to apply predictive auto correction. Perhaps see if the following two auto correction options are enabled. If they are, disable them and see if this stops Word from auto changing the list style from numbered to bulleted during export.

It's not easy to find in in MSWord 2007 - Click on the "Office" button, Select "Word Options", select "Proofing" then look for the "Auto Correct" button - select the "Auto Format as you type" tab. In MSWord 2003 - it's just Tools > Auto Correct Options

Look for
1. Automatic bulleted lists
2. Automatic numbered lists

Paul Miller
Melbourne, Australia

Re: Rich Text Conversion for Numbered Lists
llandale - Tue Jan 24 14:28:15 EST 2012

If the numbered list is in an object following the text ".. as follows:" statement, then it seems to me you could define a Style in your MS-Word export template that uses numbered lists. Then ajust the "Paragraph Style" attribute of the list object to be that style.

Re: Rich Text Conversion for Numbered Lists
dnmel0 - Tue Jan 24 18:48:57 EST 2012

Hi,

Paul, I tried disabling both auto correct options in Word but it still exported bulleted lists. I saw in one of the RPE forums that it's because DOORS passes the information as bulleted lists to both RPE and WEXP so I need to convert it before the export which is why I'm hoping there is a DXL column that I can create to use in the export.

Louie, unfortunately the numbered lists are included with other text and not on it's own. In word the lists are in normal paragraphs and also in tables (not sure if this makes a difference, but thought I should advise).

Also there are multiple styles of numbered lists in the export (e.g. roman numerals (i.) and small case letters (a.))

I've tried macros in word to convert bulleted lists to numbered lists but firstly i couldn't get it to work and even if i did get the macro to work it wouldn't work with the multiple styles of numbered lists. Again this is why I'm hoping I can display it using DXL then export it not as a numbered list but as plain text pretending to be a numbered list.

Thanks,
Dan

Re: Rich Text Conversion for Numbered Lists
SystemAdmin - Tue Jan 24 20:01:35 EST 2012

dnmel0 - Tue Jan 24 18:48:57 EST 2012
Hi,

Paul, I tried disabling both auto correct options in Word but it still exported bulleted lists. I saw in one of the RPE forums that it's because DOORS passes the information as bulleted lists to both RPE and WEXP so I need to convert it before the export which is why I'm hoping there is a DXL column that I can create to use in the export.

Louie, unfortunately the numbered lists are included with other text and not on it's own. In word the lists are in normal paragraphs and also in tables (not sure if this makes a difference, but thought I should advise).

Also there are multiple styles of numbered lists in the export (e.g. roman numerals (i.) and small case letters (a.))

I've tried macros in word to convert bulleted lists to numbered lists but firstly i couldn't get it to work and even if i did get the macro to work it wouldn't work with the multiple styles of numbered lists. Again this is why I'm hoping I can display it using DXL then export it not as a numbered list but as plain text pretending to be a numbered list.

Thanks,
Dan

dnmel0 wrote: "....then export it not as a numbered list but as plain text pretending to be a numbered list..."

This requires rebuilding the current RTF control words to extract all of those \pn... RTF ctrl words that define the layout of the list.

I recreated your list manually as plain text in an object and then captured the resulting RTF which looks like the following.

{\rtf1\ansi\ansicpg1252\deff0\deflang3081{\fonttbl{\f0\fnil\fcharset0 Tahoma;}}
\viewkind4\uc1\pard\f0\fs20 a.\tab abc\par
b.\tab def\par
c.\tab ghi\par
d.\tab jkl\par
e.\tab mno\par

So DXL would be required to somehow rebuild the RTF code to convert a defined bullet list into a plain text equivalent.

Try using the DXL function plainText(string s) to see if this can replicate a plain text version of the numbered list.


Paul Miller
Melbourne, Australia

Re: Rich Text Conversion for Numbered Lists
SystemAdmin - Tue Jan 24 22:58:58 EST 2012

SystemAdmin - Tue Jan 24 20:01:35 EST 2012
dnmel0 wrote: "....then export it not as a numbered list but as plain text pretending to be a numbered list..."

This requires rebuilding the current RTF control words to extract all of those \pn... RTF ctrl words that define the layout of the list.

I recreated your list manually as plain text in an object and then captured the resulting RTF which looks like the following.

{\rtf1\ansi\ansicpg1252\deff0\deflang3081{\fonttbl{\f0\fnil\fcharset0 Tahoma;}}
\viewkind4\uc1\pard\f0\fs20 a.\tab abc\par
b.\tab def\par
c.\tab ghi\par
d.\tab jkl\par
e.\tab mno\par

So DXL would be required to somehow rebuild the RTF code to convert a defined bullet list into a plain text equivalent.

Try using the DXL function plainText(string s) to see if this can replicate a plain text version of the numbered list.


Paul Miller
Melbourne, Australia

Found some time to have a crack at my own suggestion above. Unfortunately, the DXL plainText() function strips out the numbered prefixes a, b, c, d... ---- this kind of makes sense as these prefixes are wrapped up in the \pntext rtf control word which tools like MSWord use to isolate the prefixes and renumber them when a new list item is inserted, as such, the prefixes would not be viewed as being plain text and are stripped out.

I had a a go at creating a DXL Layout column to mimic a copy of the Main Column in the hope that it would interpret and export the contents of the DXL layout as WYSIWYG plain text, but a trial of exporting to MSWord shows this is not the case.

Not so easy to do it would seem.


Paul Miller
Melbourne, Australia

Re: Rich Text Conversion for Numbered Lists
SystemAdmin - Wed Jan 25 07:21:46 EST 2012

SystemAdmin - Tue Jan 24 22:58:58 EST 2012
Found some time to have a crack at my own suggestion above. Unfortunately, the DXL plainText() function strips out the numbered prefixes a, b, c, d... ---- this kind of makes sense as these prefixes are wrapped up in the \pntext rtf control word which tools like MSWord use to isolate the prefixes and renumber them when a new list item is inserted, as such, the prefixes would not be viewed as being plain text and are stripped out.

I had a a go at creating a DXL Layout column to mimic a copy of the Main Column in the hope that it would interpret and export the contents of the DXL layout as WYSIWYG plain text, but a trial of exporting to MSWord shows this is not the case.

Not so easy to do it would seem.


Paul Miller
Melbourne, Australia

The way I do this sort of thing is by applying style to RPE elements using a RPE script element.
I have an Export Format attribute in DOORS containing a list of options like landscape section after, list, apply style etc. As the RPE export cycles through the export the appropriate style is added by querying this element within a script attached to the style property. I have messed around with RTF a great deal in the past, the option I use for my RPE processing is far more reliable and predictable - I recomend you do something similar.

Simply create a style in the RPE stylesheet you use with the required properties. Then edit the style property on the element to contain the object text to process a doors attribute containing export processing info. During the final part of the RPE export process, the word style is applied to the paragraph if the Style attribute and style name add up.