![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: OLE and regexp Topic Summary: Created On: 12-Feb-2007 16:17 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hello! This is my first post to a DOORS forum.
Within a DXL script I am trying to change some text in an object that has OLEs in it. If I use regular expressions the text can be changed but I lose the OLEs. How can I get round this? Thanks, Dominic |
|
![]() |
|
![]() |
|
Trying doing it this way. ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Thanks David. That's just what I need.
Dominic |
|
![]() |
|
![]() |
|
David's answer is technically correct: retrieve the Rich Text with 'richTextWithOle' and set it back using RichText. (I would use richTextWithOle(obj.NameAttr) however...).
Doing meaningful edits with DXL on a rich text string is very difficult, much more so if it contains an OLE diagram. You could plow through all the RichTextParagraph s of a Text field, and then through all the RichText chunks, keeping track of all the Italics and bolding yaddy yaddy. I imagine someone has actually done that. With experimenting I discovered some things about some of the rich text commands: [1] cutRichText uses start and end relative to the RAW text, and not relative to the Rich Text. You could therefore get both the richTextWithOle(obj.NameAttr) and also the raw obj.NameAttr, find the position of the text you care about in the Raw text, then use cutRichText on the rich text to get rid of it. [2] replaceRichText uses offset and length relative to the rich text as determined via findRichText. The 'sub' string of findRichText and the string 'r' of replaceRichText are both raw text. so you could findRichText(TextWithOle, "This") and use that info to replaceRichText(TextWithOle, info from find, "That") to replace This with That. [3] Nothing is easy, be SURE to text all DXL out on a sandbox database. - Louie |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
OLE and regexp
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.