Using CDATA when creating an xml message

I'm currently trying to create an XML message in one of my tags I'm trying to put the following string "
". However when I create the xml document I receive the following string 
. I think the conversion is happening when I call
setStringNodeData
Here is my code
strCaseNotes = "
" + "This is a test message";
CreatedElement = setStringNodeData(doc,"strCaseNotes",CaseInfo, strCaseNotes);
doc = getXMLDoc();
doc.write (baos);
String strXMLDoc = baos.toString ();          
log.log("strXMLDoc: " + strXMLDoc, "SSDRulesEngine.txt");
This is the ouput 

I assume the conversion is happening in setStringNodeData. Anyway to stop the conversion of & to amp. Any help is greatly appreciated, thanks

Don't get mixed up between the string you see in your program and what you see in your XML file. If you want a CR-LF pair in your XML output you need to do this:strCaseNotes = "\r\n" + "This is a test message";In other words, within your program just use strings as you would normally. Don't try to second-guess the XML parser. You may find the XML software outputs that string in a text node as "
This is a test message" or you may see something slightly different. Again, don't try to affect the output. If your XML software outputs it then any XML parser can read it. But if you mess with it after it's output, then you will probably break the XML in such a way that another XML parser will reject it.

Similar Messages

  • What is the payload structure has to be used for AQ to process XML messages.

    Hi Experts,
    We have an IBM MQ and Oracle AQ has to be be linked to that.
    MQ always contains XML messages and same message will come to AQ.
    Now I want to create AQ. What is the payload structure(object) has to be used for AQ to process XML messages.
    Please help me.
    Thanks.

    Hello,
    using XML type data in AQ you have to define a special AQ payload type
    (corresponding to MQ):  QUEUE_PAYLOAD_TYPE = 'SYS.MGW_BASIC_MSG_T'.
    An example template for enqueueing looks like (you have to transform
    from XMLTYPE to the MGW payload type):
    DECLARE    
       queue_options      DBMS_AQ.ENQUEUE_OPTIONS_T; 
       message_properties DBMS_AQ.MESSAGE_PROPERTIES_T;  
       message_id         RAW(16);  
       v_message          SYS.XMLType;   
       v_clob             CLOB;
       v_payload          SYS.MGW_BASIC_MSG_T;
       v_text_body       
    SYS.MGW_TEXT_VALUE_T;
    BEGIN
       v_message      := SYS.XMLType.createXML('<SAMPLE>hello world</SAMPLE>'); 
       v_clob         := v_message.GETCLOBVAL();
       v_text_body    := SYS.MGW_TEXT_VALUE_T( NULL, v_clob );
       v_payload      := SYS.MGW_BASIC_MSG_T( v_header, v_text_body, NULL );
       DBMS_AQ.ENQUEUE( queue_name         => 'my_queue',
                        enqueue_options    => queue_options,
                        message_properties => message_properties,
                        payload            => v_payload,
                        msgid              => message_id);
    END;
    Kind regards,
    WoG

  • How to use oracle TRIM functionality in XML messages

    When i am selecting data from XML message as per below query, it is returing values correctly.
    SELECT extractValue(x.column_value, '/DETAILS/EMPID') as emp_id,
    extractValue(x.column_value, '/DETAILS/NAME') as emp_name,
    extractValue(x.column_value, '/DETAILS/SALARY') as emp_sal
    FROM TABLE(
    XMLSequence(
    Extract( xmltype('<DETAILS><EMPID>2482</EMPID><NAME>SMITH</NAME><SALARY>4854</SALARY><LOC>CHENNAI</LOC></DETAILS>'),'/DETAILS'))) x;
    But when i am selecting data by using below query some additional spaces also coming with column values
    SELECT extractValue(x.column_value, '/DETAILS/EMPID') as emp_id,
    extractValue(x.column_value, '/DETAILS/NAME') as emp_name,
    extractValue(x.column_value, '/DETAILS/SALARY') as emp_sal
    FROM TABLE(
    XMLSequence(
    Extract( xmltype('<DETAILS>
                   <EMPID>
                             2482
                             </EMPID>
                             <NAME>
                             SMITH
                             </NAME>
                             <SALARY>
                             4854
                             </SALARY>
                             <LOC>
                             CHENNAI
                             </LOC>
                             </DETAILS>'),'/DETAILS'))) x;
    Please suggest how to remove additional spaces by using second query.
    Thanks
    Vikrant Jain.

    It appears that the ability to use XPath functions in the PATH expression doesn't work prior to 11g :
    Connecté à :
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> var xmldoc varchar2(4000)
    SQL> begin :xmldoc := '<DETAILS>
      2  <EMPID>
      3  2482
      4  </EMPID>
      5  <NAME>
      6  SMITH
      7  </NAME>
      8  <SALARY>
      9  4854
    10  </SALARY>
    11  <LOC>
    12  CHENNAI
    13  </LOC>
    14  </DETAILS>';
    15  end;
    16  /
    Procédure PL/SQL terminée avec succès.
    SQL> SELECT emp_id, emp_name, emp_sal
      2    FROM XMLTable('/DETAILS'
      3                  PASSING XMLTYPE(:xmldoc)
      4                  COLUMNS
      5                  emp_id     NUMBER        PATH 'normalize-space(EMPID)',
      6                  emp_name   VARCHAR2(20)  PATH 'NAME',
      7                  emp_sal    VARCHAR2(20)  PATH 'SALARY');
    SELECT emp_id, emp_name, emp_sal
    ERREUR à la ligne 1 :
    ORA-31011: Echec d'analyse XML
    ORA-19202: Une erreur s'est produite lors du traitement la fonction XML (
    LPX-00601: Invalid token in: '/*/normalize-space(EMPID)')Using it in XQuery will work though :
    SQL> SELECT *
      2  FROM XMLTable(
      3   'for $i in /DETAILS
      4    return element r
      5    {
      6     for $j in $i/*
      7     return element {local-name($j)} {normalize-space($j)}
      8    }'
      9   PASSING XMLTYPE(:xmldoc)
    10   COLUMNS
    11     emp_id     NUMBER        PATH 'EMPID',
    12     emp_name   VARCHAR2(20)  PATH 'NAME',
    13     emp_sal    NUMBER        PATH 'SALARY'
    14  );
        EMP_ID EMP_NAME                EMP_SAL
          2482 SMITH                      4854

  • Using ANT to create config.xml template

    Does anyone have an example on how to use ant to create a config.xml template?

    try this:
    <target
         description="Creates the config.xml file from the config-template.xml file"
         name="parseConfigXML">
         <copy
              file="config-template.xml"
              tofile="config.xml"
              overwrite="true"
         />
         <replace
         file="config.xml"
         value="defaultvalue"
         replacefilterfile="local.configtemplate.properties">
         </replace>
         <antcall target="parseSetDomainEnv" />
    </target>

  • Using hint when creating index

    Hi,
    is it possible to use a hint when creating an index.
    for example normally when creating an index, optimizer does full table scan, but i want it to use a different index to walk through the table.
    any ideas?
    technically impossible?

    If the new index is a subset of an existing index, Oracle should be able to read the existing index to create the new index.
    However, if the index consists of such a combination of columns that one or more is not in the subset then it has to read all the rows of the table.
    Hemant K Chitale

  • Why do I get an error message saying unable to use disk when creating a DVD

    I have successfully burned two DVD's of a group of three I am burning of my last vacation pictures. I have successfully created WMV files for each day of the trip which I have combined to create the three DVD's so they won't be too lengthy. I created a menu with main menu and stop menu markers. When I went to burn the third disk, which is the shortest of the group the program would encode to the 96% and then the disk would eject and it would give an errow message saying the disk was not compatable. This was the same type of DVD-RW disks I used on the two successful disks. I tried redoing the burn 3  times with each time getting to 96% on the encription and then the same error message occurred. I used fresh disks each time. On the forth try I cut the number of WMV files down to 3 to make the DVD half as long. The same thing happened at the 96th% spot of the encription process. Nothing had ever been put on the disks. I am using top quality Memorex DVD-RW disks. Please let me know what else I can do. I am very frustrated. Oh yes, I closed the program down each time I got the error and also shut down and restarted the computer afer each error. I really want to finish this project as I have been working on it now for two weeks non stop. Thank you.

    Good, that gets one possibility out of the way.
    Since the error about the disc indicates that the Transcoding has already finished, I think that we can probably rule out the next step, but let's look anyway.
    Now, for Transcoding to DVD, PrE uses 2-pass Encoding, so it would seem that this problem is comng right at the end of the second pass, at the end of the Timeline. Look very closely at that point, and see if there is anything odd there. Things like gaps in the Video of a Timeline, or sometimes Assets that are not proper, can cause Transcoding to stop. Anything there? [I think that with a disc error, Transcoding HAS completed, and the progress bar is just lagging slightly behind, but more questions are probably needed.]
    Last, what brand of blank media are you using? The reason that I ask this is that some companies, like Memorex, buy the cheapest disc that day, and rebrand them, so in a spindle of 25, you might end up with blank discs by different mfgrs., and some can be much better, than others.
    Good luck,
    Hunt

  • Error when creating new XML-Form

    Hi everybody!
    We are using XML-Forms to create/edit/display FAQs out of the KM-Content. We have created our own XMLForms for that and it worked fine. After our last upgrade (NW 7.0 SP-Stack 16) we have the following problem:
    clicking the "new FAQ" link in the portalruntime doesn't start the XML-Form anymore but displays an java error:
    java.lang.RuntimeException: Context is unavailable!
         at com.sap.pct.plm.dmsrmconnectorforkm.DMSRMConnection.(DMSRMConnection.java:83)
         at com.sap.pct.plm.dmsrmconnectorforkm.DMSRMR3FunctionCalls.getGenericValueList(DMSRMR3FunctionCalls.java:6598)
         at com.sap.pct.plm.dmsrmconnectorforkm.DMSRMR3FunctionCalls.getLaboratoryList(DMSRMR3FunctionCalls.java:6426)
         at com.sap.pct.plm.dmsrmconnectorforkm.DMSRMR3FunctionCalls.getLaboratoryDescription(DMSRMR3FunctionCalls.java:6451)
         at com.sap.pct.plm.dmsrmconnectorforkm.DMSRMLaboratoryValueProvider.getValueLabel(DMSRMLaboratoryValueProvider.java:47)
         at com.sapportals.wcm.service.propertyconfig.config.MetaValue.getValueLabel(MetaValue.java:53)
         at com.sapportals.wcm.service.propertyconfig.config.MetaValue.getValueLabel(MetaValue.java:79)
         at com.sapportals.wcm.service.xmlforms.validation.PropertyLocalizer.getLocalizedPropertyValue(PropertyLocalizer.java:294)
         at com.sapportals.wcm.service.xmlforms.validation.PropertyLocalizer.localize(PropertyLocalizer.java:208)
         at com.sapportals.wcm.service.xmlforms.transformation.TransformationHelper.localizeProperties(TransformationHelper.java:64)
         at com.sapportals.wcm.service.xmlforms.transformation.Transformation.render(Transformation.java:438)
         at com.sapportals.wcm.service.xmlforms.transformation.Transformation.renderTemplate(Transformation.java:318)
         at com.sapportals.wcm.service.xmlforms.transformation.Transformation.renderItemOrTemplate(Transformation.java:332)
         at com.sapportals.wcm.app.xmlforms.EditServlet.doGetAction(EditServlet.java:348)
         at com.sapportals.wcm.app.xmlforms.XFBaseServlet.doGet(XFBaseServlet.java:241)
    I don't have that behaviour when i try to edit an existign FAQ. But I have the same problem with any other XML-form i'm using to create KM-docs.
    to me it seems that the creation-context is somehow not valid. But what does that mean? and what can I do about it?
    Regrads, Alex

    Hi Alexander
    I think this thread might help you as it helped me, and it is the exact same error that you get
    https://www.sdn.sap.com/irj/sdn/thread?messageID=2943423#2943423
    Best regards,
    Martin Søgaard

  • How can I pass value in status and reason for rejection using BAPI_LEAD_CREATEMULTI when creating multiple lead

    Hello,
    I want pass value in STATUS and Reason for rejection according to requirement when i am creating multiple lead using BAPI_LEAD_CREATEMULTI. Please help me how can i pass value. Please give some sample code that in which table i have to pass values and please also tell me INPUT_FIELDS values. Please help me
    Regards,
    Kshitij Rathore

    Hello,
    Please help me for solve this problem. I am trying to solve problem from last 4 days but i didn't get any solution.
    Regards,
    Kshitij Rathore

  • Use of BPM for processing XML message

    I have got a requirement for updating X-number and X- status into the SAP system from a non SAP system. I am getting the message which contains both these values in the form of xml and using HTTP and should be posted as 2 different IDOCs at the SAP system.
    But the requirement is to post the X-number first and once it is updated X-status should be posted based on the number.
    Assuming that X-number is available first and the status next in the non SAP system can we use BPM and if so how what needs to be done to make sure status doesnt update before number.

    Hi,
    Proceed as follows:
    1) Receive the X-message
    2) have  a transformation step....and map only the x-number into the target IDOC
    3) have a synchronous send step....why a sync send....because in that you can get the confirmation for success/failure of your x-number upload....this is only if you want a confirmation...this will make sure that your x-number is updated first.....
    4) now if you do not want to have a response back then...have a transformation step to map the x-status to your IDOC...then have a async send step...
    5)
    a)If sync send used: then you can have a condition like check the status of upload of x-number and if successful then send the x-status.
    b) if failure then you can resend the x-number message.
    c) if async send then you can directly send your x-status message.
    Steps 3, 5(a), 5(b) can be avoided if async commn is used. If you want that your BPM runs somewhat faster then you can avoid the transformation steps....instead you can use the mappings in the respective interface detemination.
    Regards,
    Abhishek.

  • Error When reading Archived XML Message

    I am having the next issue reading the archived messages (error msg: Could not find message in archive).
    can anybody help me.
    my problem is the same that this topic.
    Problems with reading archived Messages
    Any suguest please?
    Regards
    RP.

    Hi Sudharshan/Cornelius,
    Thanks for your support. I am glad that my inputs were helpful.
    Shudarshan, what do you mean by the process?
    If you are talking about the arhiving process, then it is very huge topic
    in itself. You can find that in help.sap.com.
    But in this specifc case, what happens is that to made archiving possible,
    there are different objects involved. e.g Archiving object, read write methods, Infostructures etc. In our case, the infostructure objects is in "inactive" state. Which seems to be a mistake from the SAP side. All we need to do is activate that object. And we are done.
    Actually I also had the same issue, and I found this thread with few threads with no answer :-(.  Then I just went deep into it and I found this "mistake"
    It is just yesterday, when I cracked this issue by myself. I decided to put in the thread.
    again I am happy my efforts were useful to you people.
    Thanks and Regards,
    Arundeep Singh
    001-416-828-1307

  • How to use java to create an XML document from an SQL database?

    Hi,
    I'm a complete novice at XML and have only recently started programming in Java.
    I'm currently trying to develop a package in Java 1.1.8 which requires a set of very specifically formatted XML documents. These documents would need to be updated regularly by people with no knowledge of Java and I would like to make it as simple as possible.
    Since the data will already be in an SQL database, I thought it might be possible to generate the XML documents from the data using a small Java application, but I'm not too sure how to go about this or if this is even possible! Any help or pointers in the right direction would be very much appreciated.
    Louise

    Do you have the option of upgrading to a newer version of the JDK?
    JAXB does what you are wanting very easily. Also there are tools if you don't want to write your own. JAXB is available as early release on Sun's site as is the newest JDK. Otherwise, you have to design a factory and interface that will do this for you (which is what JAXB basically is in a very simplified view).

  • Using Cdata in Jdbc Receiver XML

    I´m try to select a data com a database that has some characters not supported in XML ( like & # x f ; ). The ideia I had was to put it inside a Cdata element ( like <![CDATA[ & # x f ;]]> ).
    The original select to get the data I is this:
    SELECT X from TABLE;
    I changed for this:
    SELECT CONCAT(CONCAT('<![CDATA[',X),']]>')  AS X from TABLE
    But the problem is that it transforms <![CDATA[ to & l t ; ! [CDATA[. Anyone knows how can I maintain the purpose of CDATA in a Select ? Or another solution for this...
    Thanks
    Vitor Zaninotto
    Edited by: Vitor Zaninotto on Aug 5, 2008 4:57 PM

    Indeed, actually, it is as simple as this :
    <fx:Script>
         <![CDATA[
              myXMLnode = myRichTE.htmlText
         ]]>
    <fx:Script>
    <mx:RichTextEditor id="myRichTE" />
    It is correctly inserted into the XML, by replacing tags with their corresponding html entities.

  • The "Adobe Reader 11.0.08 security update - All languages" is not working with "Adobe Reader 11.0 - Multilingual (MUI) installer" using msiexec when creating an msi package. is there going to be a release of Adobe Reader 11.0.08 update - Multilingual (MUI

    Is it possible to create an msi package if the product you are upgrading is Multilingual (MUI) and the update(msp) you are applying is not Multilingual (MUI) but "All languages"?

    Please download the latest Adobe Reader patch from the below mentioned location, it will work with MUI installer.
    ftp://ftp.adobe.com/pub/adobe/reader/
    ~Deepak

  • Can I use FormsCentral when creating a form from existing document?

    Hi,
    I am trying to make a template in Formscentral. I want to use a picture with our corporate design for forms. I can change that in a PDF, but if I want to use that in FormsCentral, The picture is not paper wide (as it should), but leaves white margins an header and footer. But if I try to make a form and chose 'from existing document' I seem to not be able to end up in FormsCentral. What am I doing wrong?
    Isabella

    Hello George,
    How do I upload a PDF to the FormsCentral service? Wil I see that form then in My Forms or in the the standard templates list? I want to be able to re-use a collored PDF with no fields in it. I use this one to make several forms which will all look the same in the background.

  • EBP SUS NO PO RESPONSE and Invoice XML MESSAGE CREATED

    Hi All,
    We have configured EBP - SUS on SRM 7 server with extended classic scenario.PO's are transfering fine from EBP to SUS and are visible in SUS also expected follow on documents are PO response,Confirmation,Invoice.But wen we process the po and confirm all items no po response xml message is created and a local po response is created which is not transferred back to EBP.Later when we create a confirmation for the same po,it is transfered to EBP via serviceack xml message and is visible.
    Finally wen v create a invoice it is also created locally and not tranferred to EBP,no xml message is created in this case too.
    In XI we are using integration scenario which is based on SRM 5.5 contents.
    Any kind of pointers will b appreciated.
    Thanks.

    Hi
    Proxies are fine,also i check for events in define transaction type.Here are the values for both response and invoice evrything seems fine.
    Description          SUS PO Purch.Ord.Rsp
    Int. Number Range         01
    Ext. Number Range         02
    Status Profile
    BTrans.Category      BUS2232
    Description          SUS PO Confirmation
    Partner Determ.Proc.
    Text Schema          PCOS
    Event Schema
    Description          SUS Invoice
    Int. Number Range         01
    Ext. Number Range         02
    Status Profile
    BTrans.Category      BUS2234
    Description          SUS Invoice
    Partner Determ.Proc.
    Text Schema          SUIV
    Event Schema
    EVENT DEFINITION
    BUS2234     SUS Invoice     SUS Invoice
    ERROR_OCURRED     An Error has Occurred
    Any settings tat we need to do to trigger this invoice to create a xml message.Also we regenerated the authorization profiles but had effect on xml creation.
    Thanks

Maybe you are looking for

  • Daily Allowance - Cloud for Travel

    Hi all, sorry if I keep asking questions and hope it also helps to other customers who are deploying the solution. Do you know if is it possible to calculate the allowance per trip instead of on a daily basis? Let me explain myself, if I have a trip

  • Binding variable

    How can i make the value for the binding variable is always upper case. I am wroking with asp.net thanks a bunch Dim Sql As String = " select * from vendor where vnamel like :VendorName"

  • Bad News...

    Ok. Just received my new 20" iMac Dual Core. Not so good. Here's what happened. Stared coping over a bunch of large video files from an ext. firewire drive. About an hour os so in, the copying process hung. I tried force quitting the Finder -- no dia

  • [DW+JS] A punto de salir del horno

    Hola amigos! Por fin he hecho la pagina que yo queria para el estudio para el que estoy trabajando, todo contorlado.... todo? �no! un irreductible script se resiste a entrar en armonia con el resto de la pagina. Es uno de "esos" que precargan las ima

  • Pre-order Phone - No confirmation / No recent orders

    I pre-ordered my iPhone 6 at 2:15 CST this morning and still have not received a confirmation email. When I try to pull up my recent orders online on my account it shows that there are no recent orders,-