Rich Text Markup for DXL Attribute

I have been tasked to alter contents of a DXL attribute to display the object text

in the color blue for underlines and red for strikethroughs.

Example text to be altered:

 

TheIf launched in Instrument OFF Mode, the Spacecraft shall enable primary and redundant survival power to the ZTYF Instrument not to exceedwithin 300 minutes after Spacecraft separation from launch vehicle.

 

My question is, (besides where I find the codes for the color markups), what kind of conditional statement(s) would I construct

to, in effect, say, "If Text is  struckthrough, display text in red, If Text is underlined, display text in blue."?

And how/what do I test to see if text is struckthrough or underlined?

I mean, would I go through the text character by character, or is rich-text markup "smarter " than that?

 

Thanks in advance.

T.


FormerIBMer - Mon Nov 19 07:50:06 EST 2018

Re: Rich Text Markup for DXL Attribute
davidcs - Mon Nov 19 08:45:01 EST 2018

If you have some richtext you can loop through the formatting in DXL,

for 
rt in string 
s do 
{
 ... 
} 

The rt in that loop above has properties for strikethru and underline that can be read and used in conditionals. The DXL manual has an example of this.

 

I guess that is where I would start...

Re: Rich Text Markup for DXL Attribute
FormerIBMer - Mon Nov 19 09:07:23 EST 2018

That answers part of my question.  To throw in a little kink, the attribute I'm supposed to be modifying

is attribute DXL, a construct with which I have little experience.  Where do I put the DXL to affect

this attribute?

Re: Rich Text Markup for DXL Attribute
Mike.Scharnow - Mon Nov 19 09:29:08 EST 2018

FormerIBMer - Mon Nov 19 09:07:23 EST 2018

That answers part of my question.  To throw in a little kink, the attribute I'm supposed to be modifying

is attribute DXL, a construct with which I have little experience.  Where do I put the DXL to affect

this attribute?

that is not really easy. You will have to modify the original code that produces the strikethrough/underline. (in the attribute definition you can have a look at the "current" code and modify it)

Re: Rich Text Markup for DXL Attribute
FormerIBMer - Mon Nov 19 09:36:07 EST 2018

Mike.Scharnow - Mon Nov 19 09:29:08 EST 2018

that is not really easy. You will have to modify the original code that produces the strikethrough/underline. (in the attribute definition you can have a look at the "current" code and modify it)

Well, when I look at the attribute properties, I get to the following.  (Edit attribute, Browse where DXL attribute is checked.)

Do I choose New and put the DXL there?

Re: Rich Text Markup for DXL Attribute
Mike.Scharnow - Mon Nov 19 09:50:16 EST 2018

FormerIBMer - Mon Nov 19 09:36:07 EST 2018

Well, when I look at the attribute properties, I get to the following.  (Edit attribute, Browse where DXL attribute is checked.)

Do I choose New and put the DXL there?

Hm, perhaps you try to modify a system attribute or you just don't have enough access rights to read and change the value or even to use DXL?!

 

Re: Rich Text Markup for DXL Attribute
FormerIBMer - Mon Nov 19 09:53:40 EST 2018

And on top of that, if I created something new, how would I know it would be

applied to the object text in question?  I'm sorry for the questions; these

people are Word aficionados and want their DOORS modules to look like Word, I'm afraid.

Re: Rich Text Markup for DXL Attribute
PekkaMakinen - Mon Nov 19 10:42:28 EST 2018

DXL attribute cannot display colors, Layout DXL can.

Re: Rich Text Markup for DXL Attribute
FormerIBMer - Mon Nov 19 11:15:42 EST 2018

A colleague and I had just come to that conclusion.  Thanks to everyone for looking at it with me.

Workaround is in progress!

Re: Rich Text Markup for DXL Attribute
Mike.Scharnow - Mon Nov 19 11:22:28 EST 2018

FormerIBMer - Mon Nov 19 09:53:40 EST 2018

And on top of that, if I created something new, how would I know it would be

applied to the object text in question?  I'm sorry for the questions; these

people are Word aficionados and want their DOORS modules to look like Word, I'm afraid.

Well, tell them that you can adopt Word so that it does not show different colors for new/deleted text - and voilĂ , the tools look identical Laughing

 

about the object text in question: 

As you can see in the DXL manual, chapter 20 "DXL attributes" and in the examples, two variables are predefined "obj" and  "attrDXLName". "obj" is the object in question. "obj" is also the variable you will need for Layut DXL

 

Re: Rich Text Markup for DXL Attribute
davidcs - Mon Nov 19 12:15:58 EST 2018

There is an example using a layout DXL. 

bool fullRTF=true 
Buffer b1=create 
Buffer b2=create 
Buffer res=create 
 
b1=obj."Specification" 
b2=obj."Proposed_specification" 
 
diff(res, b1, b2, fullRTF) 
displayRichWithColour stringOf(res)

 

Re: Rich Text Markup for DXL Attribute
FormerIBMer - Mon Nov 19 13:29:05 EST 2018

davidcs - Mon Nov 19 12:15:58 EST 2018

There is an example using a layout DXL. 

bool fullRTF=true 
Buffer b1=create 
Buffer b2=create 
Buffer res=create 
 
b1=obj."Specification" 
b2=obj."Proposed_specification" 
 
diff(res, b1, b2, fullRTF) 
displayRichWithColour stringOf(res)

 

What we ended up doing in something similar.  We created both an Attribute DXL and a Layout DXL

The calculation part, like your post, became the body of the Attribute DXL.  The Layout DXL

invokes displayRichWIthColor, with the Attribute DXL name as the argument.

 

Interesting workaround.