Thanks Patrick. That tag is supposed to be at the beginning of the string, I am removing each set of <tag>data</tag> as it is set into a field on the staging form.
The other thing I tried was using substrings but they apparently aren't supported in an active link qualification so I had to add a preceding AL that did a set fields into a temp field and then ran the qualification against that field, thinking that maybe the unlimited size of the character field was causing a problem. So far I have only been testing with a single record which can be around 5000 characters. My set fields was setting this into the temp field: SUBSTR($XML Data$, 0, 9) and when I tested for temp field = "<COMMENTS>" it failed even though the AL log clearly shows the previous active link had set the field to exactly that value. To expand here's a sample of what the first record from the XML file looks like after I have stripped out extraneous headers: <RECORD><TICKETNUM>21231CG010685</TICKETNUM><B1apl>006070002 </apl><casrepDTG></casrepDTG><SERIAL></SERIAL><CATname></CATname><deviceName >ACME</deviceName><FIRSTCONTACT>IVES </FIRSTCONTACT><SECONDCONTACT>BURL </SECONDCONTACT><datereceived>2013-04-17 13:15:00.0</datereceived><equipName>PIECE OF EQUIPMENT </equipName><hscName>misc</hscName><Bremarks>DURING ASSESMENT A PROBLEM WAS DISCOVERED</Bremarks><dateupdated>2013-04-18 08:40:32.7</dateupdated><statusName>IN PROGRESS</statusName><workStatusName>LOCAL</workStatusName><whendiscoveredda te>2013-04-14 00:00:00.0</whendiscovereddate><deferraldate>2013-04-14 00:00:00.0</deferraldate><DEADLINEDATE></DEADLINEDATE><PRIORITYCODE>4</PRIOR ITYCODE><PRIORITYTXT>DESIRABLE</PRIORITYTXT><workGroupNumber>000</workGroupN umber><workGroupName>Equipment Systems</workGroupName><pocEmail>edgar.a....@mail.com</pocEmail><pocNameFirs t>EDGAR</pocNameFirst><pocNameLast>POE</pocNameLast><pocPhone>(888) 555-1212</pocPhone><pocPhoneExt>1111</pocPhoneExt><SCOMMENTS></SCOMMENTS><ty peName>TECH ASSIST</typeName><COMMENTS><COMMENT><COMMENT_ID>257747</COMMENT_ID><COMMENT_ DATEADDED>2013-04-18 08:41:30.003</COMMENT_DATEADDED><COMMENT_COMMENT>GROUP OBTAINED PARTS. REPAIRS IN PROGRESS.</COMMENT_COMMENT><COMMENT_USERNAMEFIRST>Howard</COMMENT_USERNAMEFI RST><COMMENT_USERNAMELAST>Johnson</COMMENT_USERNAMELAST></COMMENT></COMMENTS ></RECORD> I have been able to parse out all of the text from the opening RECORD tag through the closing /typeName tag into the display-only form fields so far, the problem is detecting whether comments are present or not and if so looping only enough times to parse each comment and then exit the guide (since there is no indication in the file how many comments exist for each record). I am using a table that contains one row for each set of tags/delimiters in the XML file and walking that table. After parsing the contents of each data element and using a set fields to get the data into the corresponding field on the display-only form I use the code below in a set fields on the XML Data field that holds the contents of the file. I was doing this to ensure nothing gets parsed more than once but maybe there's a better way to do this. RIGHT($XML Data$, (LENGTH($XML Data$) - STRSTR($XML Data$, $col_EndDelimiter$)) - LENGTH($col_EndDelimiter$)) ___________________________ Rick Westbrock QMX Support Services -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:arslist@ARSLIST.ORG] On Behalf Of Shelston, Patrick Sent: Wednesday, May 01, 2013 12:35 PM To: arslist@ARSLIST.ORG Subject: Re: LIKE operation on a display-only character field is failing Hard to tell without seeing the whole XML doc, but don't you need to wrap % signs on both sides? I.e.: 'XML Data' LIKE "%<COMMENTS>%" Another option might be to do a substring match and then test the result. -Patrick | -----Original Message----- | From: Action Request System discussion list(ARSList) | [mailto:arslist@ARSLIST.ORG] On Behalf Of Rick Westbrock | Sent: May 1, 2013 02:41 PM | To: arslist@ARSLIST.ORG | Subject: LIKE operation on a display-only character field is failing | | Listers- | | For some reason I am having a very tough time with an active link | qualification. I am using a display-only form with display fields to | parse the contents of an XML data file into discreet fields to push | to a regular form. The basic process is to use the XML tags to | isolate the data in each element and do a set fields to a display | field on the form, then strip the XML element (tags and data) from | the front of the string and proceed to the next element. I am walking a table to loop through all the elements. | | My problem is that any given record in the XML data may have zero to | many Comments. There is an opening tag <COMMENTS> that will show | there is at least one comment but if there are no comments then it | will have a <COMMENTS/> tag instead. I have an active link that looks | at the string and decides whether or not to call the guide for | parsing out the comments but the qualification is not working at all. | | I first tried to test for the existence of the opening tag with this | qualification where XML Data is the character field (size 0) that | holds the contents of the XML file: 'XML Data' LIKE "<COMMENTS>%" | | However even when I can see that a previous active link set fields | has set the XML Data field to a string that starts with <COMMENTS> | this qualification fails. I tried to go the other way by using 'XML | Data' LIKE "<COMMENTS/>%" (the tag which indicates no comments are | present) and NOT 'XML Data' LIKE "<COMMENTS>%" but no matter what I | try the qualification always fails. | | Am I missing something obvious about the way a LIKE operation works | on a character field in an active link? I found documentation that it | may not work properly when comparing to the database value of an | unlimited character field but this is just a display field on a | display-only staging form. Any suggestions would be greatly | appreciated. Below is a screen shot of the data field at the time the qualification is evaluated: | | | | AR 7.6.04 SP2, custom application | Windows Server 2008 | MS-SQL Server 2008 | | -Rick | | ___________________________ | Rick Westbrock | QMX Support Services | | | | | ______________________________________________________________________ | ______ | ___ | UNSUBSCRIBE or access ARSlist Archives at www.arslist.org "Where the | Answers Are, and have been for 20 years" ____________________________________________________________________________ ___ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org "Where the Answers Are, and have been for 20 years" _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org "Where the Answers Are, and have been for 20 years"