![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Rich Text in DXL Topic Summary: Created On: 29-Oct-2007 14:42 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: >> Your print statement SHOULD be retrieving the raw text from the attribute. When I ran it it works that way. Compare these two statements: [1] Text = obj."Object Text" // retrieves raw text [2] Text = richText(obj."Object Text") // retrieves rich text Are you SURE that attribute 'SW_CSC' doesn't contain odd rich text tags? Does it look right when you display it in a column? >> If you truly have rich text, you can use the undocumented perm 'plainText' to convert it: RichText = richText(obj."Object Text") TextRaw = plainText(TextRich) >> If you want some code to be generic and work whether its Layout, AttrDXL, or normal DXL, then you can do the following: if (null obj) { // Normal DXL } elseif(null attrDXLName) { // Layout DXL } else { // Attr DXL } Keep in mind that variable 'obj' is globally defined and is set non-null for Layout and AttrDXL, and variable attrDXLName is globally defined and, if AttrDXL, contains the name of the attribute being modified. - Louie | |
![]() |
|
I am debugging a layout DXL script which fetches rich text. I copy the layout DXL script into a DXL interaction window to allow me to quickly debug it. Of course, I get the ugly rich text with all the formatting tags printing out. I'd like to either get just the plain text or formatted rich text in the DXL output window. I can't figure out how to do either. Here's what I've got:
if (name module local_o == "SRS") { displayRich "{\\b \\i SW_CSC: } " probeRichAttr_(local_o,"SW_CSC", false) if (debug) print "SW_CSC: " local_o."SW_CSC" "\n" //***WANT THE local_o."SW_CSC" to be plain text*** } |
|
![]() |
|
![]() |
|
Alan,
I would not try to debug layout DXL in the DXL interaction window. Instead I would put your layout dxl code into a file, e.g. C:/test.dxl. In the column add an include statement #include <c:/test.dxl> Save the view. Now you can edit the code in an editor of your choice rather than using the DXL interation window. To force execution of the code simply reload the view. When you are happy with the code, copy from the code from the file and paste into the column, replacing the include statement. ------------------------- Tony Goodman http://www.smartdxl.com |
|
![]() |
|
![]() |
|
>> Your print statement SHOULD be retrieving the raw text from the attribute. When I ran it it works that way. Compare these two statements:
[1] Text = obj."Object Text" // retrieves raw text [2] Text = richText(obj."Object Text") // retrieves rich text Are you SURE that attribute 'SW_CSC' doesn't contain odd rich text tags? Does it look right when you display it in a column? >> If you truly have rich text, you can use the undocumented perm 'plainText' to convert it: RichText = richText(obj."Object Text") TextRaw = plainText(TextRich) >> If you want some code to be generic and work whether its Layout, AttrDXL, or normal DXL, then you can do the following: if (null obj) { // Normal DXL } elseif(null attrDXLName) { // Layout DXL } else { // Attr DXL } Keep in mind that variable 'obj' is globally defined and is set non-null for Layout and AttrDXL, and variable attrDXLName is globally defined and, if AttrDXL, contains the name of the attribute being modified. - Louie |
|
![]() |
|
![]() |
|
Thanks Louie for the answer--plainText does what I asked for. You're correct--I was getting the tags from somewhere else (my example was a little too simplified) but plainText got rid of the junk in any case.
Tony suggested what was a better approach regarding debug of layout DXL. My approach was kind of cludgy. Tony's method gets rid of the need for the debug hooks in the first place (and lets me use a decent editor).
Thanks to you both!
Al
|
|
![]() |
|
![]() |
|
True for debugging and that's what I do; #include the file. But that's mainly so I can hit the DXL [Run] key which erases the DXL output pane, starting fresh with a new test.
However, as you know, leaving that #include statement in a deployed view is asking for trouble. Certainly if the #included file is on your PC then other folks who use the view won't see it. Even if you put it on the network there is no guarantee that EVERYONE who uses that module and that view will have R access to that network location. No, layout and attr DXL (and Triggers) should be simple and contain all the code they need; nix any #include statements. - Louie Having said that ... I wonder the merits of having a layout open up some configuration file and execute that code... Naaaawwww... |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Rich Text in DXL
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.