Diff in DXL Attribute (obj.attrDXLName) without color

Hello!

I want to make a diff in an DXL Attribute. My Problem is, when i do it in the way like in a layout DXL, the colors aren't printed.

In Layout DXL i normally use displayRichTextWithColor() function.

What can i do to see the colors in DXL-Attributes?

Buffer buff1 = create()
                Buffer buff2 = create()
                        Buffer resBuf = create()
                        buff1 = obj.attributeToCompareValueALM
                        buff2 = o.attributeToCompareValueUIT
                        diff(resBuf, buff1, buff2)
                                        obj.attrDXLName =richText stringOf(resBuf)                      
 
                        delete resBuf
                        delete buff1
                        delete buff2

Bjoern_Karpenstein - Tue Nov 20 15:12:56 EST 2012

Re: Diff in DXL Attribute (obj.attrDXLName) without color
SystemAdmin - Tue Nov 20 17:55:22 EST 2012

There are 3 different declaration variations for the DXL diff() function.

The one you have used does not define the mark-up colours and font.

You need to use the following variant.

diff(Buffer result, Buffer source, Buffer target, string removeMarkup,insertMarkup)

 

An example using your code would be as follows

 

 

diff(resBuf, buff1, buff2, "\\cf1\\strike ","\\cf3\\ul ")
displayRichWithColor(stringOf(resBuf))


This will strike out deleted characters and display them in a red color, and will underline inserted characters and display them in a blue color

I recommend that you have a look at the DXL Reference manual to learn more about the removeMarkup and insertMarkup arguments. Select Help > DXL Reference Manual from the DOORS Explorer menu, then navigate to the following help section Modules->History->diff(buffer)

 

 

 


Paul Miller,
Melbourne, Australia

 

 

Re: Diff in DXL Attribute (obj.attrDXLName) without color
Bjoern_Karpenstein - Wed Nov 21 01:57:27 EST 2012

SystemAdmin - Tue Nov 20 17:55:22 EST 2012

There are 3 different declaration variations for the DXL diff() function.

The one you have used does not define the mark-up colours and font.

You need to use the following variant.

diff(Buffer result, Buffer source, Buffer target, string removeMarkup,insertMarkup)

 

An example using your code would be as follows

 

 

diff(resBuf, buff1, buff2, "\\cf1\\strike ","\\cf3\\ul ")
displayRichWithColor(stringOf(resBuf))


This will strike out deleted characters and display them in a red color, and will underline inserted characters and display them in a blue color

I recommend that you have a look at the DXL Reference manual to learn more about the removeMarkup and insertMarkup arguments. Select Help > DXL Reference Manual from the DOORS Explorer menu, then navigate to the following help section Modules->History->diff(buffer)

 

 

 


Paul Miller,
Melbourne, Australia

 

 

Hello Mr. Miller.

Thanks for your reply. I tried to use it as follows, unfortunalety nothing happened:

Buffer buff1 = create()
                Buffer buff2 = create()
                        Buffer resBuf = create()
                        buff1 = obj.attributeToCompareValueALM
                        buff2 = o.attributeToCompareValueUIT
                        diff(resBuf, buff1, buff2, "\\cf1\\strike ","\\cf3\\ul ")
                    obj.attrDXLName = richText(stringOf(resBuf));                                                       
                    // displayRich richText(stringOf(resBuf));  
                        delete resBuf
                        delete buff1
                        delete buff2

 


It looks like there is no coloring?

 

Re: Diff in DXL Attribute (obj.attrDXLName) without color
SystemAdmin - Wed Nov 21 02:47:40 EST 2012

Bjoern_Karpenstein - Wed Nov 21 01:57:27 EST 2012

Hello Mr. Miller.

Thanks for your reply. I tried to use it as follows, unfortunalety nothing happened:

Buffer buff1 = create()
                Buffer buff2 = create()
                        Buffer resBuf = create()
                        buff1 = obj.attributeToCompareValueALM
                        buff2 = o.attributeToCompareValueUIT
                        diff(resBuf, buff1, buff2, "\\cf1\\strike ","\\cf3\\ul ")
                    obj.attrDXLName = richText(stringOf(resBuf));                                                       
                    // displayRich richText(stringOf(resBuf));  
                        delete resBuf
                        delete buff1
                        delete buff2

 


It looks like there is no coloring?

 

I also cannot get the color to work when using a DXL Attribute. So maybe this is not possible and you have to use DXL Layout.

I tried to convert one of my DXL Layout scripts that uses the diff() function into a DXL Attribute - but the DXL Attribute will not display the color for deleted text and inserted text.

DOORS has a Module menu function that converts DXL Layout columns into a DXL Attribute via Tools > Support Tools > Convert Layout DXL to Attribute DXL.

Even though this conversion tool adds special DXL code to capture the output of the displayRichTextWithColor() function into a buffer, I think that the richText() function used in obj.attrDXLName = richText(stringOf(resBuf)) does not recognize the RTF color commands \\cf1 and \\cf3.
Paul Miller,
Melbourne, Australia

Re: Diff in DXL Attribute (obj.attrDXLName) without color
Mathias Mamsch - Wed Nov 21 06:10:05 EST 2012

SystemAdmin - Wed Nov 21 02:47:40 EST 2012
I also cannot get the color to work when using a DXL Attribute. So maybe this is not possible and you have to use DXL Layout.

I tried to convert one of my DXL Layout scripts that uses the diff() function into a DXL Attribute - but the DXL Attribute will not display the color for deleted text and inserted text.

DOORS has a Module menu function that converts DXL Layout columns into a DXL Attribute via Tools > Support Tools > Convert Layout DXL to Attribute DXL.

Even though this conversion tool adds special DXL code to capture the output of the displayRichTextWithColor() function into a buffer, I think that the richText() function used in obj.attrDXLName = richText(stringOf(resBuf)) does not recognize the RTF color commands \\cf1 and \\cf3.


Paul Miller,
Melbourne, Australia

In fact there is one supported richText tag, that will add color to a normal attribute: \highlight ... unfortunately this will only set the brackground color of the text, but this is normally better than just underlining or striking.

Try:
 

...
diff(resBuf, buff1, buff2, "\\cf1\\highlight2 ","\\cf3\\highlight1 ")
...

 


Maybe that helps, regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Re: Diff in DXL Attribute (obj.attrDXLName) without color
llandale - Wed Nov 21 10:42:36 EST 2012

I don't think you can display color in an attribute like that, although you can in a layout.

Re: Diff in DXL Attribute (obj.attrDXLName) without color
Thosicus - Mon Nov 16 18:46:55 EST 2015

Thanks Matthias for the tip.  I was able to get background color plus strikethrough and underlining.  The background coloring really stands out.  And I'm talking a DXL attribute, not a layout dxl column.

      diff(diffBuf, buf0, buf1, "\\cf1\\strike\\highlight1 ", "\\cf3\\ul\\highlight2 ")
 

Keep up the good work!

 

-Tom