-Lisa- Posted April 28, 2014 Share Posted April 28, 2014 I'm composing a data file which includes several records that contain an ampersand in the company name. There is no space between the ampersand and the next character (i.e. H&R Block). I have a copyfit rule created for the company name which uses the CopyFitLine function. Since I need to check "Treat Returned Strings as Tagged Text" in order for this rule to compose successfully,this is what's causing my "Unknown Entity" error. I'm assuming I'm going to need to add something to my rule which replaces the entity. But is there a way to do this without having to create an instance for each and every letter of the alphabet? I'm trying to make life easy.... Thanks! Quote Link to comment Share on other sites More sharing options...
step Posted April 29, 2014 Share Posted April 29, 2014 Just globally replace the ampersands with the entity version like this: return "H&R Block".replace(/&/g,"&"); // returns "H&R Block" Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted April 29, 2014 Share Posted April 29, 2014 Just globally replace the ampersands with the entity version like this: return "H&R Block".replace(/&/g,"&"); // returns "H&R Block" That will work for the ampersand character in particular, but there are other special markup characters that can confuse the tagged markup parser, such as < (less than). The correct way to handle all of these is to use the TaggedTextFromRaw function, like so: return TaggedTextFromRaw("H&R Block"); Or more generally: return TaggedTextFromRaw(Field("Company Name")); Quote Link to comment Share on other sites More sharing options...
-Lisa- Posted April 29, 2014 Author Share Posted April 29, 2014 Worked like a charm! Thanks Dan! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.