Invalid testsuite XML document for junitreport task

Hi everyone, I'm new to this forum and apologies if this is the incorrect place for me to post this thread. Basically I'm having some issues with the junitreport task with my junit test project.
I have a dummy class called Money and dummy test suite called MoneyTest that contains 4 test cases. The test is run through ANT <junit> task and they all passed with no problems. The problem occurred when I tried to perform the automatic test report generation using <junitreport> task, and the generated HTML pages contain no test results at all, indicated by "Tests:0 Failures:0 Errors:0 Success rate:0 Time:0.000" (in which case it should be 4 for Tests, etc.).
The error message says "TESTS-TestSuites.xml is not a valid testsuite XML document". I assume this file is auto-generated by the <junitreport> task which defines how the output HTML should look like. However, it only contains the folloing 2 lines:<?xml version="1.0"?> <testsuites />. I suspect this should be the cause of the empty output. So could anyone who's familar with this issue shed any light on how I should go about deal with this issue please? Thank you very much in advance!
By the way, the task code in build.xml for reporting is as follows:
<target name="report">
     <junitreport todir="./reports">
          <fileset dir="./reports" includes="*.xml" />
          <report format="frames" todir="./report/html" />
     </junitreport>
</target>

Thanks, the issue has been solved. I simply forgot to set the formatter type to xml in the junit task.

Similar Messages

  • Some one can provide me documents for the Tasks in UCMON

    Hi,
    some one can provide me documents for the Tasks  and its dependencies in UCMON
    Those task are below
    1>Period Initialization
    2.>Load R/3 data
    3>Retained Earnings
    4>Currency Translation
    5>Elimimination IU Rev&Exps
    6>IU Sales
    7>IU Pay/Rece
    8>Elim COI
    9>Reclass(DOM-CORP)
    10>Reclass(MX-CORP)
    11>Reclass(DOM-INTL)
    12>Reclass(ALL-CORP)
    Please provide me document on the above tasks and their dependencies in UCMON.
    I would like to know what are these steps and what it do in UCMON.

    Prasad,
    You have to apply to guys and documents of the company from which you took this info. This is a completely custom set of tasks. You either should read about them in the company's manuals or go through the tasks and underlying methods (and simultaneously through on-line help:
    http://help.sap.com/saphelp_sem60ep1/helpdata/en/62/f7e73ac6e7ec28e10000000a114084/frameset.htm).
    If it doesn't help, then if I were you' I'd consider leaving this job. It might be not for you.

  • Invalid xml document for BPEL Process.

    Hi everyone,
    I am getting below error after i set validateXML=strict
    Invalid xml document.
    According to the xml schemas, the xml document is invalid. The reason is: Error::cvc-datatype-valid.1.2.1: '' is not a valid value for 'decimal'.
    Error::cvc-type.3.1.3: The value '' of element 'ns1:p_person_id' is not valid.
    Please make sure that the xml document is valid against your schemas.
    Kindly help me with the steps. I am just a SOA admin, not developer.
    Regards
    Lammeki.

    Ummmm Vikas,
    Lemme bring out a better picture, so u get more clear on this one.
    The developer has upgraded an already deployed BPEL process.
    Since then, she has been facing problem. When she invoke those process they simply end up as faulted with a yellow color ! mark.
    Now i as an admin, i tried everything to help her cos she escalated the issue to me, thinking maybe there is sumthing i could do to assists her.
    Now i am not sure, how to help her, but yes i started with the logs. Both the oc4j container log for SOA and the domain log show the similar error.
    But till then, i didn't know black and white of it. so i tried doing all testing possible from my end.
    When i check on the faulted instances i see there is a Assign activity after Transform followed by Invoked being highlighted in red color. and when i clicked on it i get to see the error
    Assign_41
    [2011/07/21 02:26:15]
    Error in evaluate <from> expression at line "315". The result is empty for the XPath expression : "/ns6:QueryPerAllPeopleOutputCollection/ns6:QueryPerAllPeopleOutput/ns6:EMPLOYEE_NUMBER".
    oracle.xml.parser.v2.XMLElement@1ee216f
    Copy details to clipboard
    [2011/07/21 02:26:15]
    "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown.
    - <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    - <part name="summary">
    <summary>
    empty variable/expression result.
    xpath variable/expression expression "/ns6:QueryPerAllPeopleOutputCollection/ns6:QueryPerAllPeopleOutput/ns6:EMPLOYEE_NUMBER" is empty at line 315, when attempting reading/copying it.
    Please make sure the variable/expression result "/ns6:QueryPerAllPeopleOutputCollection/ns6:QueryPerAllPeopleOutput/ns6:EMPLOYEE_NUMBER" is not empty.
    Possible reasons behind this problems are: some xml elements/attributes are optional or the xml data is invalid according to XML Schema.
    To verify whether XML data received by a process is valid, user can turn on validateXML switch at the domain administration page.
    </summary>
    </part>
    </selectionFailure>
    Copy details to clipboard
    So because of that instruction i went ahead and set validateXML=strict
    and that is when i got the error message as below
    Invoke_PerAllPeople
    [2011/07/21 11:47:12]
    Invalid data: The value for variable "Invoke_PerAllPeople_QueryPerAllPeople_InputVariable", part "QueryPerAllPeopleInput_msg" does not match the schema definition for this part.The invalid xml document is shown below:
    oracle.xml.parser.v2.XMLElement@17f54ff
    Copy details to clipboard
    [2011/07/21 11:47:12]
    Faulted while invoking operation "QueryPerAllPeople" on provider "QueryPerAllPeople".
    - <messages>
    - <input>
    - <Invoke_PerAllPeople_QueryPerAllPeople_InputVariable>
    - <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="QueryPerAllPeopleInput_msg">
    - <QueryPerAllPeopleInput xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/db/QueryPerAllPeople" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/QueryPerAllPeople">
    <ns1:p_person_id/>
    </QueryPerAllPeopleInput>
    </part>
    </Invoke_PerAllPeople_QueryPerAllPeople_InputVariable>
    </input>
    - <fault>
    - <invalidVariables xmlns="http://schemas.oracle.com/bpel/extension">
    - <part name="code">
    <code>
    9710
    </code>
    </part>
    - <part name="summary">
    <summary>
    Invalid xml document.
    According to the xml schemas, the xml document is invalid. The reason is: Error::cvc-datatype-valid.1.2.1: '' is not a valid value for 'decimal'.
    Error::cvc-type.3.1.3: The value '' of element 'ns1:p_person_id' is not valid.
    Please make sure that the xml document is valid against your schemas.
    </summary>
    </part>
    </invalidVariables>
    </fault>
    </messages>
    Copy details to clipboard
    [2011/07/21 11:47:12]
    "{http://schemas.oracle.com/bpel/extension}invalidVariables" has been thrown.
    - <invalidVariables xmlns="http://schemas.oracle.com/bpel/extension">
    - <part name="code">
    <code>
    9710
    </code>
    </part>
    - <part name="summary">
    <summary>
    Invalid xml document.
    According to the xml schemas, the xml document is invalid. The reason is: Error::cvc-datatype-valid.1.2.1: '' is not a valid value for 'decimal'.
    Error::cvc-type.3.1.3: The value '' of element 'ns1:p_person_id' is not valid.
    Please make sure that the xml document is valid against your schemas.
    </summary>
    </part>
    </invalidVariables>
    Copy details to clipboard
    The main problem was we were observing many SOA inactive threads in one particular database, and they keep building up minutes by minutes.
    I suspect, that in the code connections were open but were not closed, there4 there were inactive threads in the database.
    I had to stop the SOA application, to stop threads from building up. I guess they got build up when they were invoked. There is definitely some fault with the code. or tell me am wrong. tell me its sumthing else.
    However other domains processes were working fine.
    and oh, yes the developer also made changes in the database. when i asked her to revert back and see if it works, she say thats a huge amount of work.
    Finally she end up saying that maybe it could be a problem with the new version.
    Now as a learner, I want to know what is going on, and how do we go about solving it.
    Am not much of a SOA techie. that u can make out. but yes ready to learn things. so there4 i beg you to explain to me like am a standard 3 or 4 kid. any more information needed plz feel free to write back.
    regards
    Lammeki.

  • CProjects - Approval Document for a Task

    Hi,
    Is it possible to create some approval scenario for a task in cProject.
    There are some tasks which need cost approval. Can anyone recommend an easy to implement solution using the standard by either reusing approval document or attaching a BW report with a task.
    kind regds
    Vishal

    Hi Thomas,
    I do understand and agree with your opinion. The issue is that we need to get an object approved that is not a phase in the main project definition. So just wondering if we can create this object as a phase under a subproject definition - This is just to avoid these huge modifications. So if we can treat a task as a phase of the subproject and trigger the approval of this, do you see any issues technically ? (Though there are issues in functional design, but they would outnumber the benefits if it can be realised ?)
    Cheers
    Vishal

  • Loading XML document for DOM parsing

    Can anyone suggest other API's to load a XML document into memory so they can be parsed using the DOM with Java?(e.g. The "load(url)" interface method specific to IE5)
    Thanks

    Check out the DOMSample.java code came with the XML Parser for Java v2 download.
    Oracle XML Team

  • How parse XML document for output

    I have this users.xml document :
    <?xml version="1.0" ?>
    <!DOCTYPE users[
    <!ELEMENT users (user+) >
    <!ELEMENT user (mail,password)+ >
    <!ELEMENT mail (#PCDATA)>
    <!ELEMENT password (#PCDATA)>
    <!ATTLIST userid CDATA #REQUIRED >
    ] >
    <users>
    <user id='3'>
      <mail> [email protected]</mail>
      <password>password 11</password>
    </user>
    <user id='4'>
      <mail>[email protected]</mail>
      <password>password 21</password>
      <mail>[email protected]</mail>
      <password>password 22</parola>
    </user>
    </users>I want to have this output :
    id=3 [email protected] password 11
    id=4 [email protected] password 21
    id=4 [email protected] password 22
    I have no idee what i should use (in java) here pls help me !
    Thank you !

    You want to have a look at JAXP (Java API for XML Processing), start here [http://java.sun.com/j2ee/1.4/docs/tutorial/doc/|http://java.sun.com/j2ee/1.4/docs/tutorial/doc/] (e.g. chapter 6)
    Edited by: pierrepost on Jun 16, 2008 3:13 PM

  • Encoding the & in XML document for URL

    I'm creating an RSS feed. My feed link appears as below. http://www.valpak.com/vpcol/searchCat.do?searchType=geography&searchParameter=" + encodedSearchValue + "&targetedLinkId=" + csVO.getCouponSlugId();
    The marshaller inserts an & for the ampersands. Is that correct? If not, how do I encode the ampersands?
    deb

    Hi,
    In standard system I'm not aware of any setting that would restrict the assignemnt of one delivery to several shipment.
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/5f/e411bb044411d2bf5d0000e8a7386f/frameset.htm
    Since a delivery for which the billing document is to be created can be part of several shipments (for example, in the case of a transportation chain), it can happen that several shipment cost documents need to be calculated so that the billing document itself can at all be created.
    I guess you have to:
    - use proper selection criteria when assigning deliveries to the shipment (e.g. proper transportation planning status (VBUK-TRSTA) --> you can define variants)
    - go to development (SPRO > LE > Transportation > System Modifications > User Exits for Transportation + SPRO > LE > Transportation > System Modifications > Biusiness Add-In in Transportation)
    In Is-Oil there are built in checks:
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/70/23d610419311d2ac100000e829fbfe/frameset.htm
    Regards,
    Csaba
    Edited by: Csaba Szommer on Jan 19, 2010 8:53 PM

  • My Task is To Parse a XML Document to Return CLOB's

    Hi folks
    I am writing this mail in the hope of getting a help.Please
    give me a shoulder to keep me going.
    The task is to parse a XML document for a specific Tag and
    read the Tag content in CLOB to return CLOB.
    I know that the writetoclob will do the job as
    per oracle documentation.
    I am giving the code where i got stuck.
    Please help me complete my rest of coding.
    Thanks
    Input variables are
    XMLin in CLOB, -- Incoming XML Document Structure
    Partype in varchar2, -- Tagname
    Result out CLOB -- Return Tag value CLOB data type.
    My Code : -
    Declare
    p xmlparser.parser;
    d xmldom.DOMDocument;
    e xmldom.DOMElement;
    nl xmldom.DOMNodeList;
    n xmldom.DOMNode;
    tagvalue varchar2(255);
    paramsIn Clob;
    result CLOB;
    BEGIN
    --loading SecXML
    dbms_lob.createtemporary(paramsIn,true);
    dbms_lob.append(paramsIn,XMLin);
    --dbms_output.put_line('ParsebyTag ='||Partype);     
    --defining parser
    p := xmlparser.newparser;
    xmlparser.parseClob(p,paramsIn);
    d := xmlparser.getDocument(p);
    --get tagvalue
    nl := xmldom.getElementsByTagName(d,partype);
    n := xmldom.item(nl,0);
    IF xmldom.getlength (nl) > 0
    THEN
    n := xmldom.item (nl, 0);
    =>=>=> => xmldom.writetoclob (n, result); <=<=<=<=<=<=====
    END IF;
    return; -- from a procedure
    The above line marked with a arrow does not work for CLOB Variables.
    Please explain with a corrected code to complete this task.
    Thanks for reading my request.
    Please reply to this message poster as i am frequently
    checking this to see a answer.
    my email is [email protected]
    Balaji.

    First, you have 2 variables with the same name,
    Second, let me show you what is that you need to do:
    PROCEDURE WriteDataToClob(XMLin in CLOB, Partype in varchar2, Result out CLOB) IS
    Declare
    p xmlparser.parser;
    d xmldom.DOMDocument;
    e xmldom.DOMElement;
    nl xmldom.DOMNodeList;
    n xmldom.DOMNode;
    tagvalue varchar2(255);
    TempClob Clob;
    BEGIN
    --Create a temporary clob
    dbms_lob.createtemporary(TempClob,true);
    --loading SecXML
    --defining parser
    p := xmlparser.newparser;
    xmlparser.parseClob(p,XMLin);
    d := xmlparser.getDocument(p);
    --get tagvalue
    nl := xmldom.getElementsByTagName(d,partype);
    n := xmldom.item(nl,0);
    IF xmldom.getlength (nl) > 0 THEN
    n := xmldom.item (nl, 0);
    xmldom.writetoclob (n, TempClob );
    END IF;
    Result := TempClob;
    dbms_lob.FreeTemporary(TempClob);
    END;

  • Replacing special characters from xml document/text inside element

    Hi
    Is there any way to replace the xml codes to special characters inside an entire xml document/ for a text in element.
    I want to get the xml codes to get replaced to respective special character(for any special character)
    Please see the sample xml xml element below
    <Details>Advance is applicable only for &lt; 1000. This is mentioned in Seller&apos;s document</Details>
    Thanks in advance .. any help will be highly appreciated.

    So, just to be sure I understand correctly, you want this :
    <Details>Advance is applicable only for &lt; 1000. This is mentioned in Seller&apos;s document</Details>
    to be converted to :
    <Details>Advance is applicable only for < 1000. This is mentioned in Seller's document</Details>
    If so, I'll say again : the resulting XML document will be invalid.
    Extensible Markup Language (XML) 1.0 (Fifth Edition)
    The ampersand character (&) and the left angle bracket (<) MUST NOT appear in their literal form, except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they MUST be escaped using either numeric character references or the strings " &amp; " and " &lt; " respectively. The right angle bracket (>) may be represented using the string " &gt; ", and MUST, for compatibility, be escaped using either " &gt; " or a character reference when it appears in the string " ]]> " in content, when that string is not marking the end of a CDATA section.
    Ask whoever "they" are why they would want to work with not wellformed XML.

  • Problem replacing Null nodes with real values in XML documents...

    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    Our friends in Java land are insisting on passing data between Java and PL/SQL using fairly small XML documents (don't ask). I then need to extract the input parameter values and pass them, on to the stored procedures that actually do the work. These return a result which needs to be returned to the java layer in the output XML document.
    Here is a cut down version of the input XML...
    <ParameterList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Parameter>
    <Id>1</Id>
    <Result xsi:nil="true"/>
    </Parameter>
    <Parameter>
    <Id>2</Id>
    <Result xsi:nil="true"/>
    </Parameter>
    </ParameterList>
    and this is an example of what I am expected to return...
    <ParameterList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Parameter>
    <Id>1</Id>
    *<Result>SUCCESS</Result>*
    </Parameter>
    <Parameter>
    <Id>2</Id>
    *<Result>WARNING</Result>*
    </Parameter>
    </ParameterList>
    i.e. I am expected to replace the value of the Result node with a string indicating the succes or otherwise of the underlying PL/SQL process.
    I am extracting the input values using the DBMS_XMLDOM functions and naively assumed that DBMS_XMLDOM.SETNODEVALUE could be used to update the value in the Result node - It didn't work so I resorted to reading the documentation which revealed that it will not work for a null node.
    Am I going to have to use XSLT to generate the output XML from the Input and incorprate the result? Or is there a simpler way?
    I have used XSLT in Oracle before and still have the nervous tick...

    Thanks A Non,
    With your suggestion and a bit of help from the w3schools.com xml dom tutorial I eventually managed to work out how to do this.
    Here is the code (with all my debug stuff in so it looks worse than it is...)
    create or replace
    PROCEDURE ExtractXMLValues (p_inXml IN CLOB ) IS
    l_string VARCHAR2(4000);
    l_value VARCHAR2(4000);
    l_DOM_doc dbms_xmldom.DOMDocument;
    l_DOM_node dbms_xmldom.DOMNode;
    l_new_DOM_node dbms_xmldom.DOMNode;
    l_new_element dbms_xmldom.DOMElement;
    l_new_DOM_nodevalue dbms_xmldom.DOMNode;
    l_value_Node dbms_xmldom.DOMNode;
    l_parameter_Node dbms_xmldom.DOMNode;
    --l_DOM_nodelist    dbms_xmldom.DOMNodeList;
    l_Result_DOM_node dbms_xmldom.DOMNode;
    BEGIN
    l_DOM_doc := dbms_xmldom.newDomDocument(p_inXml);
    l_DOM_node := dbms_xmldom.makeNode(l_DOM_doc);
    dbms_xmldom.writeToBuffer(l_DOM_node, l_string);
    dbms_output.put_line('1 ' || l_string);
    l_parameter_node := dbms_xslprocessor.selectSingleNode(l_DOM_node,'//Parameter');
    -- get the current values in the XML document for Id and Result
    l_Result_DOM_node := dbms_xslprocessor.selectSingleNode(l_DOM_node,'//Id');
    l_value_Node := dbms_xmldom.getFirstChild(l_Result_DOM_node);
    l_value := dbms_xmldom.getnodevalue(l_value_Node);
    dbms_xmldom.writeToBuffer(l_Result_DOM_node, l_string);
    dbms_output.put_line('2 ' || l_string || ' : ' || l_value);
    l_Result_DOM_node := dbms_xslprocessor.selectSingleNode(l_DOM_node,'//Result');
    l_value_Node := dbms_xmldom.getFirstChild(l_Result_DOM_node);
    l_value := dbms_xmldom.getnodevalue(l_value_Node);
    dbms_xmldom.writeToBuffer(l_Result_DOM_node, l_string);
    dbms_output.put_line('3 ' || l_string || ' : ' || l_value);
    -- create new Result node
    l_new_DOM_node      := dbms_xmldom.makenode(dbms_xmldom.createElement(l_DOM_doc, 'Result'));
    dbms_xmldom.writeToBuffer(l_new_DOM_node, l_string);
    dbms_output.put_line('4 New node : ' || l_string);
    -- create a value for it
    l_new_DOM_nodevalue := dbms_xmldom.makenode(dbms_xmldom.createtextnode(l_DOM_doc, 'SUCCESS'));
    dbms_xmldom.writeToBuffer(l_new_DOM_nodevalue, l_string);
    dbms_output.put_line('5 New node value : ' || l_string);
    -- add the value to the new Result node
    l_new_DOM_nodevalue := dbms_xmldom.appendchild(l_new_DOM_node,  l_new_DOM_nodevalue);
    dbms_xmldom.writeToBuffer(l_new_DOM_node, l_string);
    dbms_output.put_line('6 New node : ' || l_string);
    -- replace the old node with the new one
    l_Result_DOM_node := dbms_xmldom.replaceChild(l_parameter_node, l_new_DOM_node, l_Result_DOM_node);
    dbms_xmldom.writeToBuffer(l_parameter_node, l_string);
    dbms_output.put_line('6 parameter node : ' || l_string);
    dbms_xmldom.writeToBuffer(l_DOM_node, l_string);
    dbms_output.put_line('7 Updated document ' || l_string);
    dbms_xmldom.freeDocument(l_DOM_doc);
    END ExtractXMLValues;
    and the output...
    1 <ParameterList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Parameter>
    <Id>1</Id>
    <Result xsi:nil="true"/>
    </Parameter>
    </ParameterList>
    2 <Id>1</Id> : 1
    3 <Result xsi:nil="true"/> :
    4 New node : <Result/>
    5 New node value : SUCCESS
    6 New node : <Result>SUCCESS</Result>
    6 parameter node : <Parameter>
    <Id>1</Id>
    <Result>SUCCESS</Result>
    </Parameter>
    7 Updated document <ParameterList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Parameter>
    <Id>1</Id>
    *<Result>SUCCESS</Result>*
    </Parameter>
    </ParameterList>
    One question, why do the dbms_xmldom functions return the Old value? I was expecting the returned value to be the updated node.
    Edited by: Lone voice on May 14, 2009 11:24 AM

  • Generation of xml document of rows in table.

    hi..
    i want to generate xml document for one table.....i want all records from that table to xml...
    thank u
    sam

    create table test(col1 varchar2(10));
    insert into test values('hello1');
    insert into test values('hello2');
    insert into test values('hello3');
    insert into test values('hello4');
    commit;
    set serveroutput on;
    declare
    v_sql varchar2(1000);
    v_output clob;
    begin
    v_sql := 'select * from test';
    v_output := dbms_xmlgen.getxml(v_sql);
    dbms_output.put_line(v_output);
    end;
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
    <COL1>hello1</COL1>
    </ROW>
    <ROW>
    <COL1>hello2</COL1>
    </ROW>
    <ROW>
    <COL1>hello3</COL1>
    </ROW>
    <ROW>
    <COL1>hello4</COL1>
    </ROW>
    </ROWSET>
    The dbms_xmlgen can do it for you like the above example.
    Lee
    null

  • Please help me 2 find a Document for this jar file com.sap.workflow_api

    HI,
    I want to create a task in UWL using web dynpro application. For this I need to import the specified com.sap.workflow_api.jar jar file.
    This jar file is in our WEB AS Server
    path=
    server\c\usr\sap\W01\JC00\j2ee\cluster\server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\portal\portalapps\com.sap.workflow.apps\lib
    I have browsed all over for a good document , i got just one link :
    http://help.sap.com/saphelp_nw70/helpdata/EN/46/94b9b2b321581ce10000000a1553f7/frameset.htm
    Could you help me out with a better document for This task and  I want the complete document for this particular jar file com.sap.workflow_api.jar.
    It wolud be very helpful if I could get it at the earliest.
    Regards,
    Boopathi M

    HI Ayyapparaj,
    I have converted my project to javadoc,but i don't get any document for specific class. only I got what ever method is avilable in our controller that corssponding method come over in the java doc.
    How can i get the document for specified IWorkflow interface ? this com.sap.workflow_api jar file has IWorkflow interface. I need to know how to use this IWorkflow interface.
    How to use javadoc tool ?
    Regards,
    Boopathi M

  • Creating a node in an XML Document

    Hi!
    i need to insert a new element in an existing xml document. for example,
    <bookinfo>
    <book>
    <bookname>A</bookname>
    <author>B</author>
    </book>
    <book>
    <bookname>C</bookname>
    <author>D</author>
    </book>
    </bookinfo>
    In this document if i want to insert another element using Xpath, say,<publisher> in <book> node, how to insert it.
    I'm using DOM parser for parsing the xml file.
    Any help to solve this issue appreciated.
    Thanks in advance.

    final class Foo {
        private static final String MARKUP =
            "<bookinfo>\n" +
              "<book isbn='1234'>\n" +
              "<bookname>A</bookname>\n" +
              "<author>B</author>\n" +
              "</book>\n" +
              "<book isbn='5678'>\n" +
              "<bookname>C</bookname>\n" +
              "<author>D</author>\n" +
              "</book>\n" +
              "</bookinfo>";
        private Foo() {
            super();
        public static final void main(final String[] args)
            throws XPathExpressionException {
            String isbn = args.length > 0 ? args[0] : "1234";
            String publisher = args.length > 1 ? args[1] : "Sample Publisher";
            Document document = ...  // Initialize somehow
            XPath xpath = XPathFactory.newInstance().newXPath();
            String expression = "//bookinfo/book[@isbn=" + isbn + "]";
            Element book = (Element) xpath.evaluate(expression, document.getDocumentElement(), XPathConstants.NODE);
            if (book == null) {
                throw new RuntimeException("Unable to find ISBN " + isbn);
            Element newPublisher = document.createElement("publisher");
            newPublisher.setAttribute("name", publisher);
            book.appendChild(newPublisher);
    }- Saish

  • Display XML Document from CLOB Column on page

    Hi,
    I have been reading all the CLOB postings that I can find, but I still cannot get my page to do what I want.
    I have a very simjple table:
    MF_XML_DOCS (DOC_ID NUMBER, DOC_XML CLOB)
    I can populate this table OK but I am having problems getting the cotent back out. I want a simple page that takes an ID Number and displays the XML Document for that ID (select doc_xml from mf_xml_docs where doc_id = :P1_DOC_ID). Everything I try either truncates the text (or errors) at 4000 or 32767 characters or reads the XML tags as tags and does not display them. I want a simple display of the XML Document (and I don't mind if it is in an 'updateable' field or not):
    <Parent>
       <name>Dad</name>
       <Children>
          <Child>
             <name>Number 1 Son</name>
         </Child>
          <Child>
             <name>Number 2 Son</name>
         </Child>
       </children>
    </Parent>But when I do something that works for large (32767+) documents all I see is 'Dad Number 1 Son Number 2 Son'.
    Help!!
    many thanks,
    Martin

    Have you tried simply outputting iusing the htp.p function? for example:
    /* ... inside a PL/SQL region */
    declare
       lclb_output clob;
    begin
       select doc_xml into lclb_output from mf_xml_docs where doc_id = :P1_DOC_ID;
       htp.p(lclb_output); -- you may have to split this into chunks and loop through, depending on how big the clob is
    end;

  • Convert flat file to XML document and store into Oracle database

    First:
    I have a flatfile and created external table to read that file in Oracle
    Now I want to create an XML document for each row and insert into Oracle database, I think that XMLtype.
    Could you please provide me some information/steps.
    Second:
    Is there performance issues, because everyday I need to check that XML document stored in the database against the in coming file.
    Thank You.

    Oracle 11g R2 Sun Solaris
    Flat file is | (pipe delimited), so I did create an EXTERNAL Table
    row1     a|1|2|3|4
    row2     b|2|3|4|5
    row3     c|6|7|8|9
    I want to store each record as XML document. So it will be easy to compare with next day's load and make insert or update.
    The reason is:
         First day the file comes with 5 columns
         after some days, the file may carry on some additional columns more than 5
         In this case I do not want to alter table to capture those values, if I use XML than I can capture any number of columns, CORRECT!. Please make me correct If I am wrong.
         This is the only reason to try to use the XMLType (XML Document)
         On Everyday load we will be matching these XML documents and update it if there is any column's value changes
    daily average load will be 10 millions and initial setup will be 60-80 millions
         Do I have anyother option to capture the new values without altering the table.
    Please advise!.

Maybe you are looking for

  • How to record from the video in or S-video Ports on Qosmio G40?

    Can anyone tell me how to record from the video in or S-video ports, because i've tried the Ulead DVD factory program and the only capture device it could see was the webcam, and it did capture from it After that i've downloaded the update file that

  • Switching to Airport Extreme - Transition Questions

    I currently have a wirelss network in my house including 2 old Airport Extremes (802.11 b/g) and an older Airport Express. I want to upgrade to the newer generation Airport Extreme with 802.11n and incorporate the Apple TV. Is it better to start a br

  • DVD replication problems

    I send a DVD 5 out for replication with a "region 1" setting for the region code. I got a message from the replicators saying that the "Control DATA" and "Main DATA" don't match and must to be replicated. Everything I read in the DVDSP manual says DV

  • XML Type Problem

    Hi all ! I have a table with a XML_TYPE field. I use JDBC with the thin driver to connect to the base, When I do a Query like Select * from my_table, my query is save in a ResultSet. When I want to do something with my ResultSet my application is ver

  • What is this?? The volume 3D16F4F3-1F8F-4C8C-A8B7-15D88183FBC1 appears to be OK...

    What is this?!? The volume 3D16F4F3-1F8F-4C8C-A8B7-15D88183FBC1 appears to be OK...This keeps showing up when I repair disk because my mac was running slow blah blah and now my mac won't restart I even shutdown the system but it just reboots to the l