3 Replies Latest reply: Mar 25, 2012 12:31 PM by danisnthere RSS

    How do I get "&" in xml data in LiveCycle

    Jerry62712 Community Member

      I create an xml object in Flex and pass it to a LiveCycle form for printing, saving and such.

       

      The problem is the user might type something like "The E&T rating..."  LiveCycle chokes on the "&T".  Is there a way to encapsulate the data to prevent this?

        • 1. Re: How do I get "&" in xml data in LiveCycle
          YogLC Community Member

          Any updates on this?

          • 2. Re: How do I get "&" in xml data in LiveCycle
            Jerry62712 Community Member

            Yes.  We ended up encapsulating the data field inside of a [CDATA[ block to isolate the special character and potentially other special characters.

             

            tempData = "\<![CDATA[" + (model.dpCASENOTES[i] as CaseNotesVO).notes.toString() + "]]\>";
            xmlHold += "<Notes>" + tempData + "</Notes>";
            
            • 3. Re: How do I get "&" in xml data in LiveCycle
              danisnthere Community Member

              I saw your response to this and I think it is along the lines of what I need to do.  My question i posted today follows:

               

              "I have a simple pdf fillable form that I created in LiveCycle Designer ES that saves/submits form data as XML for parsing into a database.  The database parser requires all form data to be encapsulated into CDATA tags inside the XML fieldnames or it will not process it.  Can anyone give some pointers to force the XML output to encapsulate the data inside CDATA tags within the XML fieldnames in my output XML file?  Thanks."


              From you answer it looks like you may have figured this out, but where did you use the code in the source xml?  I don't find anyplace that this kind of code would fit in my source xml.  Any help would be appreciated.  Thanks.