Converting XML(as String) to XML(XMLObject) in WLI8.1

Hi,
I am new to WLI 8.1. In my business process I receive an XML from client as Java
String. Now I want to convert it into com.bea.xml.XMLObject to perform XSL Transformation.
How do I do it in WLI workshop.
Is it possible in WLI8.1 to use XML in the form of Java String as Input/Output
for XSL Transformation.
Thanks in advance
Ashish

I can think of 2 options.
a) Take the generated XMLObject for the XML as input to JPD - this is the default
behaviour when you use WLW when you configure you client request control method
to take the XSD as the input.
b) If you to take java.lang.String as input to the JPD method then by default
the transformation tool does NOT parse it as XML. You will have to write custome
code (using xquery/xpath or supply an xslt) to parse the XML to build the XMLObject.
The client would still send an XML request in both scenarios... and so both the
above options would not impact clients.
Hope this helps...
Vishwa
"Ashish Agrawal" <[email protected]> wrote:
>
Hi,
I am new to WLI 8.1. In my business process I receive an XML from client
as Java
String. Now I want to convert it into com.bea.xml.XMLObject to perform
XSL Transformation.
How do I do it in WLI workshop.
Is it possible in WLI8.1 to use XML in the form of Java String as Input/Output
for XSL Transformation.
Thanks in advance
Ashish

Similar Messages

  • How to convert a delimited string to XML?

    Hi there,
    Please help me to convert a pipe delimited string into XML, e.g.
    string -------SubName:abc|SuvValue:123|
    required XML:
    <ROWS>
    <ROW>
    <SubName>abc</SubName>
    <SubValue>123</SubValue>
    </ROW>
    </ROWS>
    or
    string -------abc|123|
    required XML:
    <ROWS>
    <ROW>
    <SubName>abc</SubName>
    <SubValue>123</SubValue>
    </ROW>
    </ROWS>
    -----i am trying to first parse the string into a table type and then using the DBMS_XMLGen.getXML function but unable to get values from table type...
    any prompt response is highly appriciated...
    Regards, Hassan

    Hi Hassan,
    If your version supports it (ie 10gR2 and upwards), you can use XQuery to directly parse the string and generate the XML :
    SQL> SELECT XMLQuery(
      2   '<ROWS>
      3    <ROW> {
      4     for $i in ora:tokenize($str,"\|")
      5     return
      6      if ($i) then element {substring-before($i,":")} {substring-after($i,":")}
      7      else ()
      8   } </ROW>
      9   </ROWS>'
    10   passing sys_xmlgen('SubName:abc|SubValue:123|') as "str"
    11   returning content
    12  ).getClobVal()
    13  FROM dual;
    XMLQUERY('<ROWS><ROW>{FOR$IINO
    <ROWS><ROW><SubName>abc</SubName><SubValue>123</SubValue></ROW></ROWS>
    Each element is built based on its name from the input string.

  • String to XML conversion without fatal error?

    Can one of you tell me how to convert the folowing string to XML without fatal error?
    String s1 = "<?xml version="1.0" encoding="UTF-6.0"?> <Main> <sub> 12345 </sub> </Main>".

    First, you can't have double quotes (") in a string like that, you need to do (\") instead. If you wrote the below line and saved the file as a file_name.xml It should work fine.
    import java.io.*;
    public class yourclass{
         public static void writeXML(){
              try{
                   File xmlOut = new File("file_name.xml");
                   BufferedWriter xmlWriter = new BufferedWriter(new FileWriter(xmlOut));
                   String s1 = "<?xml version=\"1.0\" encoding=\"UTF-6.0\"?> <Main> <sub> 12345 </sub> </Main>";
                   // you can concatenate the strings using a + 
                   // the \n will create a new line in the file
                   String s2 = "<?xml version=\"1.0\" encoding=\"UTF-6.0\"?>" + "\n" +  "<Main> <sub> 12345 </sub> </Main>";
                   xmlWriter.write(s1);
                   xmlWriter.close();
              }catch(Exception ex){
                   ex.printStackTrace();
    }There are a few other ways to do this, the one above is sloppy. One is XStream to convert xml to Java objects and back again. http://xstream.codehaus.org/tutorial.html

  • MapViewer API: addMapCacheTheme creates unexpected XML request string

    Hi,
    I try to get a map with map cache theme on it. But MapViewer class generates an xml request string in which an unexpected wfs theme
    exists. So I'm unable to add a map cache theme since the wfs theme causes a problem and i only get an image painted with background
    color...
    my java code is as follows:
                   String viewerUrl = "http://localhost:8888/mapviewer/omserver";
                   String dataSource = "ADATASOURCE";
                   String mapCache= "AMAPCACHE";
                   MapViewer viewer = new MapViewer(viewerUrl);
                   viewer.setDataSourceName(dataSource);
                   viewer.setImageFormat(MapViewer.FORMAT_PNG_URL);
                   viewer.setMapRequestSRID(8307);
                   viewer.setAntiAliasing(false);
                   viewer.setMapTitle(null);
                   viewer.setBackgroundColor(new Color(0xA6CAF0));
                   viewer.setBackgroundImageURL(null);
                   viewer.setDeviceSize(new Dimension(480, 480));
                   //viewer.setBaseMapName(baseMap);
                   viewer.addMapCacheTheme(mapCache, dataSource, mapCache, true);
                   viewer.setCenter(29, 41);
                   viewer.setSize(1);
                   //For debugging issues
                   String req = viewer.getMapRequestString();
                   viewer.run();
    value for req variable is:
    <?xml version="1.0" standalone="yes"?>
    <map_request
    datasource="ADATASOURCE"
    srid="8307"
    width="480"
    height="480"
    bgcolor="#a6caf0"
    antialiase="false"
    format="PNG_URL"
    >
    <center size="1.0">
    <geoFeature>
    <geometricProperty typeName="center">
    <Point>
    <coordinates>29.0,41.0</coordinates>
    </Point>
    </geometricProperty>
    </geoFeature>
    </center>
    <themes>
    <theme name="AMAPCACHE" datasource="ADATASOURCE">
    <map_cache_theme map_cache_name="AMAPCACHE" snap_to_cache_scale="true"/> </theme> <theme name="AMAPCACHE" >
    <wfs_feature_request
    datasource="ADATASOURCE"
    />
    </theme>
    </themes>
    </map_request>
    The first theme is the one that i wanted to add.
    The second one (bold) is the one that causes trouble. I don't know where it comes from.
    This problem occured when i started to use mvclient.jar that came with patch 6453515 which changed MapViewer version from
    Ver10131_B06102 to Ver11_B07100.
    The old mvclient.jar (came with MapViewer Ver10131_B06102) produces the following xml request string:
    <?xml version="1.0" standalone="yes"?>
    <map_request
    datasource="ADATASOURCE"
    srid="8307"
    width="480"
    height="480"
    bgcolor="#a6caf0"
    antialiase="false"
    format="PNG_URL"
    >
    <center size="1.0">
    <geoFeature>
    <geometricProperty typeName="center">
    <Point>
    <coordinates>29.0,41.0</coordinates>
    </Point>
    </geometricProperty>
    </geoFeature>
    </center>
    <themes>
    <theme name="AMAPCACHE" datasource="ADATASOURCE">
    <map_cache_theme map_cache_name="AMAPCACHE" snap_to_cache_scale="true"/> </theme> </themes>
    </map_request>
    What might cause this problem?
    OS: Windows XP Pro SP2
    IDE: JDeveloper 10.1.3.1.0
    Thanks in advance,
    Cihan

    Hi Cihan,
    it is confirmed to be a bug with this client library and it will be fixed. Thanks.
    Joao

  • To format string like xml

    Hi,
    i have a string which has a xml content:
    String myXML = "<xml><test>Test</test></xml>";
    With log4j i produce a trace file with the output of String a: Log.info(myXML);
    Unfortunately the content of xml data is verly long and its difficult to read it.
    I would like to have the string to be xml formatted like:
    <xml>
    <test>Test</test>
    </xml>
    how to manage it?
    Thanks

    Your best bet might to be getting a 'tidy' program for xml. Most xml editors can very cleanly re-structure xml to collapsible nodes.
    Also you could try some proactive logging logic;
    after a closing tag, add a \n to return a new line, this will help most editors make it display nicely.

  • Convertion of String to XML node using Xquery transformation in OSB

    How to convert string to XML node elementusing a built in function using Xquery transformation in OSB?

    check this out - http://www.javamonamour.org/2011/06/fn-beainlinedxml.html
    if in SOA (BPEL & Mediator) you can use oraext:parseXML.
    you should thoroughly analyse where to implement your requirement as some good practices advise to implement more complex logic in SOA and leave OSB to only connect to the services' endpoints.
    Hope this helps,
    A.

  • Converting string to XML

    Dear All,
    I am using PI 7.1
    I am trying to invoke a third party SOAP API which accepts request in the form of a string which has embedded xml and also return a string which has xml embedded in it.
    To send the xml as string, I used the feature "Retun as XML" in mapping and it worked fine.
    But the response which has xml embedded, needs to be converted back to XML message.
    I understand that we can write parsers in java, ABAP and also do XSLT mapping.
    Just wanted to know that is there any "out of the box" feature to do the same.
    Please refrain from providing links to java mappings or xslt as I have gone through them already.
    regards,
    Piyush

    Hi Piyush,
                      All parsers will fail to parse the XML message you are getting. Since you are getting the following tag twice within the XMl
    "<?xml version="1.0"?>"
    This tag can be present in an document only once in begining of the document. First you need to remove this tag from appearing in source.
    Suppose you are able to do that then your XML structure will become something like this
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <ns1:AuthenticateResponse xmlns:ns1="urn:Login" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
    <return xsi:type="xsd:string"><MessageResponse sessionid=";jsessionid=FxZLTxtJnXJttpW6gMhJ06kyn00tfSgjt9ZwbzJ55CXGn92S8L6f!-444760742!1311845684753" status="SUCCESS" topicprefix="ND-DSK-117.CXL_HMEL_DB"><Entity name="REF_PERSON"><Property name="last_access_dt" value="20110728145937" type="DATE"/><Property name="modify_person_num" value="21" type="INTEGER"/><Property name="persontopic" value="350523952" type="STRING"/><Property name="login_result_ind" value="0" type="INTEGER"/><Property name="login_result_reason" value="" type="STRING"/><Property name="bypass_drafts" value="0" type="STRING"/><Property name="stl_check_swap_option_pricing_end" value="1" type="BOOLEAN"/><Property name="stl_update_provisional_cashflows" value="0" type="BOOLEAN"/><Property name="stl_autoinvoice_costs" value="1" type="BOOLEAN"/><Property name="stl_allow_payments_from_agents" value="0" type="BOOLEAN"/><Property name="stl_payment_allocation_at_invoice_detail_level" value="1" type="BOOLEAN"/><Property name="last_db_reloaded_on" value="" type="DATE"/><Property name="xl_mode_ind" value="0" type="INTEGER"/><Property name="Xchange_enabled" value="1" type="INTEGER"/><Property name="Xchange_server" value="XCHANGE" type="STRING"/><Property name="ipaddress" value="10.60.4.80" type="STRING"/><Property name="appname" value="CommodityXL" type="STRING"/><Property name="version" value="7.XL7.08.17E" type="STRING"/><Property name="econfirm.server.enabled" value="0" type="BOOLEAN"/></Entity></MessageResponse></return>
    </ns1:AuthenticateResponse>
    Then you can use the following java mapping code to remove the SOAP envelop.
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    public class RemoveSoapEnvelopSDN implements StreamTransformation{
    public void execute(InputStream in, OutputStream out)
    throws StreamTransformationException {
    try
         DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
         DocumentBuilder builderel=factory.newDocumentBuilder();
         /*input document in form of XML*/
         Document docIn=builderel.parse(in);
         /*document after parsing*/
         Document docOut=builderel.newDocument();
         TransformerFactory tf=TransformerFactory.newInstance();
         Transformer transform=tf.newTransformer();
         Element root;
         Node p;
         NodeList l;
         int mm,n1;
         //if you need to include namespace use next two lines
         //root=docOut.createElement("ns0:MessageResponse");
         //root.setAttribute("xmlns:ns0","http://connectsystems.be/MAINFR/AccDocument");
         root=docOut.createElement("MessageResponse");
         p=docIn.getElementsByTagName("MessageResponse").item(0);
         l=p.getChildNodes();
         n1=l.getLength();
         for(mm=0;mm<n1;++mm)
              Node temp=docOut.importNode(l.item(mm),true);
              root.appendChild(temp);
         docOut.appendChild(root);
         transform.transform(new DOMSource(docOut), new StreamResult(out));
    catch(Exception e)
         e.printStackTrace();
    public void setParameter(Map arg0) {
    public static void main(String[] args) {
    try{
         RemoveSoapEnvelopSDN genFormat=new RemoveSoapEnvelopSDN();
         FileInputStream in=new FileInputStream("C:\\Apps\\my folder\\sdn\\sdn6.xml");
         FileOutputStream out=new FileOutputStream("C:\\Apps\\my folder\\sdn\\removedEnvelopSdn6.xml");
         genFormat.execute(in,out);
    catch(Exception e)
    e.printStackTrace();
    You can add attributes to the tags as per your requirement. I have commnented those lines in the java code.
    The output will look like this
    http://postimage.org/image/2b2czww90/
    Hope this helps.
    Regards
    Anupam

  • Converting String To XML Format and send as attachment

    Hi
    My requirement is to convert String into XML Format and that XML File i have to send as an attachment
    can any one one give solution for this Problem.
    Thank you
    Venkatesh.K

    hi,
    i m filling the itab first and converting to xml
    itab contaning these data
    GS_PERSON-CUST_ID   = '3'.
    GS_PERSON-FIRSTNAME = 'Bill'.
    GS_PERSON-LASTNAME  = 'Gates'.
    APPEND GS_PERSON TO GT_PERSON.
    GS_PERSON-CUST_ID   = '4'.
    GS_PERSON-FIRSTNAME = 'Frodo'.
    GS_PERSON-LASTNAME  = 'Baggins'.
    APPEND GS_PERSON TO GT_PERSON.
    after conversion data is coming like that
    #<?xml version="1.0" encoding="utf-16"?>
    <CUSTOMERS>
      <item>
        <customer_id>0003</customer_id>
        <first_name>Bill</first_name>
        <last_name>Gates</last_name>
      </item>
      <item>
        <customer_id>0004</customer_id>
        <first_name>Frodo</first_name>
        <last_name>Baggins</last_name>
      </item>
    </CUSTOMERS>
    but errors are  1) # is coming at the first
                            2)for 'encoding="utf-16"?>', it is not coming perfectly, some other data (iso-8859-1) should come here
    can anybody plz solve it.
    regards,
    viki

  • Converting string to XML format

    Hi All,
    I have a requirement to convert string to xml format and download it. Atpresent, I have a string which is a collection of xml tags. I want to convert this string to xml format like <VALUE004>20387899.437</VALUE004>
    <VALUE005>20387899.437</VALUE005>
    <VALUE006>20387899.437</VALUE006>
    Is there any function module for this.

    Chk this thread.
    Re: Regd: File Conversion to XML format

  • Converting string to xml in xslt

    Hi we are trying to convert string to xml in xslt but it is getting errored out.
    We have followed the procedure mentioned at http://download.oracle.com/docs/cd/A91202_01/901_doc/appdev.901/a88894/adx04xsl.htm under the section "How Do I Convert A String to a Nodeset in XSL?".
    Standard procedure mentioned by oracle is not working. Is it a known bug?

    Chk this thread.
    Re: Regd: File Conversion to XML format

  • Strange problem in converting between XML to string and vice versa

    i have an application that needs to send an XML document
    over the wire. For this reason, I need to convert the
    doc into a String at the sending side and back to Doc
    at the receiving side. This document is stored in a "CLOB"
    column in a table in the database. I use XDK to retrieve
    this entire row (including the CLOB - hence this is an XML
    document which has a column that itself is an xml document in
    string format - this is just the clob read in by XDK).
    Thus the row looks like
    <ROWSET>
    <ROW>
    <col1> A <col1>
    <CLOB_COL> ..clob value of an xml doc..</CLOB_COL>
    </ROW>
    </ROWSET>
    When I convert this document into String and back, one of the "<"
    tags in the clob column document gets changed to "&lt;" and hence
    the parsing fails! I have used the latest label of the XDK build
    to get the latest parser jar but still i have the same problem.
    I am using the following routines for the conversion.
    /* for converting document to string */
    public static String convertToString(XMLDocument xml) throws
    IOException
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    xml.print(pw);
    String result = sw.toString();
    return result;
    /* for converting string to document */
    public static XMLDocument convertToXml(String xmlStr)
    throws
    IOException,SAXException
    ByteArrayInputStream inStream = new
    ByteArrayInputStream(xmlStr.getBytes());
    DOMParser parser = new DOMParser();
    parser.setPreserveWhitespace(false);
    parser.parse(inStream);
    return parser.getDocument();

    How do you get the XML document? Do you use XSU? You can use:
    String str = qry.getXMLString();
    to get the result XML document in String.
    XSU will escape all of the < and >. Or the the XML document in
    one of the column will make the result XML doc not well-formed.
    Not quite understand your problem. You can send me your test
    case.
    i have an application that needs to send an XML document
    over the wire. For this reason, I need to convert the
    doc into a String at the sending side and back to Doc
    at the receiving side. This document is stored in a "CLOB"
    column in a table in the database. I use XDK to retrieve
    this entire row (including the CLOB - hence this is an XML
    document which has a column that itself is an xml document in
    string format - this is just the clob read in by XDK).
    Thus the row looks like
    <ROWSET>
    <ROW>
    <col1> A <col1>
    <CLOB_COL> ..clob value of an xml doc..</CLOB_COL>
    </ROW>
    </ROWSET>
    When I convert this document into String and back, one of the "<"
    tags in the clob column document gets changed to "<" and hence
    the parsing fails! I have used the latest label of the XDK build
    to get the latest parser jar but still i have the same problem.
    I am using the following routines for the conversion.
    /* for converting document to string */
    public static String convertToString(XMLDocument xml) throws
    IOException
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    xml.print(pw);
    String result = sw.toString();
    return result;
    /* for converting string to document */
    public static XMLDocument convertToXml(String xmlStr)
    throws
    IOException,SAXException
    ByteArrayInputStream inStream = new
    ByteArrayInputStream(xmlStr.getBytes());
    DOMParser parser = new DOMParser();
    parser.setPreserveWhitespace(false);
    parser.parse(inStream);
    return parser.getDocument();

  • Converting Delimited string to XML message

    Hi,
    We are trying to convert pipe delimited string into a xml schema using a XSD and BPEL funtion. Consider a scenario in which message has 5 fields with last as 2 optional fields. So the incoming string message can be like "1|2|3" or "1|2|3|4|5". In this case how the XSD should look like, since for each field we have to give "terminatedby" option in the XSD. So the issue is coming for element 3 where the delimiter can be "|" or "eol" (end of line). How to specify that ? Is there any option to use like "optionally terminated by?"
    Any help will be appreciated.
    Thanks,
    Ramesh
    Edited by: rameshchandra85 on 2 Aug, 2010 10:00 AM

    Hi Ramesh,
    You can use below XSD for input file of kind
    1|2|3
    1|2|3|4|5
    1|2|3|4
    1|2|3|4|5|6
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
                targetNamespace="http://TargetNamespace.com/InboundService"
                xmlns:tns="http://TargetNamespace.com/InboundService"
                elementFormDefault="qualified"
                attributeFormDefault="unqualified" nxsd:encoding="ASCII" nxsd:stream="chars" nxsd:version="NXSD">
      <xsd:element name="Root-Element">
        <xsd:complexType>
          <xsd:choice minOccurs="1" maxOccurs="unbounded" nxsd:choiceCondition="terminated" nxsd:terminatedBy="|">
            <xsd:element name="RECORD1" nxsd:conditionValue="1">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="C2" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C3" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;">
                  </xsd:element>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
            <xsd:element name="RECORD2" nxsd:conditionValue="2">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="C2" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C3" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C4" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C5" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;">
                  </xsd:element>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
            <xsd:element name="RECORD3" nxsd:conditionValue="3">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="C2" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C3" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C4" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;">
                  </xsd:element>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
            <xsd:element name="RECORD4" nxsd:conditionValue="4">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="C2" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C3" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C4" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C5" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C6" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;">
                  </xsd:element>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
          </xsd:choice>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
    <!--NXSDWIZ:D:\DBIN\ReadFile.txt:-->
    <!--USE-HEADER:false:-->But in your case if you are getting 5 elements instead of 3 elements in some other file....Use the same and maipulate the last element afterwards.
    I think we can not have an element definition for two scenarios.
    Update you if i get any..
    Regards
    PavanKumar.M

  • Convert XML string into XML

    Hi All,
    Can you please let me know for any sample code in xslt/java mapping for converting XML string into XML. We use SAP Pi 7.0
    My XML string starts like this
    <?xml version="1.0" encoding="UTF-8" ?> 
    - <ns0:MT_ReceiverFileStructure <namespace>"><Output><?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<xsl>"?><Tarih_Date Tarih="11.09.2014" Date="09/11/2014>
       Thanks,
       Pavithra

    Thanks Praveen. It worked.
    However, the xml i have is an extract from a exchange rate URL and it has the reference to a xsl in it as below
    <?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<ABC.xsl>"?>.
    So there is an error in sxmb_moni. Is it possible to remove this.

  • How to convert a string-xml placed  inside an xml tag to xml format.

    I have a invoke activity to invoke Web service(code snippet from bpel) .The text in bold is a string that gets formed based on some condition using concat inside while loop .Before calling the WS i need to convert this string into xml
    Any idea how can we do this ?
    <Invoke_A9WS_createObject_InputVariable>
    <part name="parameters">
    <createObject>
    <request>
    <requests>
    <classIdentifier>10141</classIdentifier>
    <data rowId="0">*<number>C0001</number><description>Component from CDM</description>*</data>
    </requests>
    </request>
    </createObject>
    </part>
    </Invoke_A9WS_createObject_InputVariable>
    Request someone to please help .
    Edited by: 869283 on Jul 14, 2011 4:34 AM

    Thanks Dev for your reply ..I have tried using parsEscapedXML but it gives exception
    Fault ID     default/ProjReverseTransform!1.0*soa_6761b853-f458-4b1a-b9c3-6c060cde9350/transform/210018-BpAss3-BpSeq0.3-3
    Fault Time     Jul 15, 2011 1:23:42 PM
    Non Recoverable System Fault :
    <bpelFault><faultType>0</faultType><subLanguageExecutionFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is oraext:parseEscapedXML('&lt;?xml version="1.0"?>&lt;number xmlns:ns2="http://schemas.oracle.com/service/bpel/common&amp;quot;>C0001 &amp;lt;/number>&amp;lt;description xmlns:ns2=&amp;quot;http://schemas.oracle.com/service/bpel/common">Component from CDM &lt;description>'). The XPath expression failed to execute; the reason was: internal xpath error. Check the detailed root cause described in the exception message text and verify that the XPath query is correct. </summary></part><part name="code"><code>XPathExecutionError</code></part></subLanguageExecutionFault></bpelFault>
    I am using the assign activity as below
    <assign name="Assign_BpelVar">
    <copy>
    <from expression="oraext:parseEscapedXML('&lt;?xml version=&quot;1.0&quot;?>&lt;number xmlns:ns2=&quot;http://schemas.oracle.com/service/bpel/common&amp;quot;>C0001 &amp;lt;/number>&amp;lt;description xmlns:ns2=&amp;quot;http://schemas.oracle.com/service/bpel/common&quot;>Component from CDM &lt;description>')"/>
    <to variable="parameterVar"
    query="/ns2:parameters/ns2:item/ns2:value"/>
    </copy>
    </assign>
    I have harcoded the string here so as to check the working othersie this string gets formed inside a while loop and is stored in a variable.
    parameterVar is variable of type
    <variable name="parameterVar" element="ns2:parameters"/>
    XSD for parameterVar
    <?xml version= '1.0' encoding= 'UTF-8' ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://schemas.oracle.com/service/bpel/common"
    targetNamespace="http://schemas.oracle.com/service/bpel/common"
    elementFormDefault="qualified">
    <xsd:element name="parameters">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="item" minOccurs="1" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="name" type="xsd:string"/>
    <xsd:element name="value">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:any minOccurs="0"
    maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>

  • Convert string into XML inside BPEL

    Hello ,
    How to convert string into xml format ? And make element and define attribute inside it ??

    There are several problems with your input:
    1. Your xml is not well-formed because the attribute values should be enclosed withing double " quotes and not single ' quotes;
    2. You use a prefix (sml) for the folowing part but you dont define the namespace:
    <ids>
    <VID ID="new"/>
    <data>
    <*sml:*attr name="std">
    <sml:value></sml:value>
    </sml:attr>
    <sml:attr name="xde">
    <sml:value></sml:value>
    </sml:attr>
    </data>
    </ids>
    Complete message should be:
    <ids xmlns:sml="somenamespace">
    <VID ID="new"/>
    <data>
    <sml:attr name="std">
    <sml:value></sml:value>
    </sml:attr>
    <sml:attr name="xde">
    <sml:value></sml:value>
    </sml:attr>
    </data>
    </ids>
    3. Do you assign this expression to a variable that is based on the schema of your message you want to parse
    Regards,
    Melvin
    * TIP Answer the question as helpful or correct if it helps you , so that someone else will be knowing that this solution helped you or worked for you and also it gives points to the person who answers the question. *

Maybe you are looking for

  • Downloads for series

    I want to download my episodes in waiting in the itunes store but it's not allowing me. Error message say ( you can download past purchases on this computer with just one apple id every 90 days. You cannot associate this computer with a different app

  • Different Results from SQL-Query in Oracle 10.2 and  Oracle 11.2

    Look at the following example: CREATE TABLE GZP_PLAN (GZP_ID NUMBER(9) NOT NULL, PARENT_GZP_ID NUMBER(9), CONSTRAINT GZP_PLAN_PK1 PRIMARY KEY(GZP_ID) USING INDEX TABLESPACE USERS TABLESPACE USERS; insert into GZP_PLAN values(1,NULL); CREATE TABLE GZP

  • Setting the local/source port in SIP responses

    Oracle/Weblogic SIP server picks up 'random' local or source port when sending SIP responses. This is a problem for one of our load balancer. Can we make it use '5060' or some 'constant' port number instead of 'random' behavior ? Any help would be ap

  • How to rotate screen in airplay from iphone 5

    I have an iPhone 5 and want to use airplay to my Apple TV.  I figured out how to stream, but when I use the ABC TV app to stream to Apple TV the picture is in the vertical position showing the show sideways.  There is no airplay button when streaming

  • How do I place a navigation menu over a slidehow?

    Hi, I want to have a blank compsition widget with scrolling images at the top of my homepage and the navigation to sit over the top of it. When I place the menu items over the image it looks fine until the gallery moves to the next image and the navi