Sorry, I think I missed a double-quote on of the STR= attributes :-P
Cheers... ----- Original Message ----- From: "Scott Cadillac" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, December 20, 2002 10:41 AM Subject: Re: Witango-Talk: wrapping XML tags around output > Hi Cornelius, > > I guess this might be better suited to SQL or <@REPLACE> > > If I understand what you are saying, that if your database query potentially > returns one of the columns with some <a href="...">...</a> text, you could > get the SQL statement to wrap the column with the extra XML text like so: > > (use Direct_DBMS) > > SELECT field_one, > field_two, > '<article.object type="url">' + field_three + > '</article.object>' AS field_three > FROM some_table > > This will populate the third column of your local$resultset array with the > extra XML text wrapped around the field value. > > But, if I'm not understanding you, and the database field contains other > HTML text as well as <a></a>, then you might have to loop through your array > and do <@REPLACE> on that column - something like: > > <@ROWS ARRAY=local$resultset> > <@assign local$resultset[<@CURROW>,field_three] value="<@REPLACE > STR='<@REPLACE STR=<@var local$resultset[<@CURROW>,field_three]>" > FINDSTR="</a>" REPLACESTR="</a></article.object>">' FINDSTR='<a href' > REPLACESTR='<article.object type=<@DQ>url<@DQ>><a href'>"> > </@ROWS> > > Note: <@REPLACE> is nested to do both the closing </a> tag as well as the > start <a> tag. > > Hope this helps. Cheers..... > > Scott Cadillac > VP, Research and Development > Plus International Corp. > 403-281-6090 > [EMAIL PROTECTED] > http://www.plusinternational.com > > Does your company have an Enterprise Information Portal? Check out Salsa at > www.plusinternational.com/flash/salsa.htm > > ----- Original Message ----- > From: "Cornelius Conboy" <[EMAIL PROTECTED]> > To: "Multiple recipients of list witango-talk" <[EMAIL PROTECTED]> > Sent: Friday, December 20, 2002 9:32 AM > Subject: Witango-Talk: wrapping XML tags around output > > > > Hopefully this is a simple request. > > > > > > To comply with a client's standards I need to wrap XML tags around all > > href's in a feed they receive. The text is stored in a database varchar > > field and occasionally includes HTML tags. When on of these tags is a link > > it is entered like this: > > > > <a href="target url">text</a> > > > > pretty basic. The client has requested it be presented as such: > > > > <article.object type="url"> <a href="target url">text</a> > > </article.object> > > > > also pretty basic. I'm thinking that there must be a simple way for > Witango > > to do a find and replace so that each instance of '<a href' could be > changed > > to '<article.object type="url"> <a href'. > > > > I do not want to store this change in the database but simply change the > > display of fields in an array where <@col 8> may include href's or may > not. > > > > Does anyone have any experience with this that they can share? > > > > Thanks in advance and thanks for the reminder to turn off auto response if > > you're out of the office. > > > > > > -Cornelius > > > > > > ________________________________________________________________________ > > TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] > > with unsubscribe witango-talk in the message body > ________________________________________________________________________ TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] with unsubscribe witango-talk in the message body
