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

Similar Messages

  • Loading XML Document into DOM

    I know Safari 1.3 does not support loading of an XML Document, but does Safari 2 or 3 support the XML DOM? I will be really really really disappointed in apple if they still do not support the XML DOM for parsing with javascript. Why is Apple so negligent to Javascript?
    My XML doc loads fine in IE 5.5+ and FF1+ but I cannot get Safari clients to load the document. This is extremely detrimental to my site considering over 20% of the users are safari clients. I absolutely need this XML doc to be available to them.
    What is the safari specific javascript needed to load an XML document?
    Any help is GREATLY appreciated
    Mac OS X (10.4.8)

    Why does no one know the answer to this question? I've posted in every forum I could find.
    This procedure should be very standard and very easy. Much like it is in IE/FF. Why does no one know how to do it for Safari?

  • How to get nodes and its attributes of an XML file usiong DOM parsing?

    how to get nodes and its attributes of an XML file usiong DOM parsing?
    i am new to XML parsing.......
    Thanking you........

    import org.w3c.dom.Document;
    import org.w3c.dom.*;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.DocumentBuilder;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;      ...
    //Setup the document
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
         DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
         Document doc = docBuilder.parse (new File("MY_XML_FILE.xml"));
    //get elemets by name
         String elementValue = doc.getElementsByTagName("MY_ELEMENT").item(0).getTextContent();
    //This method can return multiple nodes, in this instance I get item(0) , first nodeRead the api for other methods of getting data.

  • Load xml document from CLOB

    I'm try to load xml document from CLOB in following way:
    --- procedure loadXML.sql -----
    CREATE OR REPLACE PROCEDURE loadXML
    IS
    CONTENT CLOB := ' ';
    SOURCE bfile := BFILENAME('XMLFILES', 'N_95_A.xml');
    begin
    DBMS_LOB.OPEN(SOURCE, DBMS_LOB.LOB_READONLY);
    DBMS_LOB.loadFromFile(CONTENT, SOURCE, DBMS_LOB.getLength(SOURCE));
    DBMS_LOB.fileClose(SOURCE);
    insert into OFERTY (OFDOCUMENT)
    values (sys.XMLtype.createXML(CONTENT));
    commit;
    end;
    and I get
    SQL> @e:\myxml\loadXML
    declare
    ERROR at line 1:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00210: expected '<' instead of '<'
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 1
    ORA-06512: at line 8
    What is wrong?

    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;

  • Error loading XML Document from /analytics/saw.dll/common/privileges.xml

    I tested my procedure for upgrading from OBI 11.1.1.5 to 11.1.1.6 which was successful. I had to rollback to OBI 11.1.1.5 using my database backup and VM snapshot due to project requirements.
    The OBI application successfully comes up but users who login just get "Error loading XML Document from /analytics/saw.dll/common/privileges.xml?fmapID=KqIJCw. The response given was: ". They can't close this message box so are unable to do anything.
    How can I fix this?

    Hi All,
    You can face this issue with other versions of OBIEE 11.*
    Problem cab be solved as follows:
    Go to http://localhost:7001/em  > coreapplication > Capacity Management > Scalibility >
    1. Lock and edit
    2 .increase number of presentation services to 2
    3. restart opmn component.
    Go to coreapplication > Availibility > processes
    1 .please note that in deployment > catalog > change path of catalog field from $coreapplication to path where your catalog resides.
    2. Take down your primary instance.
    3. As your secondary is up, it will grant you to browse you through catalog and dashboards.
    If you want to run primary instance of presentation services
    Go to path \Middleware\instances\instance1\bifoundation\OracleBIPresentationServicesComponent\coreapplication_obips2
    except catalog and catalog manager > Copy all other files to coreapplication_obips1
    restart opmn component > problem solved.!!!
    Regards,
    Akshay S.
    please like if you find it helpful

  • Updating XML file using DOM parser

    Hi,
    Can someone help me, how to update following XML file using DOM parser.
    The following is my XML file.
    <students>
         <student>
              <id>1</id>
              <name>abc</name>
         </student>
         <student>
              <id>2</id>
              <name>xyz</name>
         </student>
         <student>
              <id>3</id>
              <name/>
         </student>
         <student>
              <id>4</id>
              <name>ijk</name>
         </student>
         <student>
              <id>5</id>
              <name></name>
         </student>
    </students>Consider, I will input 2 fields, ie., id & name. For the matching Id, the name has to be updated.
    Though, I have achieved this, but I am unable to update the value for 3rd record, & 5th record ie., id=3 & id=5. Since, these are blank.
    Thanks.

    Some <name> elements have a child node which is a text node. From what you say it appears you know how to change those text nodes.
    The other <name> elements don't have any child nodes. But you want one. This suggests to me that you need code that creates a text node and adds it to the <name> element as its child.

  • Creating new analysis gives "Error loading XML Document from ..."

    Trying to create analysis and getting "Error loading XML Document from saw.dll/answers/answersproperties.xml?fmapId=S1clug.
    The response given was:" after choosing subject area. Analysis editor is opened but Subject Areas is empty and can't do anything.
    The problem is on Mozilla 12 (16.0.2, 17.0.1) and IE 8. Chrome works fine.
    My system is Win 7, BI 11.1.1.6.0 is on Oracle Linux (and by the way Mozilla from Linux system works fine)
    What could be the reason of this?
    Edited by: 898973 on 4/12/2012 15:11

    Reinstalling Mozilla with "Remove personal data" option checked resolved the problem.

  • Loading xml document in OWB

    Hi ,
    I am trying to load XML document in a Dw .Is it possible to do in OWB ?
    if Yes .Can someone please help me .
    Thanks,
    katet

    As far as my understanding goes, there is no native mechanism avialble in OWB to handle XML sources.
    The only possible way I see to handle this would be :
    -through PL/SQL and table function. Or may be writting Java stored proceduers.
    I stumble upon this very good posting at Asktom which talks about handling XML with SQL.
    http://asktom.oracle.com/pls/ask/f?p=4950%3A8%3A773383103134756029%3A%3ANO%3A%3AF4950_P8_DISPLAYID%2CF4950_P8_CRITERIA%3A4061080732051%2C

  • Pseudo code for DOM parsing a local XMl file

    HI all,
    1)     Can any body please provide me the JAVA pseudo code for parsing xml document from local mcahine and create another xml document in another location in loca machine with small transofrmations ? (JAVA mapping using DOM parsing tehnique using an xml file in loca machine using NWDS).
    2) Provide me with the links that can help me out to work with
    JAVA mapping using DOM
    Thanks,
    Ram.

    Hi,
    Have a Search in SDN with Keywords JAVA Mapping, & will get lot of stuff
    Implermenting JAVA Mapping in PI
    Implementing a Java Mapping in SAP PI
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/400ee77e-f9d6-2a10-2b8c-99281a4dcf6b
    Regards
    Seshagiri

  • 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

  • Extracting and Loading XML document

    We need to extract and load an XML document into the database
    For e.g.
    <ROW> <EMP_ID>1</EMP_ID> <EMP_NAME>SSK</EMP_NAME>
    <RESUME> Resume of sssk
    </RESUME>
    </ROW>
    We need to load emp_id, emp_name to emp_id, emp_name field in the database and <RESUME> field to a CLOB.
    The table is as follows
    EMP_ID NUMBER
    EMP_NAME VARCHAR2(100)
    RESUME CLOB
    How exactly is this done using the XSU utility? Does it support loading of <RESUME> data in this case to a CLOB.
    Where could I find examples of doing this.
    null

    The "first child" of most of your elements is a white-space node containing a newline character. Your code incorrectly assumes it is an element node.

  • How to load XML file for Custom Pod in 7.5?

    I'm developing a custom pod for our Connect 7.5 deployment, and I'm attempting to load an XML file that resides in the assets/ folder of my project. I run the pod in Flash Builder 4.5 to debug and it works just fine. Whenever I load the pod into our Connect 7.5 solution, it appears as if none of the events for the URLLoader are triggered.
    Is there something else I need to do? Please help!  Note - I have tried loading XML both from an actual URL and locally. Both work fine in the IDE just not when pod is in Connect.
    Thanks

    Did you follow the guidelines in the Connect 6 SDK documentation? This document was applicable from version 6 through 7.5.
    http://help.adobe.com/en_US/Connect/6.0/SDK/help.pdf
    Your SWF needs to be named index.swf to work, as I recall.

  • Merging XML documents using DOM

    I have 300 XML documents to merge. They contain structures such as:
    1.xml=
    <MIM>
    <MIM-ENTRY>
    <MIM-NUMBER>123456
    </MIM-NUMBER>
    </MIM-ENTRY>
    </MIM>
    2.xml =
    <Mim>
    -<Mim-entry>
    <Mim-title>*604176 SUPPRESSOR OF CYTOKINE SIGNALING 3</Mim-title>
    </Mim-entry>
    </Mim>
    3.xml=
    <Mim>
    <Mim-entry>
    <Mim-alternative_titles_and_symbols>
    <Mim-alternative_titles_and_symbols-alt>SOCS3</Mim-alternative_titles_and_symbols-alt>
    </Mim-alternative_titles_and_symbols>
    </Mim-entry>
    </Mim>
    all the XML files have this sort of structure.
    Essentailly, I need to merge them (using the above as an example) to get:
    <MIM>
    <MIM-ENTRY>
    <MIM-NUMBER>123456</MIM-NUMBER>
    <Mim-title>*604176 SUPPRESSOR OF CYTOKINE SIGNALING 3</Mim-title>
    <Mim-alternative_titles_and_symbols>
    <Mim-alternative_titles_and_symbols-alt>SOCS3</Mim-alternative_titles_and_symbols-alt>
    </Mim-alternative_titles_and_symbols>
    </Mim-entry>
    </MIM>
    I have all the trees stored in a Vector as DOM objects.
    Anyone have any ideas how to merge these documents as stated?
    Any help would be most appriciated

    Ah, think im begining to get you. And if I am undertstanding you correctly it might not solve my problem.
    Ok, so the files exist as follows:
    file1.xml
    <MIN>
    <MIM-1>
    <MIM-2>something
    </MIM-2>
    </MIM-1>
    </MIM>
    file2.xml
    <MIN>
    <MIM-1>
    <MIM-3>somethingelse
    </MIM-3>
    </MIM-1>
    </MIM>
    merged to give:
    <MIN>
    <MIM-1>
    <MIM-2>something
    </MIM-2>
    <MIM-3>somethingelse
    </MIM-3>
    </MIM-1>
    </MIM>
    SO....
    I have to bring out the nodes <MIM-2> from file1.xml and import them. in file2 appendChild will be applied to <MIM1> using those nodes.
    This is really not what i was looking for.
    I wanted to throw everything together. Reason? I will be merging over 300 xml documents all of which will be inserting elements at different depths. This method you describe (i think) will need the specific nodes to be extracted from each and every DOM structure. This might not be possible as the XML stuctures will change depend on the program circumstances.
    I would like to just to put all the DOMS together and Tags of the same name will simply merge. to give the output above.
    Or does method you descibed this actually do this?
    I apologise for my stupidity in advance.
    litkid

  • Updating XML document using DOM only updates in memory

    I am trying to update an element value but it only gets updated in the memory and displayed. It does not physically change the xml document when I look after running the program.
    Here is the code I am trying to run :
    Please let me know what I am doing wrong.
    static private Document findReplace(Document document, String elementName,
    String valueToFind, String valueToReplace)
    int i;
    int k;
    NodeList children;
    Element docRoot= document.getDocumentElement(); // get root
    NodeList elements = docRoot.getElementsByTagName(elementName);
    if (elements !=null)
         for (i=0;i<elements.getLength(); i++)
         if (elements.item(i).hasChildNodes())
         children = elements.item(i).getChildNodes();
    for(k=0;k<children.getLength(); k++)
              if (children.item(k).getNodeType() ==
                   org.w3c.dom.Node.TEXT_NODE){
              if(children.item(k).getNodeValue().equals(valueToFind))
         children.item(k).setNodeValue(valueToReplace);
    Thanks !

    Document document;
                   TransformerFactory tFactory =
                    TransformerFactory.newInstance();
                   Transformer transformer = tFactory.newTransformer();
                   DOMSource source = new DOMSource(document);
                   StreamResult result = new StreamResult(new File
                   (c:/output/outputXml.xml));
                   transformer.transform(source, result);

  • 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.

Maybe you are looking for