Convert Doucment object to Dom Node object?

I want to transform the Dom tree using xslt, but I want to transform it without saving it to a xml file, how can I do it?
I got the data from a database and saved it into a document object(doc). then I tried to achieve that using the following code:
doc = .....
try {
Transformer transformer = TransformerFactory.newInstance........
Source source = new DOMSource((Node)doc);
StreamResult r = new StreamResult(output);
transformer.transform(source,r);
}catch........
when I run the jsp page, it catch a cast class exception, obviously I cannot convert doc using "(Node)doc", can someone help pls?

when I run the jsp page, it catch a cast class
exception, obviously I cannot convert doc using
"(Node)doc", can someone help pls?It's certainly not obvious to me why you can't do it. And you deliberately omitted the code that assigns a value to that variable, so it's impossible to tell what it is.

Similar Messages

  • How to initialize a org.w3c.dom.Node object?

    Hello,
    I want to initialize an org.w3c.dom.Node object with an empty Node.
    How could I do that?
    Thanks
    Sylvain

    I want to create a Document.
    If I test your line, this error appears:
    "Default constructor cannot handle exception type javax.xml.parsers.ParserConfigurationException thrown by implicit super constructor. Must define an explicit constructor."
    Do you know what's happen?
    Thanks
    Sylvain

  • How do i convert an object into a string?

    has said above, im trying to convert a object to a string.
    here is what i ahve so far:
    Object nodeInfo = node.getUserObject()

    RTFM
    Object o =...
    String str = o.toString();

  • How can i convert an object to stream of chars or bytes?

    how can i convert an object to stream of chars or bytes?

    One way is the serialization mechanism. There are examples and explanations of it in the Java tutorial: http://java.sun.com/docs/books/tutorial/essential/io/serialization.html

  • How can I convert table object into table record format?

    I need to write a store procedure to convert table object into table record. The stored procedure will have a table object IN and then pass the data into another stored procedure with a table record IN. Data passed in may contain more than one record in the table object. Is there any example I can take a look? Thanks.

    I'm afraid it's a bit labourious but here's an example.
    I think it's a good idea to work with SQL objects rather than PL/SQL nested tables.
    SQL> CREATE OR REPLACE TYPE emp_t AS OBJECT
      2      (eno NUMBER(4)
      3      , ename  VARCHAR2(10)
      4      , job VARCHAR2(9)
      5      , mgr  NUMBER(4)
      6      , hiredate  DATE
      7      , sal  NUMBER(7,2)
      8      , comm  NUMBER(7,2)
      9      , deptno  NUMBER(2));
    10  /
    Type created.
    SQL> CREATE OR REPLACE TYPE staff_nt AS TABLE OF emp_t
      2  /
    Type created.
    SQL> Now we've got some Types let's use them. I've only implemented this as one public procedure but you can see the principles in action.
    SQL> CREATE OR REPLACE PACKAGE emp_utils AS
      2      TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE;
      3      PROCEDURE pop_emp (p_emps in staff_nt);
      4  END  emp_utils;
      5  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE BODY emp_utils AS
      2      FUNCTION emp_obj_to_rows (p_emps IN staff_nt) RETURN EmpCurTyp IS
      3          rc EmpCurTyp;
      4      BEGIN
      5          OPEN rc FOR SELECT * FROM TABLE( CAST ( p_emps AS staff_nt ));
      6          RETURN rc;
      7      END  emp_obj_to_rows;
      8      PROCEDURE pop_emp (p_emps in staff_nt) is
      9          e_rec emp%ROWTYPE;
    10          l_emps EmpCurTyp;
    11      BEGIN
    12          l_emps := emp_obj_to_rows(p_emps);
    13          FETCH l_emps INTO e_rec;
    14          LOOP
    15              EXIT WHEN l_emps%NOTFOUND;
    16              INSERT INTO emp VALUES e_rec;
    17              FETCH l_emps INTO e_rec;
    18          END LOOP;
    19          CLOSE l_emps;
    20      END pop_emp;   
    21  END;
    22  /
    Package body created.
    SQL>Looks good. Let's see it in action...
    SQL> DECLARE
      2      newbies staff_nt :=  staff_nt();
      3  BEGIN
      4      newbies.extend(2);
      5      newbies(1) := emp_t(7777, 'APC', 'CODER', 7902, sysdate, 1700, null, 40);
      6      newbies(2) := emp_t(7778, 'J RANDOM', 'HACKER', 7902, sysdate, 1800, null, 40);
      7      emp_utils.pop_emp(newbies);
      8  END;
      9  /
    PL/SQL procedure successfully completed.
    SQL> SELECT * FROM emp WHERE deptno = 40
      2  /
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7777 APC        CODER           7902 17-NOV-05       1700
            40
          7778 J RANDOM   HACKER          7902 17-NOV-05       1800
            40
    SQL>     Cheers, APC

  • Hello, 2 questionss here is it possible or is there a way to convert all object s outlines in all frames to fills at once and not frame by frame? and why sometimes erases the outline instead of converting it to fill?

    Hello, 2 questionss here>is it possible or is there a way to convert all object s outlines in all frames to fills at once and not frame by frame? and why sometimes erases the outline instead of converting it to fill?

    Hello, 2 questionss here>is it possible or is there a way to convert all object s outlines in all frames to fills at once and not frame by frame? and why sometimes erases the outline instead of converting it to fill?

  • Converting Array Objects into ArrayCollections

    Hi,
    I am facing problem with converting Array Objects into ArrayCollections. How can i convert Array Objects into ArrayCollections. If any one knows how can we do that Pl reply.
    Thanks in advance to all
    Regards
    subbareddy.p

    Hi Bhasker,
    thanks for u r reply. Here i attached screen shot of my server "data.result".
    My proxy varaible contains
    My object varaible "obj" contains
    After parsing the result my arraycollection contains, (i mean after converting Object to Array to ArrayCollection) the below information. For information Pl find the attached arraycollection.png image. In the attached image my arraycollection name is "users".
    Here i pasted the code that i used  to convert  "ObjectProxy" to "ArrayCollection"
    var proxy:ObjectProxy = ObjectProxy(data.result);
                var obj:Object = proxy.object_proxy::object;
                var arrycoll:Array = ArrayUtil.toArray(obj); 
                model.users = new ArrayCollection(arrycoll);
    Regards
    sss

  • Error converting DOM nodes into SOAP nodes

    Hi,
    i am doing an http call using http binding activity in oracle soa suite 11g.The http call requires some header information.When I pass the header information through headers in invoke activity and invoke the http call,I get an error " Error converting DOM nodes into SOAP nodes".What might be the reason and how to solve it.
    Naresh

    Hello,
    It appears your code is trying to repeat messagePart itself. Split Joins strictly adheres to a WSDL definition for incoming and outgoing messages.
    Instead of repeating <RootElement> which is defined as single occurance in your message definition within WSDL, you should find a way to tweak the WSDL to have "repetitive node which will become single message after split" within 1 Root element.
    This will call for having need of implementing transformation within split join based on need of target input message. Below is the example:
    WSDL contains:
    <wsdl:message name="inputMessageName">
         <wsdl:part name="partInput" element="rootElement"/>
    </wsdl:message>
    What your current xml structure is(please note how message itself is repeating below while it has been defined as single in wsdl, unfortunately there is nothing maxOccurs for message in WSDL definition , although you can define multiple parts but that is not case here):
    <soap:Body>
    <rootElement>
    </rootElement>
    <rootElement>
    </rootElement>
    <rootElement>
    </rootElement>
    </soap:Body>
    What Split-Join expects(If you have existing wsdl then you need to tweak it to conform to below kind of structure then use transformation within split join to convert it into correct xml structure for outgoing):
    <soap:Body>
    <rootElement>
         <repetitiveElementSpecificToIndividualSplitRequest/>
         <repetitiveElementSpecificToIndividualSplitRequest/>
         <repetitiveElementSpecificToIndividualSplitRequest/>
    </rootElement>
    </soap:Body>
    I hope this helps.
    Regards,
    Ankit

  • WD(ABAP) - How to convert PDF object to XML

    I know there is a way available to converting PDF object to XML in JAVA. However how to achieve this goal in ABAP?
    In Web Dynpro ABAP, I can bind a context attribute to the pdfSource property of interactive form element. There also should be method to able to convert the binary content of this attribute to XML format, right? Does anyone know it?
    Your help would be greatly appreciated.

    Hi all,
    As an extension to Fred's question, is it possible to later use the generated XML data and present it in a PDF template?  It used to be possible using the FDF format, but Adobe seem to have discontinued that. 
    My basic requirement is to send the form data to a third party in XML format and for them to be able to view it in human-readable format, preferably using a PDF as a template. 
    Is this possible?
    Thanks,
    Jonathan

  • BSP Exception: Missing reference when converting data object ZZxx

    Hi there,
    I have created these new Z fields and tried to include them in a field group. These fields did appear, but they are highlighted with a red box, with the above text in the tool tip.
    Does anyone know what it means??
    Thanks

    I believe they were generated by EEWB - or could've been added manually to the CRMD_CUSTOMER_H. This error only occurs on the Currency fields...something to do with reference field but I just can't find what is wrong with this. I searched up SAP notes and found the following the closest match: -
    <b>Symptom</b>
    when trying to scroll down in the result list in the F4 for the Ibase the error error "BSP exception : Missing reference when converting data object amount.  Correct the entry" occurs.
    <b>Other terms</b>
    CRMT_BSP_IBASE_TREE_NF, data object amount
    <b>Reason and Prerequisites</b>
    This happens due to inconsistancy in structure
    <b>Solution</b>
    Please follow the below steps manually.
    1. Go to tx:SE11
    2. Select data type "CRMT_BSP_IBASE_TREE_NF" in change mode
    3. Select component AMOUNT in 'Components' tab
    4. Go to "Currency/quantity fields" tab
    5. Replace 'Reference table' entry from 'CRMT_BSP_IBASE_DETAIL'
       to 'CRMT_BSP_IBASE_TREE_NF'
    6. Save and activate

  • How do I Convert an "Object" to a "double"?

    Can anyone please tell me how to convert an "Object" to a "double"? Typecasting does not work.

    Do you want to convert any object at all to a double, or only particular kinds of objects? My guess is that you don't really need to convert a File or a JButton to a double, you have some kind of an object that really contains some sort of double information and you want to get it out. More information would help.

  • Converting EJB Object into XML

    All:
    Suppose I have an EJB that is named MyDog, it has attributes as follows:
    name
    breed
    weight
    age
    Is there a way to convert this Object into an XML document? Something like:
    <?xml version=\"1.0\" ?>
    <MyDog>
    <name>Bubba</name>
    <breed>Australian Shepherd</breed>
    <weight>65 lbs</weight>
    <age>6 years old</age>
    </MyDog>
    I can't find any information on doing this - any ideas, links, etc? There has to be a way to do this, but I can't find it. I'm welcome to any ideas out there!

    check JAXB - might be usefull for you: http://java.sun.com/xml/jaxb/index.html

  • Help with converting an object to something else

    How do I go about converting an Object from a Vector back into what it originally was?

    Vector v = new Vector();
    v.add(new String("Hello"));
    Object x = v.get(0);
    String s = (String) x; // this line; cast the object back to its type

  • Move Data from Converted Database Objects Successfully Finish ?

    I am using SQL Developer 3.2.20.09 try to migrate KSMMS database from SQL Server 2008 to Oracle 11g R2. After the migration process is done, the Captured Database Objects model, and Converted Database Objects model have been created in the Migration Projects Navigator panel on the left side, and the corresponding sql scripts has been generated in the project output directory. I run the sql scripts, it created all the tables, views, index and stored procedures in the oracle database, everything seems working perfectly. However when I try to Move Data (by right clicking Converted Database Objects) and try to move all the data from SQL Server to Oracle database, the Data moving process run less then 1 minute, and show me the result as Data Move successfully. I have about 1 GB data in the SQL Server database, it seems nothing has been moved into Oracle DB. Here are the detail structures of MS SQL Server Database which I am trying to migrate to Oracle:
    The SQL Server Database name is KSMMS, under that database there are 9 users (azteca, cwweb, dbo, guest, plladmin, pw, pwadmin, tbills, wsdadmin). All my application objects (tables, views, indexes, procedures) are under azteca user, during the migration process, Converted Database Objects creates user azteca_KSMMS and dob_KSMMS, all my application objects have been created under azteca_KSMMS user schema. The generated .sql scripts actually can create all the objects under azteca_KSMMS schema, however when I try to Move Data, nothing has been moved into Oracle database. I opened an SR#3-6708733861 last Friday, it seems Oracle Support can't find what cause the problem during the Data Move process. Any help regarding my questions will be highly appreciated. Thanks.
    Kevin

    I changed Data Move Mode to Online and run the Data Move again. Same Results: Migration action have completed successfully. However no records have been moved into Oracle tables.
    I am running SQL Developer under Windows 8 Operation system. There is no Oracle client software available for Windows 8, does that cause any problems?
    Kevin

  • How to convert SOAPEnvelope or SOAPBody to org.w3c.dom.Node and vice versa?

    How to convert javax.xml.soap.SOAPEnvelope or javax.xml.soapSOAPBody to org.w3c.dom.Node and vice versa?If this convertion is very diffcult , how to convert String to org.w3c.dom.Node?
    Thanks a lot

    vj008 wrote:
    while parsing a DOM i want to convert
    org.w3c.dom.Element to xml string and after certain processing on that xml string i want to convert back it to
    org.w3c.dom.Element.[This might help. xml transformations in java. |http://tejaspurohit.blogspot.com/2009/08/xml-transformations-in-java.html]

Maybe you are looking for

  • Event Handler on the selectedItem of a ComboBox?

    Can you run actionscript as an event handler using the "selectedItem" of a ComboBox?  I prefer to do this using the XML file, but at this point I'll entertain any ideas. Thanks.

  • Receiver File Adapter - Tab delimited Text file

    I am using receiver file adapter to convert message created by ABAP PROXY to convert tab delimited text file format. XML message is in following format. - <DT_R3_ROLES_OUTBOUND_REC>   <LIST_CATEGORY>SAP_HR</LIST_CATEGORY>   <USRID>MRUDULAP</USRID>  

  • Color of a frame

    Dear fellows, I want to change the color of a frame programmatically. How can i do it? Is it possible to change the background color of your frame through code? If yes then how? I am using forms 6i. Please help. Mirza Imran Baig

  • Declaration  in bulk collect

    Hi, I have code like below, DECLARE      TYPE Rowid_type IS TABLE OF rowid;      c_rowid_1 rowid_type;      c_rowid_2 rowid_type; CURSOR cur_rec_1 IS SELECT ROWID FROM emp WHERE ename like 'A%'; CURSOR cur_rec_2 IS SELECT ROWID FROM emp WHERE ename l

  • Trouble getting a JMF program working with another program

    hello. my name is james mcfadden. i am having difficulty compiling the first program (a menu GUI) here. even though the second program (the JMF program) can be compiled and runned as a separate application, i'm trying to get be able to use the first