Posted: Wed Jun 04, 2003 9:13 am Post subject: Having & show as & in an XML Tag
Master
Joined: 21 Nov 2002 Posts: 200
I have to concatenate several tags, then put an &, then several more tags to create one output tag. I know that the & is a special character for XML and have tried escaping and several other things and my output always looks like the following:
I want it to look like this:
<ODL_PRIMARY_STREET>SSGOTHARDRDN1FL&MARGATERD</ODL_PRIMARY_STREET>
Can someone help me understand what I need to do? Here is the code I currently have: Thanks in advance!!!
Set PriSt1 = (InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_ALPHA_CIVIC ||
InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_P_ARTICLE1 ||
InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_STREET_NAME1 ||
InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_P_STREET_TYPE1 ||
InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_P_DIR1 ||
InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_APPT_NO ||
InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_COMMERCIAL_LOCAL);
If ((InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_P_ARTICLE2 <> '' or
InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_P_ARTICLE2 IS NOT NULL) or
(InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_STREET_NAME2 <> '' or
InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_STREET_NAME2 IS NOT NULL) or
(InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_P_STREET_TYPE2 <> '' or
InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_P_STREET_TYPE2 IS NOT NULL) or
(InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_P_DIR2 <> '' or
InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_P_DIR2 IS NOT NULL))
THEN
SET PriSt2 = ('&' || InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_P_ARTICLE2 ||
InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_STREET_NAME2 ||
InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_P_STREET_TYPE2 ||
InputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_P_DIR2);
SET OutputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_PRIMARY_STREET = (PriSt1 || PriSt2);
ELSE
SET OutputRoot.XML.CompleteOdlJob.DataArea.ODL_LIGHT_INFORMATION.ODL_PRIMARY_STREET = PriSt1;
END IF;
Thanks!! I have searched this site and the Using the Control Center documentation as well as the on-line help and cannot find anything that shows me how I would code the CDATA section in my example above. Can anyone help me with how to code it or point me to some documentation?
Thanks!! Since the data in the tag is concatenated from several fields, do I put the CDATA section in each field I concatenate? Sorry for my confusion!
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum