Problem in reading XML contents

Hi all,
I have a problem in extracting a portion of the XML file.
the XML is
<x>
     <y1></y1>
     <y2>
          <value1>One</value1>
          <value2>Two</value2>
          <value3>Three</value3>     </y2>
     <y3></y3>
</x>the code i have written is
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
public class DOMParserDemo
    public static void main(String s[]){
        try{
            DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
            Document document = docBuilder.parse("doc.xml");
            NodeList nodeList = document.getElementsByTagName("y2");
            Node node = nodeList.item(0);
            NodeList nList = node.getChildNodes();
            int len = nList.getLength();
            for(int i=0; i<len; i++){
                System.out.println(nList.item(i).getNodeName());
        }catch(Exception e){
            e.printStackTrace();
} I got the result as.
#text
value1
#text
value2
#text
value3
#text
where i expect the value to be prinited in the place of #text
can any one please help me to display the content correctly.
thanks in advance
subra

This gets the element's contents - using concat from the other thread - you just need to navigate down the tree to the right depth:      NodeList nodeList = document.getElementsByTagName("y2");
      // for every y2 element
      for (int index1 = 0, length1 = nodeList.getLength(); index1 < length1; index1++) {
        final Element y2 = (Element)nodeList.item(index1);
        final NodeList y2Children = y2.getChildNodes();
        // for every child of a y2 element
        for (int index2 = 0, length2 = y2Children.getLength(); index2 < length2; index2++) {
          final Node child = y2Children.item(index2);
          // if that child node is an element node
          if (child.getNodeType() == Node.ELEMENT_NODE) {
            Element element = (Element)child;
            // print it's name, and the concatenation of any text nodes nested in it
            System.out.println(concat(element.getChildNodes(),
                                      new StringBuffer(element.getNodeName()).append(" = ")));
      }Pete

Similar Messages

  • Problem  while reading XML file from Aplication server(Al11)

    Hi Experts
    I am facing a problem while  reading XML file from Aplication server  using open data set.
    OPEN DATASET v_dsn IN BINARY MODE FOR INPUT.
    IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      READ DATASET v_dsn INTO v_rec.
    WHILE sy-subrc <> 0.
      ENDWHILE.
      CLOSE DATASET v_dsn.
    The XML file contains the details from an IDOC number  ,  the expected output  is XML file giving  all the segments details in a single page and send the user in lotus note as an attachment, But in the  present  output  after opening the attachment  i am getting a single XML file  which contains most of the segments ,but in the bottom part it is giving  the below error .
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/SHPORD_0080005842.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    for all the xml  its giving the error in bottom part ,  but once we open the source code and  if we saved  in system without changing anything the file giving the xml file without any error in that .
    could any one can help to solve this issue .

    Hi Oliver
    Thanx for your reply.
    see the latest output
    - <E1EDT13 SEGMENT="1">
      <QUALF>003</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803</NTEND>
      <NTENZ>000000</NTENZ>
      <ISDD>00000000</ISDD>
      <ISDZ>000000</ISDZ>
      <IEDD>00000000</IEDD>
      <IEDZ>000000</IEDZ>
      </E1EDT13>
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/~1922011.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    E1EDT13 with QUALF>003 and  <E1EDT13 SEGMENT="1">
    with   <QUALF>001 having almost same segment data . but  E1EDT13 with QUALF>003  is populating all segment data
    properly ,but E1EDT13 with QUALF>001  is giving in between.

  • Problem of reading the content of this .txt files

    currently i have a problem of reading the content of this file castle.txt
    #Server Ready.
    Lee Siaw Kang 50256808:08:382004/03/15Abdul Rahman 60296008:13:242004/03/15Kenneth Lee 60299308:13:532004/03/15Ho Kid Peng 31337508:17:442004/03/15Tonny Sherbern 50271108:19:132004/03/15Frederick Foh 50257908:20:212004/03/15Jason Kho 61702908:21:312004/03/15Lois Lee Liarn Huee 61897408:22:522004/03/15Victor Palau Udih 31337308:23:202004/03/15Michelle Sim 61899008:27:412004/03/15Alan Hong 50262708:30:312004/03/15Frederick Foh 50257908:33:412004/03/15Douglas Aseng 50255808:36:442004/03/15Atika Abang 31347508:36:592004/03/15David Dzrandinuraidi 61239608:38:012004/03/15Sentia Brangking 61896808:39:502004/03/15Dinah Samuel 61704608:40:582004/03/15Dr. Anderson Tiong 61702508:42:102004/03
    it is something like this ...i want to break it into readable format ...i have tried vector with is the following code.
    import java.util.*;
    import java.io.*;
    public class parseCastle {
    public static Vector parseInfo(String str) {
    int recordSize = 59;
    Vector v = new Vector();
    for (int i=0; i<str.length(); i+=recordSize) {
    String str1 = str.substring(i, i+recordSize);
    Vector vi = new Vector();
    vi.addElement(str1.substring(0, 35));
    vi.addElement(str1.substring(35, 41));
    vi.addElement(str1.substring(41, 49));
    vi.addElement(str1.substring(49, 59));
    v.addElement(vi);
    return v;
    //constructor
    parseCastle(){
    try
    FileInputStream fin = new FileInputStream("castle.txt");
    File fprop = new File("castle.txt");
    byte[] data = new byte[(int)fprop.length()];
    int total = fin.read(data);
    if (total != data.length) {
    System.err.println("Error loading file");
    return;
    //System.out.println(data.length);
    Vector v = parseInfo(new String(data));
    for (int i=0; i<v.size(); i++) {
    Vector vi = (Vector)v.elementAt(i);
    for (Enumeration e = vi.elements(); e.hasMoreElements();)
    System.out.println(e.nextElement());
    System.out.println();
    //*** Alternative ***
    //for (int k=0; k<vi.size(); k++)
    // System.out.println(vi.elementAt(k));
    catch (IOException e)
         System.out.println("Error: "+e);
         e.printStackTrace();
    But it gave me error. like it exceeds array boundary...can someone expert help me out

    You should be aware that these kind of effort always involves certain amount of risk because the proper record format is not hundred percent guaranteed. So, make sure to use properly formatted file, or genuine database instead.
    import java.io.*;
    import java.util.regex.*;
    public class ParseCastle2{
      public static void main(String[] args) throws Exception{
        String line, data;
        BufferedReader br = new BufferedReader(new FileReader("castle.txt"));
        br.readLine(); //discard #Server Ready line
        line = br.readLine();
        Pattern pat = Pattern.compile("([ .A-Za-z]+)([/0-9:]+)");
        Matcher mat = pat.matcher(line);
        Pattern subPat = Pattern.compile("(\\d+):(\\d\\d:\\d\\d)(.+)");
        while (mat.find()){
          System.out.println(mat.group()); // if name only, use group(1) ... beware trailing space
          data = mat.group(2);
          Matcher subMat = subPat.matcher(data);
          while (subMat.find()){
            System.out.println(" cdID = " + subMat.group(1));
            System.out.println(" Time = " + subMat.group(2));
            System.out.println(" Date = " + subMat.group(3));

  • Problem while reading XML File from Memory

    I want to read the data from an XML File which is residing in memory.The XML File should be read not by the name or the location of the file but by a Response String.
    So Can anybody help me out how can get this.
    I tried it with BufferedInputStream but BufferedInputStream needs InputStream as a Parameter and i am not able to get what parameter should be passed into the BufferedInputStream as the syntax of this is
    BufferedInputStream(InputStream in)
    Its very Urgent !!!
    Thanks in Advance

    I have created the parsing method.
    The code is like this.
    if(response.toString().equals("CS_NEWS_RESPONSE"))
    *//InputStream in = new BufferedInputStream(InputStream());*
    *//InputStream in = new BufferedInputStream(response.toString());*
    *//BufferedInputStream b = new BufferedInputStream(in);*
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    Document doc = docBuilder.parse(in);
              Element root = doc.getDocumentElement();
    The code will go like this....
    response.toString() is containing the response type which is the identification of that particular XML File. By using this my file is identified and after identification of this file, i should read the contents and parse them.
    Sentences in the bold are the ways. Is this the correct way ??
    Amit Will you be able to help me or is there anybody else who knows about this.
    Edited by: Monadear on Oct 5, 2007 9:37 AM

  • Problem with displaying XML Content well formatted.

    Hi all,
    I am developing a website which have one functionality to display XML content which is received from some other party.
    I am using TextArea for displaying this XML content on my webpage. As this XML content is not at all formatted it looks very ugly for a human to read.
    I want this XML content to be displayed well formatted, As Mozilla Firefox display it hierarchically and well formatted.
    Kindly give some suggestion for displaying XML well formatted on a webpage.
    Any comments from you people will help me.
    Thanks
    typurohit.

    The following link is a XML-based document. An XSL stylesheet transforms the XML document to HTML in the web browser. Feel free to grab a copy of the stylesheet to use as a guide.
    http://www.masonicartbook.com/production.htm
    Good luck!

  • Problems with reading XML files with ISO-8859-1 encoding

    Hi!
    I try to read a RSS file. The script below works with XML files with UTF-8 encoding but not ISO-8859-1. How to fix so it work with booth?
    Here's the code:
    import java.io.File;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import java.net.*;
    * @author gustav
    public class RSSDocument {
        /** Creates a new instance of RSSDocument */
        public RSSDocument(String inurl) {
            String url = new String(inurl);
            try{
                DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                Document doc = builder.parse(url);
                NodeList nodes = doc.getElementsByTagName("item");
                for (int i = 0; i < nodes.getLength(); i++) {
                    Element element = (Element) nodes.item(i);
                    NodeList title = element.getElementsByTagName("title");
                    Element line = (Element) title.item(0);
                    System.out.println("Title: " + getCharacterDataFromElement(line));
                    NodeList des = element.getElementsByTagName("description");
                    line = (Element) des.item(0);
                    System.out.println("Des: " + getCharacterDataFromElement(line));
            } catch (Exception e) {
                e.printStackTrace();
        public String getCharacterDataFromElement(Element e) {
            Node child = e.getFirstChild();
            if (child instanceof CharacterData) {
                CharacterData cd = (CharacterData) child;
                return cd.getData();
            return "?";
    }And here's the error message:
    org.xml.sax.SAXParseException: Teckenkonverteringsfel: "Malformed UTF-8 char -- is an XML encoding declaration missing?" (radnumret kan vara f�r l�gt).
        at org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1100)
        at org.apache.crimson.parser.InputEntity.fillbuf(InputEntity.java:1072)
        at org.apache.crimson.parser.InputEntity.isXmlDeclOrTextDeclPrefix(InputEntity.java:914)
        at org.apache.crimson.parser.Parser2.maybeXmlDecl(Parser2.java:1183)
        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:653)
        at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
        at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
        at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
        at getrss.RSSDocument.<init>(RSSDocument.java:25)
        at getrss.Main.main(Main.java:25)

    I read files from the web, but there is a XML tag
    with the encoding attribute in the RSS file.If you are quite sure that you have an encoding attribute set to ISO-8859-1 then I expect that your RSS file has non-ISO-8859-1 character though I thought all bytes -128 to 127 were valid ISO-8859-1 characters!
    Many years ago I had a problem with an XML file with invalid characters. I wrote a simple filter (using FilterInputStream) that made sure that all the byes it processed were ASCII. My problem turned out to be characters with value zero which the Microsoft XML parser failed to process. It put the parser in an infinite loop!
    In the filter, as each byte is read you could write out the Hex value. That way you should be able to find the offending character(s).

  • Problem in reading XML - tags in same line

    Hi All,
    I am using DOM to read XML , my problem is that.I can only read xml entries like folllowing- i.e when tags are in same line only... Please help.
    <src from-page="jsp/Home.jsp"><navigation-case><action>loginaction</action><from-outcome>true</from-outcome><to-page>jsp/WelcomePage.jsp</to-page></navigation-case><navigation-case><action>loginaction</action><from-outcome>false</from-outcome><to-page>jsp/Error.jsp</to-page></navigation-case>
    </src>
    I am not able to read following XML file-
    <src from-page="*">
    <navigation-case>
    <action>logoutaction</action>
    <from-outcome>true</from-outcome>
    <to-page>jsp/Home.jsp</to-page>
    </navigation-case>
    <navigation-case>
    <action>logoutction</action>
    <from-outcome>false</from-outcome>
    <to-page>jsp/Error.jsp</to-page>
    </navigation-case>
    </src>
    Thanks

    Thanks for your response.You are right I am not handling spaces anywhere. How to do that?
    Can you please help in doing this?
    I am posting my code also-
    parser.parse("C:/portal-config.xml");
    org.w3c.dom.Document doc = parser.getDocument();
    org.w3c.dom.NodeList srcList = doc.getElementsByTagName("src");
    for (int i = 0; i < srcList.getLength(); i++) {
    org.w3c.dom.Node sourceNode = srcList.item(i);
    if (sourceNode.getAttributes().getNamedItem("from-page").getNodeValue().equalsIgnoreCase(from)) {
    org.w3c.dom.NodeList navigationCaseList = sourceNode.getChildNodes();
    for (int j = 1; j < navigationCaseList.getLength(); j++) {
    org.w3c.dom.Node navigationCase = navigationCaseList.item(j);
    org.w3c.dom.NodeList childList = navigationCase.getChildNodes();
    System.out.println("node : " + navigationCase.getNodeName());
    System.out.println("list : " + childList.getLength());
    Node action = childList.item(0);
    int type = action.getNodeType();
    // case Node.ELEMENT_NODE :
    System.out.println("node : " + action.getNodeName()+ " "+ action.getNodeValue());
    org.w3c.dom.Node fromOutcome = action.getNextSibling();
    org.w3c.dom.Node toPage = fromOutcome.getNextSibling();
    System.out.println("fromOutcome : " + fromOutcome.getNodeName());
    System.out.println("toPage : " + toPage.getNodeName() + " " + toPage.getNodeType());
    if(action.getNodeType()==1 & fromOutcome.getNodeType()==1 & toPage.getNodeType()==1){
    String actionValue = action.getTextContent();
    String outValue = fromOutcome.getTextContent();
    System.out.println("actionValue : " + actionValue);
    System.out.println("outValue : " + outValue);
    if (actionValue.equalsIgnoreCase(action1) & outValue.equalsIgnoreCase(outcome)) {
    return toPage.getTextContent();
    Seeking your support
    Thanks

  • Problem in reading file contents in to inernal table

    i have  a problem with the archive file
    actually i have created archive files in SAP file system i stored the archive file in a external repository.
    now i like to access one of the archive file i want to read the contents of the file in to a internal table.
    the starting of the file contains some unique document number i need to able to capture that document number.
    i am able to read the contents from archive file but the contents are unknown charecters.
    i used open data set to read the contents of the file , but i cannot resolve these unknown charecters.

    Call transactions
    - SARA Archive Administration
    - AOBJ to find the read program (if exists) associated to the archive object
    More information on [Archive Administration|http://help.sap.com/saphelp_smehp1/helpdata/en/8d/3e4d70462a11d189000000e8323d3a/frameset.htm] and [Archive Development Kit|http://help.sap.com/saphelp_smehp1/helpdata/en/2a/fa0391493111d182b70000e829fbfe/frameset.htm]
    Regards,
    Raymond

  • How to read XML content from IPortalComponentRequest and parse them

    Hi ,
    I have a portal application.The application has 2 components(Comp1,comp2).
    Comp1 is JspDynpage and Comp2 is AbstractPortalComponent.
    Comp1- has a iframe element which point to the external url and has a parameter return_url.
    retrun_url has a value as url to Comp2(http://ibm0343:50000/irj/servlet/prt/portal/prtroot/NewUrlProj.NewUrlComp)
    When an event occurs in the external site,i suppose to receive XML content in return_url(ie Comp2),how can i check using the request if the received content is XML and how do i parse them.
    I have already seen blogs from Prakash singh in which it refers a xml fixed location in webserver.

    Hi Detlev,
    i am reposting this once again as the previous
    reply didnt align good.
    Thanks for your reply.The scenario is that
    My portal application has to communicate with external GIS(Graphical information system)
    service provider client application.
    They say that i have to use iframe in my portal application.
    Here is the snipet of the iframe tags.
    <iframe
    id="Nedbrowser"
    name="Nedbrowser"
    width="100%"
    height="100%"
    frameborder="no"
    marginheight="0"
    marginwidth="0"
    scrolling="no"
    style="position:absolute; top:0; left:0; width:800; height:400; z-index:100; visibility:visible"
    src="http://nbg.nedg.nl/nbgint/NBG_INT_main.asp?action=CHART&datasource=NBGMV&product=INTERNET&size_x=300&size_y=300&result_frame=Results&
    result_url=http://ibm0343:50000/irj/servlet/prt/portal/prtroot/NewUrlProj.NewUrlComp&
    default_centre_x=256000&default_centre_y=471000&default_width=0.5">
    </iframe>
    <iframe
    id="Results"
    name="Results"
    width="100%"
    height="100%"
    frameborder="no"
    marginheight="0"
    marginwidth="0"
    scrolling="no"
    style="position:absolute; top:400; left:0; width:800; height:200; z-index:100; visibility:visible"
    src="about:blank">
    </iframe>
    When my portal application is started, comes the GIS map in the iframe with in my portal application.
    When the user clicks in the area of the map,Gis application returns xml data to the return_url.
    The reurn_url is my PortalAbstractComponent in which i have to parse the xml and use it for further processing in R3 system.

  • Problem in reading net content from java on unix environment

    Friends,
    I was trying to write sample java program which can able to connect to web and read the content.
    But facing some proble. Kindly help me
    package com.validate.email;
    import java.net.*;
    import java.io.*;
    public class ReadWSDL {
      public static void main(String args[]){
           String nextLine;
           URL url = null;
           URLConnection urlConn = null;
           InputStreamReader  inStream = null;
           BufferedReader buff = null;
           try{
                System.setProperty("http.proxyHost","proxy.resources.company.com");
                System.setProperty("http.proxyPort", "80");
              // Create the URL obect that points
              // at the default file index.html
              url  = new URL("http://ws.cdyne.com/emailverify/Emailvernotestemail.asmx?wsdl" );
              urlConn = url.openConnection();
             inStream = new InputStreamReader(
                               urlConn.getInputStream());
               buff= new BufferedReader(inStream);
           // Read and print the lines from index.html
            while (true){
                nextLine =buff.readLine(); 
                if (nextLine !=null){
                    System.out.println(nextLine);
                else{
                   break;
         } catch(MalformedURLException e){
           System.out.println("Please check the URL:" +
                                               e.toString() );
         } catch(IOException  e1){
          System.out.println("Can't read  from the Internet: "+
                                              e1.toString() );
    Error
    Can't read from the Internet: java.net.UnknownHostException: www.tpisoft.com

    my_forum wrote:
    The same code is working in Windows, where I get the proxy from Browser.How?
    But on Unix machine it is not working. And I am using the proxy which is DNS/hostname of the unix machine.Don't you mean the DNS/hostname of the proxy?

  • XMLType - client problem on reading XML?

    When I execute this function in my 9.2.0.7.0 database:
    create or replace function get_study_xml (p_study_id in number)
    return xmltype is xml_doc xmltype;
    begin
      execute immediate '
        select xmlelement(
          ...lots of code...
      from XML_STUDY_VIEW where STUDY_ID = '||p_study_id||'' into xml_doc;
    return xml_doc;
    end get_study_xml;I get the following error with a 9.2.0.1.0 client:
    ORA-03118: two-task coroutine has invalid stateAnd the following error with a 9.2.0.3.0 client:
    ORA-21500: internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]And finally the following error with a 9.2.0.7.0 client:
    ORA-24909: call in progress. Current operation cancelledI've done lots of investigation, and so far I've deduced the following:
    * It works fine on a PC with a 10g client
    * The function returns the XMLType successfully (it seems)
    * On all clients, the error occurs not on returning the XMLType, but on trying to read the XML within.
    I am trying to do this via Delphi components from Allround Automations (makers of PL/SQL Developer). I don't know how to output the XML to DBMS Output, so could do with some help there. If I could test it without using Allround's components, I could isolate the problem.
    I suspect the problem is not with the components though but with the OCI/client, because the same components work fine on 10g client.
    If someone could help give some suggestions, including how I could try to output the XML in SQL*Plus, it would be greatly appreciated.
    Best regards,
    Gary
    I don't know if it's relevent, but it may be worth noting that the SQL statement I've commented out is fairly massive, but even if I query data that produces a tiny XML object (i.e. hardly any data), it still fails. The full function is below, so you can see what I'm doing:
    create or replace function get_study_xml (p_study_id in number)
    return xmltype is xml_doc xmltype;
    begin
    execute immediate '
    select xmlelement(
      "STUDY",
      xmlforest(STUDY_ID, '||columnsforest('XML_STUDY_VIEW')||')
        select xmlagg(
          xmlelement(
            "STUDYHEADING",
            xmlforest('||columnsforest('XML_STUDYHEADING_VIEW')||')
        from XML_STUDYHEADING_VIEW where STUDY_ID = '||p_study_id||'
        select xmlelement(
          "TESTSUBSTANCE",
          xmlforest('||columnsforest('XML_TESTSUBSTANCE_VIEW')||')
        from XML_TESTSUBSTANCE_VIEW where STUDY_ID = '||p_study_id||'
        select xmlagg(
          xmlelement(
            "STRAIN",
            xmlforest('||columnsforest('XML_STRAIN_VIEW')||')
        from XML_STRAIN_VIEW where STUDY_ID = '||p_study_id||'
        select xmlagg(
          xmlelement(
            "POSITIVECONTROL",
            xmlforest('||columnsforest('XML_POSCTRL_VIEW')||')
        from XML_POSCTRL_VIEW where STUDY_ID = '||p_study_id||'
        select xmlagg(
          xmlelement(
            "SOLVENT",
            xmlforest('||columnsforest('XML_SOLVENT_VIEW')||')
        from XML_SOLVENT_VIEW where STUDY_ID = '||p_study_id||'
        select xmlagg(
          xmlelement(
            "POSTFIX",
            xmlforest('||columnsforest('XML_POSTFIX_VIEW')||')
        from XML_POSTFIX_VIEW where STUDY_ID = '||p_study_id||'
        select xmlagg(
          xmlelement(
            "EXPERIMENTFOLDER",
            xmlforest(FOLDER_ID,'||columnsforest('XML_EXPTFOLDER_VIEW')||'),(
              select xmlagg(
                xmlelement(
                  "EXPERIMENT",
                  xmlforest(EXPT_ID,'||columnsforest('XML_EXPERIMENT_VIEW')||'),(
                    select xmlagg(
                      xmlelement(
                        "EXPERIMENTHEADING",
                        xmlforest('||columnsforest('XML_EXPTHEADING_VIEW')||')
                    from XML_EXPTHEADING_VIEW h where h.EXPT_ID = e.EXPT_ID
                    select xmlagg(
                      xmlelement(
                        "EXPERIMENTSTRAIN",
                        xmlforest('||columnsforest('XML_EXPTSTRAIN_VIEW')||'),(
                          select xmlagg(
                            xmlelement(
                              "PLATE",
                              xmlforest('||columnsforest('XML_EXPTPLATE_VIEW')||'),(
                                select xmlagg(
                                  xmlelement("POSTFIX",CODE_ID)
                                from XML_PLATEPOSTFIX_VIEW x where x.PLATE_ID = p.PLATE_ID
                                and x.FOLDER_ID = f.FOLDER_ID
                          from XML_EXPTPLATE_VIEW p where p.EXPT_ID = e.EXPT_ID
                          and p.STRAIN_CODE = s.STRAIN_CODE
                          and p.PLATE_TYPE = 0                         
                    from XML_EXPTSTRAIN_VIEW s where s.EXPT_ID = e.EXPT_ID
              from XML_EXPERIMENT_VIEW e where e.STUDY_ID = '||p_study_id||'
              and f.folder_id = e.folder_id  
              select xmlagg(
                xmlelement(
                  "CONTROL",
                  xmlforest('||columnsforest('XML_CONTROL_VIEW')||'),(
                    select xmlagg(
                      xmlelement(
                        "CONTROLPLATE",
                        xmlforest('||columnsforest('XML_CONTROLPLATE_VIEW')||'),(
                          select xmlagg(
                            xmlelement("POSTFIX",CODE_ID)
                          from XML_PLATEPOSTFIX_VIEW x where x.PLATE_ID = p.PLATE_ID
                          and x.FOLDER_ID = f.FOLDER_ID
                    from XML_CONTROLPLATE_VIEW p where p.CONTROL_ID = c.CONTROL_ID
                    and p.PLATE_TYPE > 0
              from XML_CONTROL_VIEW c where c.STUDY_ID = '||p_study_id||'
              and f.folder_id = c.folder_id  
        from XML_EXPTFOLDER_VIEW f where f.STUDY_ID = '||p_study_id||'
    from XML_STUDY_VIEW where STUDY_ID = '||p_study_id||'' into xml_doc;
    return xml_doc;
    end get_study_xml;

    This may be related to bug 3396162 but I'm not sure I fully understand the implications of this bug, or the cirumstances under which it can arise.
    Getting back to the basic problem. Can you reproduce the problem with by calling your PL/SQL from a 9.2.0.7.0 SQL*PLUS.
    I'm not familar with Delphi. Is it Java or 'C' based. Is it using an OCI connection. If so does it bind to the latest Oracle Installation or does it embed the Oracle OCI components. If the later do you know which version of OCI is embedded ?
    WRT to dumping to DBMS_OUTPUT the following is a somewhat of a work in progress...
    create or replace package XDB_XML_OUTPUT_10200
    AUTHID CURRENT_USER
    as
      procedure put_xml(myXML XMLType);
      procedure processNode(INDENT VARCHAR2, NODE DBMS_XMLDOM.DOMNODE);
    end;
    create or replace package body XDB_XML_OUTPUT_10200
    as
      currentLine CLOB;
      wipBuffer CLOB;
      printBuffer CLOB;
      currentNode pls_integer;
      elementClosed boolean;
    procedure outputBuffer(buffer in out nocopy CLOB)
    as
    begin
      dbms_output.put_line(buffer);
      dbms_lob.trim(buffer,0);
    end;
    procedure putNode(INDENT varchar2, NODE DBMS_XMLDOM.DOMNODE)
    as
      byteCount pls_integer;
    begin
      if (currentNode = DBMS_XMLDOM.ELEMENT_NODE) then
        outputBuffer(currentLine);
      end if;
      byteCount := length(INDENT);
      dbms_lob.writeAppend(currentLine,byteCount,INDENT);
      dbms_lob.trim(printBuffer,0);
      dbms_xmldom.writeToCLOB(node,printBuffer);
      dbms_lob.append(currentLine,printBuffer);
    end; 
    procedure putAttribute(NODE DBMS_XMLDOM.DOMNODE)
    as
      buffer varchar2(32767);
      byteCount pls_integer;
    begin
      dbms_lob.trim(printBuffer,0);
      dbms_xmldom.writeToCLOB(node,printBuffer);
      dbms_lob.trim(wipBuffer,0);
      buffer := ' ' || DBMS_XMLDOM.GETNODENAME(NODE) || '="';
      byteCount := length(buffer);
      dbms_lob.writeAppend(wipBuffer,byteCount,buffer);
      dbms_lob.append(wipBuffer,printBuffer);
      byteCount := 1;
      dbms_lob.writeAppend(wipBuffer,byteCount,'"');
      dbms_lob.append(currentLine,wipBuffer);
    end; 
    procedure putAttributes(ATTRS DBMS_XMLDOM.DOMNAMEDNODEMAP)
    as
      ATTRNODE  DBMS_XMLDOM.DOMNODE;
    begin
      for i in 0..DBMS_XMLDOM.GETLENGTH(ATTRS)-1 loop
        ATTRNODE := DBMS_XMLDOM.ITEM(ATTRS,I);
        putAttribute(ATTRNODE);
      end loop;
    end;
    procedure printText(NODE DBMS_XMLDOM.DOMNODE)
    as
      byteCount pls_integer;
      buffer varchar2(1);
    begin
      buffer := '>';
      byteCount := length(buffer);
      dbms_lob.writeAppend(currentLine,byteCount,buffer);
      dbms_lob.trim(printBuffer,0);
      dbms_xmldom.writeToCLOB(NODE,printBuffer);
      dbms_lob.append(currentLine,printBuffer);
      currentNode := DBMS_XMLDOM.TEXT_NODE;
    end; 
    procedure startElement(INDENT varchar2, NODE DBMS_XMLDOM.DOMNODE, ATTRS DBMS_XMLDOM.DOMNAMEDNODEMAP)
    as
      byteCount pls_integer;
      buffer varchar2(32767);
    begin 
      if (not elementClosed) then
        buffer := '>';
        byteCount := 1;
        dbms_lob.writeAppend(currentLine,byteCount,buffer);
      end if;
      elementClosed := false;
      -- Start a new Element : Flush the buffer
      outputBuffer(currentLine);
      dbms_lob.trim(wipBuffer,0);
      buffer := INDENT || '<' || DBMS_XMLDOM.GETNODENAME(NODE);
      byteCount := length(buffer);
      dbms_lob.writeAppend(currentLine,byteCount,buffer);
      putAttributes(ATTRS);
      currentNode := DBMS_XMLDOM.ELEMENT_NODE;
    end;
    procedure endElement(INDENT varchar2, NODE DBMS_XMLDOM.DOMNODE)
    as
      byteCount pls_integer;
      buffer varchar2(32767);
    begin
      if (elementClosed) then
        outputBuffer(currentLine);
        buffer :=  INDENT || '</' || DBMS_XMLDOM.GETNODENAME(NODE) || '>';
        byteCount := length(buffer);
        dbms_lob.writeAppend(currentline,byteCount,buffer);
      else
        if (currentNode = DBMS_XMLDOM.ELEMENT_NODE) then
          buffer := '/>';
          byteCount := length(buffer);
          dbms_lob.writeAppend(currentline,byteCount,buffer);
        else
          buffer := '</' || DBMS_XMLDOM.GETNODENAME(NODE) || '>';
          byteCount := length(buffer);
          dbms_lob.writeAppend(currentline,byteCount,buffer);
        end if;
      end if;
      currentNode := DBMS_XMLDOM.ELEMENT_NODE;
      elementClosed := true;
    end;
    procedure processChildren(INDENT varchar2, NODE DBMS_XMLDOM.DOMNODE)   
    as
      CHILDREN DBMS_XMLDOM.DOMNODELIST;
      CHILD    DBMS_XMLDOM.DOMNODE;
    begin
      CHILDREN := DBMS_XMLDOM.GETCHILDNODES(NODE);
      for i in 0..DBMS_XMLDOM.GETLENGTH(CHILDREN)-1 loop
        CHILD  := DBMS_XMLDOM.ITEM(CHILDREN,I);
        processNode(INDENT , CHILD);
      end loop;
    end;
    procedure processNode(INDENT VARCHAR2, NODE DBMS_XMLDOM.DOMNODE)
    as
      newIndent varchar2(256) := INDENT || '  ';
    begin
      -- ENTITY_REFERENCE_NODE
      -- ENTITY_NODE
      -- DOCUMENT_TYPE_NODE
      -- DOCUMENT_FRAGMENT_NODE
      -- NOTATION_NODE
      if (DBMS_XMLDOM.GETNODETYPE(NODE) = DBMS_XMLDOM.COMMENT_NODE) then
        putNode(INDENT,NODE);
      end if;
      if (DBMS_XMLDOM.GETNODETYPE(NODE) = DBMS_XMLDOM.PROCESSING_INSTRUCTION_NODE ) then
        putNode(INDENT,NODE);
      end if;
      if (DBMS_XMLDOM.GETNODETYPE(NODE) = DBMS_XMLDOM.CDATA_SECTION_NODE) then
        putNode(INDENT,NODE);
      end if;
      if (DBMS_XMLDOM.GETNODETYPE(NODE) = DBMS_XMLDOM.TEXT_NODE) then
        printText(NODE);
      end if;
      if (DBMS_XMLDOM.GETNODETYPE(NODE) = DBMS_XMLDOM.ATTRIBUTE_NODE) then
        putAttribute(NODE);
      end if;
      if (DBMS_XMLDOM.GETNODETYPE(NODE) = DBMS_XMLDOM.ELEMENT_NODE) then
        startElement(INDENT,NODE,DBMS_XMLDOM.GETATTRIBUTES(NODE));
        processChildren(newIndent, NODE);
        endElement(INDENT,NODE);
      end if;
      if (DBMS_XMLDOM.GETNODETYPE(NODE) = DBMS_XMLDOM.DOCUMENT_NODE) then
        processChildren(INDENT,NODE);
      end if; 
    end;
    procedure put_xml(myXML XMLType)
    as
      doc DBMS_XMLDOM.DOMDOCUMENT;
    begin
      DBMS_LOB.createTemporary(currentLine,true,DBMS_LOB.SESSION);
      DBMS_LOB.createTemporary(wipBuffer,true,DBMS_LOB.SESSION);
      DBMS_LOB.createTemporary(printBuffer,true,DBMS_LOB.SESSION);
      doc := DBMS_XMLDOM.NEWDOMDOCUMENT(myXML);
      processNode('#',DBMS_XMLDOM.MAKENODE(doc));
      outputBuffer(currentLine);
      DBMS_LOB.freeTemporary(printBuffer);
      DBMS_LOB.freeTemporary(wipBuffer);
      DBMS_LOB.freeTemporary(currentLIne);
    end;
    end;
    /

  • Problem while reading xml data

    private var _xlimData:XML=
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <fo:layout-master>sample-layout</fo:layout-master>
    </fo:root>
    var fo:Namespace = new Namespace(http://www.w3.org/1999/XSL/Format);
    public function readXlim():void
    Alert.show(_xlimData..fo::layout-master);
    I am unable to read the data because of Hyphen(-) in 'layout-master' .But placing Hyphen(-) is must .Please solve my problem

    var fo:Namespace = new Namespace("http://www.w3.org/1999/XSL/Format");
    Alert.show(String(_xlimData.fo::["layout-master"]));
    Off topic: Please don't spam my blog next time. If you are facing a problem, please post your questions here so that others can also learn from the example in case they run into the same problem. Thanks.

  • Problem in reading xml file from server

    Hi,
    I am using tomcat 4.1 and jdk 1.4.
    All the class files and xml files are put into the one jar file.
    While running our application a jar file is called from jsp file. in that file we are embedded applet coding. here by i am sending my applet code with this...
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    WIDTH = "500" HEIGHT = "500" codebase="http://java.sun.com/products/plugin/1.2/jinstall-12-win32.cab#Version=1,2,0,0">
    <PARAM NAME = CODE VALUE = "Screen.class" >
    <PARAM NAME = CODEBASE VALUE = "/Sample/web/" >
    <PARAM NAME = ARCHIVE VALUE = "csr.jar" >
    </NOEMBED></EMBED>
    </OBJECT>
    while running our application from another machine we are getting exception filenotfounfexception in the xml is in the generated jar file.
    Exception:
    org.xml.sax.SAXParseException: File "file:///C:/Documents and Settings/Administrator/Desktop/control_property.xml" not found.
    but that xml file is in the jar file and that jar file is present under sample application folder.
    what should i change in the applet code? is there any thing related to trusted applet ?
    Thanks

    You have the xml file in the jar so it is a resource?
    http://java.sun.com/docs/books/tutorial/uiswing/misc/icon.html#getresource
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/ClassLoader.html#getResource(java.lang.String)

  • Read XML content in ABAP

    Hi Experts,
    I have a requirement, where I need to Parse the XML file after reading it from application server. Based on the data, I need to add some Tags to XML data.
    Can we achieve the solution in ABAP.
    Request your expertise.
    Thank you,
    Amit

    Hi Amit,
    Yes, you can achieve this in SAP either by creating a DOM representation of the XML document, or by the parser firing events as logical elements are encountered in a run through an XML document.
    Refer the following documents for more details.
    DOM-based method - Parsing an XML document DOM-based - Application Development on AS ABAP - SAP Library 
    Event Based - Parsing an XML document event-based - Application Development on AS ABAP - SAP Library 
    Refer this document for sample code - Parse an xml file and insert values in ABAP - ABAP Development - SCN Wiki
    Regards
    Anoop

  • Displaying XML content in one line in pdf

    Hi,
    I am using OBIP for report generation, i am facing a problem regarding to xml content
    In XML the content is displaying like
    <OmbudsmanAdrress>Shri V. Ramasaamy,
    Insurance Ombudsman,
    Office of the Insurance Ombudsman,
    Fathima Akhtar Court,
    4th Floor, 453 (old 312),
    Anna Salai, Teynampet,
    CHENNAI-600 018,
    Fax : 044-24333664,
    Email [email protected]</OmbudsmanAdrress>
    but i need to show only in one line in pdf.
    how can i will get in one line
    please suggest me....
    Thanks in advance,
    Vijay Chunduri.

    Finally after a long struggle i got the answer...
    Here it is buddies...
    <?xdofx:replace(OmbudsmanAdrress,’,\n’ ,',')?>

Maybe you are looking for

  • In-App-Purchase is not working properly at Mountain Lion

    Hi, I am using Mountain Lion pre-release version. I am developing a cocoa application which uses In -App-Purchase. The In-App-Purchase is working fine on OS X 10.7.4, when I run the same code on Mountain Lion, the application freezes and I have to fo

  • Regarding invoice blocked for payment

    Hello gurus I have done the MIRO and invoice is blocked say any reason now when i check the F-53 and make a payment for the this it is working fine where i can able to make a payment for this the requirement is when the invoice is blocked the RE invo

  • 17" MBP Shipping in 1 to 2 days from CompUSA ?

    Can anyone confirm this? Is this a sign the 17" MBP are soon here? http://www.compusa.com/products/productinfo.asp?productcode=51764571&pfp=SEARCH   Windows XP  

  • Annoying problem with my magic mouse

    Each time I remove the batteries to recharge, I have to detect the mouse manually after putting them back. Is there anyway that it it auto-detected (like my keyboard)? To do this, I always need another wired mouse. Is it possible to use keyboard shor

  • I get an error message to contact cust support when installing CS4 Design Premium on windows 8

    the install begins normally but the following message appeards and will not let me bypass.  I have a new windows 8 laptop that i am trying to install on. Error Message: Setup Error Setup has encountered an error and cannot continue.  Contact Adobe Cu