How to typecast string to xml DOM element in java

hai
      i need a string to be converted to xml DOM element in java, can any help me
      i have done in this way
     NodeList children = lParentRule.getElementsByTagName("parentruledetails").item(0).getChildNodes();
for  
(int i = 0; i < children.getLength(); i++) {Node nod = children.item(i);
if  
(nod.getNodeName().contains("parentcustomdetails")){Element parentcustom = (Element)nod.getNodeName();   // i get typecast error at this line}
i need to convert the string to element
can any one help me
Thanks in Advance

Hello. You can't cast a string to an element, you need to create that element.
Maybe this can help up: http://www.genedavis.com/library/xml/java_dom_xml_creation.jsp

Similar Messages

  • Method invokeMethod(java.lang.String, org.w3c.dom.Element) not found

    I am calling a Web Service that returns an XML-file. The XML-file should be passed to a method that puts the xml into a table in my database.
    I will upload the 3 files that are being used for this.
    When I rebuild my files I get the following error in CustomerCO.java:
    Error(78,38): method invokeMethod(java.lang.String, org.w3c.dom.Element) not found in interface oracle.apps.fnd.framework.OAApplicationModule
    Line 78 reads as follows:
    String Status = (String)am.invokeMethod("initSaveXml", wsXml);
    Any suggestions?
    PS: I am a newbie to java and framework :-(
    Here are my files:
    CustomerCO.java:
    /*===========================================================================+
    | Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA |
    | All rights reserved. |
    +===========================================================================+
    | HISTORY |
    +===========================================================================*/
    package xxcu.oracle.apps.ar.customer.server.webui;
    import java.io.Serializable;
    import java.lang.Exception;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import org.w3c.dom.Element;
    import xxcu.oracle.apps.ar.customer.ws.LindorffWS;
    * Controller for ...
    public class CustomerCO extends OAControllerImpl implements Serializable
    public static final String RCS_ID="$Header$";
    public static final boolean RCS_ID_RECORDED =
    VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    * Layout and page setup logic for a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    * 2009.07.09, Roy Feirud, lagt til for å utføre spørring
    if (pageContext.getParameter("Search") != null)
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    //Setter søkekriteriene til LindorffWS
    String Name = pageContext.getParameter("SearchName");
    String Address = pageContext.getParameter("SearchAddress");
    String Zip = pageContext.getParameter("SearchZipCode");
    String City = pageContext.getParameter("SearchCity");
    String Born = pageContext.getParameter("SearchBorn");
    String Phone = pageContext.getParameter("SearchPhoneNo");
    Serializable[] param = { Name, Address, Zip, City, Born, Phone };
    //Bygger søkestrengen
    String SearchString = (String)am.invokeMethod("initBuildString", param );
    //Initialiserer LindorffWS
    LindorffWS WsConnection = new LindorffWS();
    try
    //Kaller Web Sevice fra Lindorff
    Element wsXml = (Element)WsConnection.XmlFulltextOperator(SearchString);
    String Status = (String)am.invokeMethod("initSaveXml", wsXml);
    catch(Exception WsExp)
    // WsConnection = new LindorffWS();
    System.out.println("Kall til LindorffWS feilet!");
    am.invokeMethod("initQueryCustomer");
    CustomerAMImpl.java:
    package xxcu.oracle.apps.ar.customer.server;
    import java.io.Serializable;
    import java.sql.CallableStatement;
    import java.sql.SQLException;
    import java.sql.Types;
    import oracle.apps.fnd.common.MessageToken;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
    import oracle.apps.fnd.framework.server.OADBTransaction;
    import oracle.apps.fnd.framework.server.OAExceptionUtils;
    import org.w3c.dom.Element;
    // --- File generated by Oracle Business Components for Java.
    public class CustomerAMImpl extends OAApplicationModuleImpl implements Serializable
    * This is the default constructor (do not remove)
    public CustomerAMImpl()
    * Sample main for debugging Business Components code using the tester.
    public static void main(String[] args)
    launchTester("xxcu.oracle.apps.ar.customer.server", "CustomerAMLocal");
    * Container's getter for CustomerVO1
    public CustomerVOImpl getCustomerVO1()
    return (CustomerVOImpl)findViewObject("CustomerVO1");
    * 2009.07.09, Roy Feirud, Lagt til for å utføre spørring.
    public void initQueryCustomer()
    CustomerVOImpl vo = getCustomerVO1();
    if (vo!=null)
    vo.initQuery();
    * 2009.08.31, Roy Feirud, Lagt til for å bygge opp input til WebService hos Lindorff.
    public String initBuildString(String Name
    ,String Address
    ,String Zip
    ,String City
    ,String Born
    ,String Phone)
    String ws_string = null;
    CallableStatement cs = null;
    try
    String sql= "BEGIN ISS_WS_LINDORFF_PKG.BUILD_STRING (?,?,?,?,?,?,?); END;";
    OADBTransaction txn = getOADBTransaction();
    cs = txn.createCallableStatement(sql,1);
    cs.setString(1,Name);
    cs.setString(2,Address);
    cs.setString(3,Zip);
    cs.setString(4,City);
    cs.setString(5,Born);
    cs.setString(6,Phone);
    cs.registerOutParameter(7,Types.VARCHAR);
    cs.execute();
    OAExceptionUtils.checkErrors (txn);
    ws_string = cs.getString(7);
    cs.close();
    catch (SQLException sqle)
    String Prosedyre = "ISS_WS_LINDORFF_PKG.BUILD_STRING";
    String Errmsg = sqle.toString();
    MessageToken[] tokens = {new MessageToken("PROSEDYRE", Prosedyre), new MessageToken("ERRMSG", Errmsg)};
    throw new OAException("ISS", "ISS_PLSQL_ERROR",tokens,OAException.ERROR, null);
    return ws_string;
    public String initSaveXml(Element WsXml)
    String Status = "Error";
    CallableStatement cs = null;
    try
    String sql= "BEGIN ISS_XML2TABLE_PKG.ISS_AR_CUSTOMERS_TMP (?,?); END;";
    OADBTransaction txn = getOADBTransaction();
    cs = txn.createCallableStatement(sql,1);
    cs.setObject(1,WsXml);
    cs.registerOutParameter(2,Types.VARCHAR);
    cs.execute();
    OAExceptionUtils.checkErrors (txn);
    Status = cs.getString(2);
    cs.close();
    catch (SQLException sqle)
    String Prosedyre = "ISS_XML2TABLE_PKG.ISS_AR_CUSTOMERS_TMP";
    String Errmsg = sqle.toString();
    MessageToken[] tokens = {new MessageToken("PROSEDYRE", Prosedyre), new MessageToken("ERRMSG", Errmsg)};
    throw new OAException("ISS", "ISS_PLSQL_ERROR",tokens,OAException.ERROR, null);
    return Status;
    LindorffWS.java:
    package xxcu.oracle.apps.ar.customer.ws;
    import oracle.soap.transport.http.OracleSOAPHTTPConnection;
    //import org.apache.soap.encoding.soapenc.BeanSerializer;
    import org.apache.soap.encoding.SOAPMappingRegistry;
    //import org.apache.soap.util.xml.QName;
    import java.util.Vector;
    import org.w3c.dom.Element;
    import java.net.URL;
    import org.apache.soap.Body;
    import org.apache.soap.Envelope;
    import org.apache.soap.messaging.Message;
    import oracle.jdeveloper.webservices.runtime.WrappedDocLiteralStub;
    * Generated by the Oracle9i JDeveloper Web Services Stub/Skeleton Generator.
    * Date Created: Fri Jul 10 10:37:21 CEST 2009
    * WSDL URL: http://services.lindorffmatch.com/Search/Search.asmx?WSDL
    public class LindorffWS extends WrappedDocLiteralStub
    public LindorffWS()
    m_httpConnection = new OracleSOAPHTTPConnection();
    public String endpoint = "http://services.lindorffmatch.com/Search/Search.asmx";
    private OracleSOAPHTTPConnection m_httpConnection = null;
    private SOAPMappingRegistry m_smr = null;
    public Element XmlFulltextOperator(String xmlString) throws Exception
    URL endpointURL = new URL(endpoint);
    Envelope requestEnv = new Envelope();
    Body requestBody = new Body();
    Vector requestBodyEntries = new Vector();
    String wrappingName = "XmlFulltextOperator";
    String targetNamespace = "http://services.lindorffmatch.com/search";
    Vector requestData = new Vector();
    requestData.add(new Object[] {"xmlString", xmlString});
    requestBodyEntries.addElement(toElement(wrappingName, targetNamespace, requestData));
    requestBody.setBodyEntries(requestBodyEntries);
    requestEnv.setBody(requestBody);
    Message msg = new Message();
    msg.setSOAPTransport(m_httpConnection);
    msg.send(endpointURL, "http://services.lindorffmatch.com/search/XmlFulltextOperator", requestEnv);
    Envelope responseEnv = msg.receiveEnvelope();
    Body responseBody = responseEnv.getBody();
    Vector responseData = responseBody.getBodyEntries();
    return (Element)fromElement((Element)responseData.elementAt(0), org.w3c.dom.Element.class);
    _______________________________________________________________________________________________________________________________

    Hi,
    Create an Interface to your application Module then from interface call your method,
    refer http://www.oraclearea51.com/oracle-technical-articles/oa-framework/oa-framework-beginners-guide/213-how-to-call-am-methods-from-controller-without-using-invokemethod.html for creating Interface for AM and calling it in controller.
    Regards,
    Reetesh Sharma

  • Jdev: method invokeMethod(java.lang.String, org.w3c.dom.Element) not found

    I am calling a Web Service that returns an XML-file. The XML-file should be passed to a method that puts the xml into a table in my database.
    I will upload the 3 files that are being used for this.
    When I rebuild my files I get the following error in CustomerCO.java:
    Error(78,38): method invokeMethod(java.lang.String, org.w3c.dom.Element) not found in interface oracle.apps.fnd.framework.OAApplicationModule
    Line 78 reads as follows:
    String Status = (String)am.invokeMethod("initSaveXml", wsXml);
    Any suggestions?
    PS: I am a newbie to java and framework
    Here are my files:
    CustomerCO.java:
    /*===========================================================================+
    Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA
    All rights reserved.
    ===========================================================================
    HISTORY
    +===========================================================================*/
    package xxcu.oracle.apps.ar.customer.server.webui;
    import java.io.Serializable;
    import java.lang.Exception;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import org.w3c.dom.Element;
    import xxcu.oracle.apps.ar.customer.ws.LindorffWS;
    * Controller for ...
    public class CustomerCO extends OAControllerImpl implements Serializable
    public static final String RCS_ID="$Header$";
    public static final boolean RCS_ID_RECORDED =
    VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    * Layout and page setup logic for a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    * 2009.07.09, Roy Feirud, lagt til for å utføre spørring
    if (pageContext.getParameter("Search") != null)
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    //Setter søkekriteriene til LindorffWS
    String Name = pageContext.getParameter("SearchName");
    String Address = pageContext.getParameter("SearchAddress");
    String Zip = pageContext.getParameter("SearchZipCode");
    String City = pageContext.getParameter("SearchCity");
    String Born = pageContext.getParameter("SearchBorn");
    String Phone = pageContext.getParameter("SearchPhoneNo");
    Serializable[] param = { Name, Address, Zip, City, Born, Phone };
    //Bygger søkestrengen
    String SearchString = (String)am.invokeMethod("initBuildString", param );
    //Initialiserer LindorffWS
    LindorffWS WsConnection = new LindorffWS();
    try
    //Kaller Web Sevice fra Lindorff
    Element wsXml = (Element)WsConnection.XmlFulltextOperator(SearchString);
    String Status = (String)am.invokeMethod("initSaveXml", wsXml);
    catch(Exception WsExp)
    // WsConnection = new LindorffWS();
    System.out.println("Kall til LindorffWS feilet!");
    am.invokeMethod("initQueryCustomer");
    CustomerAMImpl.java:
    package xxcu.oracle.apps.ar.customer.server;
    import java.io.Serializable;
    import java.sql.CallableStatement;
    import java.sql.SQLException;
    import java.sql.Types;
    import oracle.apps.fnd.common.MessageToken;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
    import oracle.apps.fnd.framework.server.OADBTransaction;
    import oracle.apps.fnd.framework.server.OAExceptionUtils;
    import org.w3c.dom.Element;
    // --- File generated by Oracle Business Components for Java.
    public class CustomerAMImpl extends OAApplicationModuleImpl implements Serializable
    * This is the default constructor (do not remove)
    public CustomerAMImpl()
    * Sample main for debugging Business Components code using the tester.
    public static void main(String[] args)
    launchTester("xxcu.oracle.apps.ar.customer.server", "CustomerAMLocal");
    * Container's getter for CustomerVO1
    public CustomerVOImpl getCustomerVO1()
    return (CustomerVOImpl)findViewObject("CustomerVO1");
    * 2009.07.09, Roy Feirud, Lagt til for å utføre spørring.
    public void initQueryCustomer()
    CustomerVOImpl vo = getCustomerVO1();
    if (vo!=null)
    vo.initQuery();
    * 2009.08.31, Roy Feirud, Lagt til for å bygge opp input til WebService hos Lindorff.
    public String initBuildString(String Name
    ,String Address
    ,String Zip
    ,String City
    ,String Born
    ,String Phone)
    String ws_string = null;
    CallableStatement cs = null;
    try
    String sql= "BEGIN ISS_WS_LINDORFF_PKG.BUILD_STRING (?,?,?,?,?,?,?); END;";
    OADBTransaction txn = getOADBTransaction();
    cs = txn.createCallableStatement(sql,1);
    cs.setString(1,Name);
    cs.setString(2,Address);
    cs.setString(3,Zip);
    cs.setString(4,City);
    cs.setString(5,Born);
    cs.setString(6,Phone);
    cs.registerOutParameter(7,Types.VARCHAR);
    cs.execute();
    OAExceptionUtils.checkErrors (txn);
    ws_string = cs.getString(7);
    cs.close();
    catch (SQLException sqle)
    String Prosedyre = "ISS_WS_LINDORFF_PKG.BUILD_STRING";
    String Errmsg = sqle.toString();
    MessageToken[] tokens = {new MessageToken("PROSEDYRE", Prosedyre), new MessageToken("ERRMSG", Errmsg)};
    throw new OAException("ISS", "ISS_PLSQL_ERROR",tokens,OAException.ERROR, null);
    return ws_string;
    public String initSaveXml(Element WsXml)
    String Status = "Error";
    CallableStatement cs = null;
    try
    String sql= "BEGIN ISS_XML2TABLE_PKG.ISS_AR_CUSTOMERS_TMP (?,?); END;";
    OADBTransaction txn = getOADBTransaction();
    cs = txn.createCallableStatement(sql,1);
    cs.setObject(1,WsXml);
    cs.registerOutParameter(2,Types.VARCHAR);
    cs.execute();
    OAExceptionUtils.checkErrors (txn);
    Status = cs.getString(2);
    cs.close();
    catch (SQLException sqle)
    String Prosedyre = "ISS_XML2TABLE_PKG.ISS_AR_CUSTOMERS_TMP";
    String Errmsg = sqle.toString();
    MessageToken[] tokens = {new MessageToken("PROSEDYRE", Prosedyre), new MessageToken("ERRMSG", Errmsg)};
    throw new OAException("ISS", "ISS_PLSQL_ERROR",tokens,OAException.ERROR, null);
    return Status;
    LindorffWS.java:
    package xxcu.oracle.apps.ar.customer.ws;
    import oracle.soap.transport.http.OracleSOAPHTTPConnection;
    //import org.apache.soap.encoding.soapenc.BeanSerializer;
    import org.apache.soap.encoding.SOAPMappingRegistry;
    //import org.apache.soap.util.xml.QName;
    import java.util.Vector;
    import org.w3c.dom.Element;
    import java.net.URL;
    import org.apache.soap.Body;
    import org.apache.soap.Envelope;
    import org.apache.soap.messaging.Message;
    import oracle.jdeveloper.webservices.runtime.WrappedDocLiteralStub;
    * Generated by the Oracle9i JDeveloper Web Services Stub/Skeleton Generator.
    * Date Created: Fri Jul 10 10:37:21 CEST 2009
    * WSDL URL: http://services.lindorffmatch.com/Search/Search.asmx?WSDL
    public class LindorffWS extends WrappedDocLiteralStub
    public LindorffWS()
    m_httpConnection = new OracleSOAPHTTPConnection();
    public String endpoint = "http://services.lindorffmatch.com/Search/Search.asmx";
    private OracleSOAPHTTPConnection m_httpConnection = null;
    private SOAPMappingRegistry m_smr = null;
    public Element XmlFulltextOperator(String xmlString) throws Exception
    URL endpointURL = new URL(endpoint);
    Envelope requestEnv = new Envelope();
    Body requestBody = new Body();
    Vector requestBodyEntries = new Vector();
    String wrappingName = "XmlFulltextOperator";
    String targetNamespace = "http://services.lindorffmatch.com/search";
    Vector requestData = new Vector();
    requestData.add(new Object[] {"xmlString", xmlString});
    requestBodyEntries.addElement(toElement(wrappingName, targetNamespace, requestData));
    requestBody.setBodyEntries(requestBodyEntries);
    requestEnv.setBody(requestBody);
    Message msg = new Message();
    msg.setSOAPTransport(m_httpConnection);
    msg.send(endpointURL, "http://services.lindorffmatch.com/search/XmlFulltextOperator", requestEnv);
    Envelope responseEnv = msg.receiveEnvelope();
    Body responseBody = responseEnv.getBody();
    Vector responseData = responseBody.getBodyEntries();
    return (Element)fromElement((Element)responseData.elementAt(0), org.w3c.dom.Element.class);
    _______________________________________________________________________________________________________________________________

    Hi,
    wrong forum. If this is a problem related to the use of OA framework, please use the OA framework forum here on OTN
    Frank

  • How to display string with XML content in 4.6?

    Hi,
    I`d like to know how to display string with XML content in it for 4.6.
    4.6 has not method parse_string.
    And example like this is not helpful:
      DATA: lo_mxml    TYPE REF TO cl_xml_document.
      CREATE OBJECT lo_mxml.
      CALL METHOD lo_mxml->parse_string
        EXPORTING
          stream = gv_xml_string.
      CALL METHOD lo_mxml->display.
    Thank you.

    Hi,
    May be you can use fm SAP_CONVERT_TO_XML_FORMAT. But it have some issues with memory usage, the program consumed tons of memory during convert.

  • How to SAVE a updated XML DOM Data to the file?

    Hi
    I am able to load an XML file into a XML DOM object using JAVA (xerces). I have update the required data in the DOM.
    But I am NOT able to save back the data to the physical file.
    Will appreciate if you can help me ASAP.

    Hi Krishar,
    Check out the jaxp new release on java.sun.com. This api has classes and methods to help you do the same.
    sample code:
         try
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              java.net.URL url = this.getClass().getResource(XML_FILE);
              java.io.File thsFile = new java.io.File(url.getFile());
              DocumentBuilder builder = factory.newDocumentBuilder();
              TransformerFactory tFactory = TransformerFactory.newInstance();
              Transformer transformer = tFactory.newTransformer();
              document = builder.parse(thsFile);
    //You can do any modification to the document here
              DOMSource source = new DOMSource(document);
              StreamResult result = new StreamResult(thsFile);
              transformer.transform(source, result);
         catch (TransformerConfigurationException tce)
              System.out.println("\n** Transformer Factory error");
              System.out.println(" " + tce.getMessage());
              Throwable x = tce;
              if (tce.getException() != null)
                   x = tce.getException();
              x.printStackTrace();
         catch (TransformerException te)
              System.out.println("\n** Transformation error in add:");
              System.out.println(" " + te.getMessage());
              Throwable x = te;
              if (te.getException() != null)
                   x = te.getException();
              x.printStackTrace();
         catch (SAXException sxe)
              System.out.println("sax exp" + sxe.getMessage());
         catch (Exception ex)
              System.out.println("exc exp" + ex);
              ex.printStackTrace();
    Hope this will help you XML_FILE is constant representing the path of the file. It should be in classpath. The program essentially parsing a xml file and creating dom document and then writing it back to the same file. you can do any modifications/write to other file etc...
    Think this will suffice your requirement
    bye
    take care
    Hi
    I am able to load an XML file into a XML DOM object
    using JAVA (xerces). I have update the required data
    in the DOM.
    But I am NOT able to save back the data to the
    physical file.
    Will appreciate if you can help me ASAP.

  • How to save and retrive XML DOM to/from SQLServer

    Hi, there,
    I am new to JAVA, and now I'm trying to save a large XML DOM to SQLServer, and retrive it as a XML DOM later. Would someone please let me know how can I do it?
    Thanks!
    ----YM

    You would be better looking at the XML DOM documentation for your database rather than asking here. If your DB doesn't provide XML facilities, then there are products and techniques that can be applied to map XML to SQL, and you can always serialize the java objects into a blob, but XML to SQL mapping isn't standardized, so the first call is the server's documentation.

  • XML DOM working in Java, not working in Tomcat

    This is a really strange one (to me anyway) !
    We have some XML parsing classes tested in Eclipse that run just fine as Java code. When we try to use them in Tomcat, though, we get an error with getDocumentElement() - it always truncates at the beginning of the XML. This is the XML string we are using for testing in Eclipse:
    "<rft><pollcfg><tmo>200</tmo><retry>5</retry>"
    + "<mapping>"
    + "<name>Simulation</name>"
    + "<subnet>0</subnet>"
    + "<comm>com8</comm>"
    + "</mapping>"
    + "<comm>com11</comm>"
    + "<comm>com12</comm>"
    + "<subnet>1</subnet>"
    + "<subnet>2</subnet>"
    + "<subnet>3</subnet>"
    + "<subnet>4</subnet>"
    + "</rft>";
    And we load this string into a DOM as follows
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setValidating(false);
    dbf.setNamespaceAware(true);
    dbf.setIgnoringElementContentWhitespace(true);
    DocumentBuilder builder = dbf.newDocumentBuilder();
    ByteArrayInputStream bais = new ByteArrayInputStream(XMLRetrievedData.getBytes());
    doc = builder.parse(bais);
    ANd then we can say :
    System.out.println( "getDocumentElement() was " + doc.getDocumentElement() );
    and we get the XML.
    If we run this in Tomcat the line
    System.out.println( "getDocumentElement() was " + doc.getDocumentElement() );
    produces
    [rft: null]
    instead of the XML we get when we run the same code in Eclipse !!
    We want to parse the DOM, delete some elements and add some new elements. Then we want to return the altered DOM as a String .. for whatever client needs it.
    Any ideas about this ? What could be wrong ?
    Thanks !!

    Beg pardon - I should have said we are loading the XML string shown into the String XMLRetrievedData. That's how the 'rft' part of the [rft: null] gets into Tomcat's output.
    Strange ...

  • Issue in Conversion of String to XML (xsd) elements.

    Hi All,
    Please help in resolving the below issue.Please help me ASAP
    I am getting a strng value from Db adapter String= Mike,3453,USA
    I need to convert the data into xml by using below xsd.
    <?xml version="1.0" encoding='UTF-8' ?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.uss.com/htr/IHCM204/MainRec"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
    xmlns:tns="http://www.uss.com/htr/IHCM204/MainRec"
    attributeFormDefault="unqualified" nxsd:version="NXSD"
    nxsd:stream="chars" nxsd:encoding="US-ASCII">
    <element name="MainOutput">
    <complexType>
    <sequence>
    <element name="Target" maxOccurs="unbounded">
    <complexType>
    <sequence>
    <element name="name" type="string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <element name="sal" type="string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <element name="add" type="string" nxsd:style="terminated" nxsd:terminatedBy="," />
    </sequence>
    </complexType>
    </element>
    </sequence>
    </complexType>
    </element>
    </schema>
    Regards,
    Ana

    Say, for Example
    If you are getting response from db adapter as abc,def,ghi then use an transform activity to split the string.
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
    <xsl:template match="/">
    <ns:StringParsing>
    <ns:Name>
    <xsl:value-of select='substring(/ns:simpleelement/ns:dbString,1.0, oraext:last-index-within-string(/ns:simpleelement/ns:dbString,",") + 0.0)'/>
    </ns:Name>
    <ns:Address>
    <xsl:value-of select='substring(/ns:simpleelement/ns:dbString,oraext:last-index-within-string(/ns:simpleelement/ns:dbString,",") + 2.0)'/>
    </ns:Address>
    </ns:StringParsing>
    </xsl:template>
    </xsl:stylesheet>
    Let me know if it helps you.
    Edited by: BK574 on May 14, 2013 11:31 AM
    Edited by: BK574 on May 14, 2013 11:55 AM
    Edited by: BK574 on May 14, 2013 12:48 PM

  • How to insert Serialised Object(XML DOM) into Oracle Table(as BLOB or CLOB)

    we need a urgent help. How can we insert and retrieve the XML Document DOM Object into Oracle Table.Actually we used BLOB for insert the DOM Object,its inserted finely but we have a problem in retrieving that object, we got error when v're retrieving. so could you anyone tell us what's this exact problem and how can we reslove this problem If anyone knows or used this kind operation, pls let us know immediately.
    Thanks in advance.

    Please repost your question in the appropriate XML forum, http://forums.oracle.com/forums/index.jsp?cat=51

  • How to load data from XML DOM into tables using Business Components

    <p>
    Hi,
    </p>
    <p>
    I need to upload XML file (it&#39;s not a problem) an load data (DOM tree) from this file into relationan tables. This filelooks like this:
    </p>
    <p>
    <font face="courier new,courier" size="2">&lt;Departments&gt;
       &lt;Department&gt;
          &lt;DepartmentName&gt;OPERATIONS&lt;/DepartmentName&gt;
          &lt;Localization&gt;BOSTON&lt;/Localization&gt;
          &lt;Employees&gt;
             &lt;Employee&gt;
                &lt;LastName&gt;TURNER&lt;/LastName&gt;
                &lt;Job&gt;SALESMAN&lt;/Job&gt;
                &lt;Manager&gt;7698&lt;/Manager&gt;
                &lt;HireDate&gt;1981-09-08&lt;/HireDate&gt;
                &lt;Salary&gt;1500&lt;/Salary&gt;
                &lt;Commerce&gt;0&lt;/Commerce&gt;
             &lt;/Employee&gt;
          &lt;/Employees&gt;
       &lt;/Department&gt;
    &lt;/Departments&gt;</font>
    </p>
    <p>
    Is there any Business Components support to obtain this ? What about primary and foreign keys values (there is no in XML file). How to place this XML data in appropriate tables ?
    </p>
    <p>
    Kuba 
    </p>

    Pl post details of exact OS and database versions, along with a sample of the XML file and description of the tables. What have you tried so far ?
    http://docs.oracle.com/cd/E11882_01/server.112/e22490/ldr_control_file.htm#i1005614
    HTH
    Srini

  • How can I import an XML DOM document into another?

    Dear all,
    I'm using the following bit of code:
         public static Node replaceNode(Document replacedDocument,
                        Document replacingDocument,
                        Node replacedNode)
         //Create a documentFragment of the replacingDocument
         DocumentFragment docFrag = replacingDocument.createDocumentFragment();
         Element rootElement = replacingDocument.getDocumentElement();
         docFrag.appendChild(rootElement);     
         //Import docFrag under the ownership of replacedDocument
         Node replacingNode =
         ((replacedDocument).importNode(docFrag, true));
              //In order to replace the node need to retrieve replacedNode's parent
         Node replaceNodeParent = replacedNode.getParentNode();
         replaceNodeParent.replaceChild(replacingNode, replacedNode);
         return replacedDocument;
    to import a DOM document into another DOM document, so that it converts something like this:
    <?xml= .... etc>
    <Data></Data
    to:
    <?xml= .... etc>
    <Data>
    <Yellow>Butter</Yellow>
    <White>Marzipan</White>
    </Data>
    Instead, what it is doing is:
    <?xml= .... etc>
    <Yellow>Butter</Yellow>
    <White>Marzipan</White>
    I know that it is stripping out the <Data> elements because of the call to the replaceChild
    function, after getting the element's parent, but if I change
    Node replaceNodeParent = replacedNode.getParentNode();
    to
    Node replaceNodeParent = replacedNode;
    I get an error about node node being accessible.
    Please help!
    Paul

    http://forum.java.sun.com/thread.jsp?forum=34&thread=208596

  • How to display string which has BSP elements correctly?

    Hi,
       I have a string variable lv_text which content is:
    <htmlb:group height = "100%"
                         width  = "100%" >
              <htmlb:groupHeader>
                <xhtmlb:toolbar id="toolbar1" >
                  <xhtmlb:toolbarItem placement="LEFT" >
                    <htmlb:textView design = "HEADER3"
                                    text   = "AAAA"/>
                  </xhtmlb:toolbarItem>
                </xhtmlb:toolbar>
              </htmlb:groupHeader>
              <htmlb:groupBody>
                <%
      if gv_if_dis_message = 'X'.
                %>
                <%@include file="message.htm" %>
                <%
      Endif.
                %>
              </htmlb:groupBody>
            </htmlb:group>
        I want to use it in my BSP page and display the content correctly. Because it has some BSP elements, so now it can not be displayed correctly. How to solve this problem?
        Thanks a lot!

    you cannot do this way. what you can do is call the factory method of the htmlb:<tab> to get the element and render the element to a string and you can now use this string in your bsp page.
    Regards
    Raja

  • How to compare two huge xml files(50MB+) using Java Code

    I want to compare two huge xml files using java code and need to find the difference of those xml files
    is there any API for that

    You should find third party API

  • String to xml object java

    Hello,
    can anyone suggest me how to convert string to xml object in java?
    I have a string (Data) ant now I have to pass it as parameter as xml object, which structure should be:
    <MGWData>Data</MGWData>
    Where I surf I always see only solutions for converting string to xml document, but never to xml object.
    maybe the problem is I don't completely understand what xml object is in first place :/
    Any answer would help.
    Thanks.

    894871 wrote:
    here is the method to call:
    +/**+
    * Sets the p_DATAXMLTYPEIN value for this SVARCHAR2INSERT_RECEIVESInput.
    *+
    * @param p_DATAXMLTYPEIN
    *public void setP_DATAXMLTYPEIN(com.oracle.xmlns.orawsv.SISTEMA_MOKA.MGW_PUBLIC_FUNCTIONS.SVARCHAR2INSERT_RECEIVESInputP_DATAXMLTYPEIN p_DATAXMLTYPEIN) {*
    this.p_DATAXMLTYPEIN = p_DATAXMLTYPEIN;
    one of the classes contains:
    *public class SVARCHAR2INSERT_RECEIVESInputP_DATAXMLTYPEIN  implements java.io.Serializable, org.apache.axis.encoding.AnyContentType {*
    *private org.apache.axis.message.MessageElement [] _any;*
    this method and some classes where generated using eclipse and wsdl file by creating web service client.
    wsdl says for that part: *<xsd:element name="P_DATA-XMLTYPE-IN">*
    So I suppose it should involve smth org.apache.axis.message.MessageElement. But when I create any type of parameter, it gives me error:
    + ....cannot be cast to com.oracle.xmlns.orawsv.SISTEMA_MOKA.MGW_PUBLIC_FUNCTIONS.SVARCHAR2INSERT_RECEIVESInputP_DATAXMLTYPEIN+
    I am new in web service stuff so thank you for response.Can you explain in plain English what you are trying to do? Or provide a [url http://sscce.org/]SSCE.

  • 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

  • Use of Netflex

    Why, doesn't HP furnish a button for Netflex in HP MediaSmart?????

  • Memory leak after upgrading to ColdFusion 10

    We recently upgraded from CF8 to CF10 and we're running into some issues.  We started off getting a lot of OutOfMemory errors with the default heap settings. Chaning them to 768MB/1280MB which has helped, but we're still running into occasional OOM i

  • Flash Action Happening Too Early

    I'm attempting to have a flash video file play before loading a web site. The way I'm doing it is to import an FLV video that I created in AE, into Flash, set the frame rate of the Flash to that of the (video 24fps) and add an action at frame 241 whi

  • Netflix still doesn't work

    I get message on netflix that it cannot comunicate, and download movie, eventhough it has downloaded my list of instant movies.

  • Reimport VOB files

    Hallo, I just wonder if the following makes sense and doesn't make any problems: I create a slideshow, because with in the timeline editor I cannot perform pan, zoom or blend on still images. I want to add different soundtracks for different language