Help with DOM Parser

Hello! I am writing a JRXML file with XML extension and trying to parse using DOM Parser.But I am getting the following Exception:
java.net.UnknownHostException: jasperreports.sourceforge.net
     at java.net.PlainSocketImpl.connect(Unknown Source)
     at java.net.Socket.connect(Unknown Source)
     at java.net.Socket.connect(Unknown Source)
     at sun.net.NetworkClient.doConnect(Unknown Source)
     at sun.net.www.http.HttpClient.openServer(Unknown Source)
     at sun.net.www.http.HttpClient.openServer(Unknown Source)
     at sun.net.www.http.HttpClient.<init>(Unknown Source)
     at sun.net.www.http.HttpClient.New(Unknown Source)
     at sun.net.www.http.HttpClient.New(Unknown Source)
     at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
     at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
     at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
     at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
     at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
     at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
     at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
     at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
     at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
     at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
     at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
     at net.zycomm.reportGeneration.source.WriteJrxml.<init>(<myfilename.java>.java:44)
     at net.zycomm.reportGeneration.source.WriteJrxml.main(<myfilename.java>).
I need another answer:How can I parse a JRXML file?

it is a network problem, I think the DNS of your provider is not up to date so it cannot find the domain.
There must be a schema declaration at the beginning of your JRXML file. It points to a schema situated on the jasper site (which has changed recently).
The better turnaround is to find this schema, place it on your local file system (or in server's hierarchy) and to change the schema definition in the jrxml file to point to the local file

Similar Messages

  • Simple help with DOM parsing - urgent

    hi,
    i'm new to xml parsing and have a simple (i think) question.
    i have the following xml
    <record>
    <header>
    <id>1</id>
    </header>
    </record>
    <record>
    <header>
    <id>1</id>
    </header>
    </record>
    i'm trying to parse first the records then from a record parse the header and from it get the id in the following way:
    NodeList nodeList = org.apache.xpath.XPathAPI.selectNodeList(doc, "//*[name() = 'record']");
    for every element i in the nodeList
    Node node1 = nodeList.item(i);
    Node node2 = org.apache.xpath.XPathAPI.selectSingleNode(node, "//*[name() = 'header']");
    Node node3 = org.apache.xpath.XPathAPI.selectSingleNode(node2, "//*[name() = 'id]");
    String id = node3.getFirstChild().getNodeValue();
    even due i run in a loop and i see node1 containing the right record the other parsing gives me the always the data of the first record.
    can't i parse and then re-parse on the node i got?
    if the second parsing always done from the root, even due i gave the parser another node?
    what am i doing wrong?
    thanks in advance
    alon

    Your xpath & everything else looks right. I have 2 questions...
    1 -- what is the length of NodeList nodeList = org.apache.xpath.XPathAPI.selectNodeList(doc, "//*[name() = 'record']"); ?
    The answer should be 2, you have 2 record from the XML
    2 -- both id of your record is 1. Are you seeing the same value returned because of this? What do you see if you change the second record's id to 2 ??

  • Help With String parsing

    Hey guys,
    I need some help with String Parsing. i hope experts here will help me.
    i'm reading a text file and getting data as String in this format
    *ABR, PAT MSSA        2009       7001    B   ABC       Y
    *VBR, SAT ZSSA        2008       5001    A   CED       N
    *ABC, AAT CSSA        5008       001     A   AZX       N
    *CBC, CAT FSSA        308        5001    A   XCV       N
    Now from following lines i have to extract Number data i.e. 2009 and 7001 from 1st line. 2008 and 5001 from 2nd line and so on.
    Can anyone pls suggest me any way to get the data that i want from these Strings
    Thanks for your time to read this.
    Regards,
    sam

    Thanks for the reply
    Data length can vary. ABR, PAT is the last name, First Name of the Users.
    it can be following or any other combination. i just need 2 set of numbers from the complete line rest i can ignore. Any other way to get that
    *ABRaaassd, PATfffff MSSA 2009 7001 B ABC Y
    *VBRaa, SATaa ZSSA 2008 5001 A CED N
    *ABC, AAT CSSA 5008 001 A AZX N
    *CBC, CAT FSSA 308 5001 A XCV N                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • PLEASE help with JavaScript parsing of WSDL return

    Can someone help with parsing return WSDL data?
    My return WSDL data is a concatenated string of alias names (firstname middlename lastname generation) delininated with an "@":
    7433|ALIAS|John|W|Smith| @7432|ALIAS|Johnny| |Smith| @7430|ALIAS|JJ| |Smithers| @7431|ALIAS|JJ| |Smith| @7400|ALIAS|Jon| |Smith| @7416|ALIAS|John|Wilber|Smith|JR
    I must have these names appear on my forms in a "lastname, firstname middlename generation" format. Can anyone provide expertise in this area if I provide the table.column reference?
    alias.alternate_id = tmp[0];
    alias.type = tmp[1];
    alias.firstname = tmp[2];
    alias.middlename = tmp[3];
    alias.lastname = tmp[4];
    alias.generation = tmp[5];

    Can someone help with parsing return WSDL data?
    My return WSDL data is a concatenated string of alias names (firstname middlename lastname generation) delininated with an "@":
    7433|ALIAS|John|W|Smith| @7432|ALIAS|Johnny| |Smith| @7430|ALIAS|JJ| |Smithers| @7431|ALIAS|JJ| |Smith| @7400|ALIAS|Jon| |Smith| @7416|ALIAS|John|Wilber|Smith|JR
    I must have these names appear on my forms in a "lastname, firstname middlename generation" format. Can anyone provide expertise in this area if I provide the table.column reference?
    alias.alternate_id = tmp[0];
    alias.type = tmp[1];
    alias.firstname = tmp[2];
    alias.middlename = tmp[3];
    alias.lastname = tmp[4];
    alias.generation = tmp[5];

  • Please Help with text parsing problem

    Hello,
    I have the following text in a file (cut and pasted from VI)
    12 15 03 12 15 03 81 5 80053 1 1,2,3 $23.00 1 ^M
    12 15 03 12 15 03 81 5 84550 1 1,2,3 $15.00 1 ^M
    12 15 03 12 15 03 81 5 84100 1 1,2,3 $15.00 1 ^M
    12 15 03 12 15 03 81 5 83615 1 1,2,3 $15.00 1 ^M
    12 15 03 12 15 03 81 5 82977 1 1,2,3 $15.00 1 ^M
    12 15 03 12 15 03 81 5 80061 1 1,2,3 $44.00 1 ^M
    12 15 03 12 15 03 81 5 83721 1 1,2,3 $15.00 1 ^M
    12 15 03 12 15 03 81 5 84439 1 1,2,3 $44.00 1 ^M
    12 15 03 12 15 03 81 5 84443 1 1,2,3 $40.00 1 ^M
    12 15 03 12 15 03 81 5 85025 1 1,2,3 $26.00 1 ^M
    12 15 03 12 15 03 81 5 85008 1 1,2,3 $5.00 1 ^M
    this method reads the text from a file and stores it in a ArrayList
        public ArrayList readInData(){
            File claimFile = new File(fullClaimPath);
            ArrayList returnDataAL = new ArrayList();
            if(!claimFile.exists()){
                System.out.println("Error: claim data - File Not Found");
                System.exit(1);
            try{
                BufferedReader br = new BufferedReader(new FileReader(claimFile));
                String s;
                while ((s = br.readLine()) != null){
                         System.out.println(s + " HHHH");
                        returnDataAL.add(s);
            }catch(Exception e){ System.out.println(e);}
            return returnDataAL;
        }//close loadFile()if i print the lines from above ... from the arraylist ... here is waht i get ...
    2 15 03 12 15 03 81 5 80053 1 1,2,3 $23.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 84550 1 1,2,3 $15.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 84100 1 1,2,3 $15.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 83615 1 1,2,3 $15.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 82977 1 1,2,3 $15.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 80061 1 1,2,3 $44.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 83721 1 1,2,3 $15.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 84439 1 1,2,3 $44.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 84443 1 1,2,3 $40.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 85025 1 1,2,3 $26.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 85008 1 1,2,3 $5.00 1 HHHH
    HHHH
    I see the ^M on the end of the lines ... but i dont understand why im getting the blank lines
    in between each entry ... I printed "HHHH" just to help with debugging ... anyone have any ideas why i am getting the extra blank lines?
    thanks,
    jd

    maybe its a FileReader deal.. Im not sure, maybe try using InputStreams. This code works for me (it reads from data.txt), give it a try and see if it works:
    import java.io.*;
    public class Example {
         public Example() throws IOException {
              BufferedReader b = new BufferedReader(new InputStreamReader(new FileInputStream("data.txt")));
              String s = "";
              while ((s = b.readLine()) != null) {
                   System.out.println(s);
              b.close();
         public static void main(String[] args) {
              try {
                   new Example();
              catch (IOException e) {
                   e.printStackTrace();
    }

  • Need help with DOM

    I got the following code from the Java DOM walkthrough. I am trying to enhance it. I want to build an XML file with my DOM. and then right the new XML to a file. I want to learn how to do it. It's not about being efficient.
    How do I add child elements to this with child tags and then give them values? If you look at the code, it creates a root, then appends a 'child', but I don't see how its giving the child an element name. it just looks like its giving it a value.
       public static void buildDom()
            DocumentBuilderFactory factory =
               DocumentBuilderFactory.newInstance();
            try {
              DocumentBuilder builder = factory.newDocumentBuilder();
              document = builder.newDocument();  // Create from whole cloth
              Element root =
                      (Element) document.createElement("rootElement");
              document.appendChild(root);
              root.appendChild( document.createTextNode("Some") );
              root.appendChild( document.createTextNode(" ")    );
              root.appendChild( document.createTextNode("text") );
            } catch (ParserConfigurationException pce) {
                // Parser with specified options can't be built
                pce.printStackTrace();
        } //

    If you're looking to build up simple documents, Dom4J might be your best choice: http://www.dom4j.org/
    Combining two examples from their Quick Start guide, here's the code to do what you want (note: it hasn't been compiled, just copied from the Dom4J website with some strings changed):
    import org.dom4j.Document;
    import org.dom4j.DocumentHelper;
    import org.dom4j.Element;
    import org.dom4j.io.OutputFormat;
    import org.dom4j.io.XMLWriter;
    public class Foo {
        public Document createDocument() {
            Document document = DocumentHelper.createDocument();
            Element root = document.addElement( "root" );
            Element value1 = root.addElement( "value1" )
                .addText( "myVal " );
            Element author2 = root.addElement( "value2" )
                .addText( "myVal2" );
            return document;
    public void write(Document document) throws IOException {
            // Pretty print the document to System.out
            OutputFormat format = OutputFormat.createPrettyPrint();
            writer = new XMLWriter( System.out, format );
            writer.write( document );
    }

  • Need help with input, parsing, and loop in one program

    I am doing an assignment that is supposed to:
    # ask the user for a URL
    # For the entered URL, read all the HTML text from the page and extract all links (other URLs) and image names. These should be printed to the console window.
    # Reprompt for a URL until the user presses the cancel button.
    # Define at least one helper method that serves a practical purpose that your main method will use. Note that your method(s) should serve a useful purpose, and it should make sense that they are separated out from the main method.
    So far, I figured out how to ask if the user would like to play again, though I can't make it loop to play again. The "NO_OPTION" works fine and exits out.
    I cannot figure out at all how to ask for the URL and then use that URL to try to parse the HTML to find the links and pictures.
    for the loop, is it:
    do{
    ...//all the stuff//
    }while (option == JOptionPane.YES_OPTION) ?(I think I have to parse, looking for "img src" and "a href", anyway)
    The biggest thing I'm getting hung up about is where to start. All it'll do is ask for the URL, say there is an error, and ask if I want to do it again. Don't know how to make it loop again. Like I said, I think it's a do while loop but am not completely sure where it goes and how to have it work on the entire thing with message dialoge boxes
    To ask for the input, I was trying to make the dialoge box a string so the string would be displayed and have the links extracted
    String linkString=   
              JOptionPane.showInputDialog("Please enter a URL:");...but it obviously doesn't work like that...
    Here is the whole mess so far...I don't know what my question is because I know what I want, just not the terms to ask. help?
    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.net.URL;
    import java.net.URLConnection;
    import javax.swing.JOptionPane;
    public class WebPageExaminer
         public static void main(String[] args)
              String linkString=   
              JOptionPane.showInputDialog("Please enter a URL:");
        String link = null;
        URL url;
        URLConnection urlC;
        InputStream inStream;
        InputStreamReader inStreamReader;
        BufferedReader reader;
        try
        url = new URL(link);
        urlC = url.openConnection();
        inStream = urlC.getInputStream();
        inStreamReader = new InputStreamReader(inStream);
        reader = new BufferedReader(inStreamReader);
        String inputLine = reader.readLine();
        while (inputLine != null)
          System.out.println(inputLine);
          inputLine = reader.readLine();
        catch(Exception e)
          JOptionPane.showMessageDialog(null, "Error reading from file");
        } int answer = JOptionPane.showConfirmDialog(null, "Examine Another URL?", "Click Yes or NO:", JOptionPane.YES_NO_OPTION);
        if (answer == JOptionPane.NO_OPTION)
             System.out.println("Goodbye");
             System.exit(0);
              if (answer == JOptionPane.YES_OPTION)
                  System.out.println("OK!");
    }Edited by: digital.tradecraft on Mar 14, 2009 1:27 PM

    You posted the questions 20 minutes ago? Why are you bumping it. People answer questions when they know the answer.
    I tend to ignore people who expect an immediate answer.

  • Newbie Help With File Parser

    I have an assignment that involves using Java to parse the info on one text file and output to another text file with a header row and a data row both of which need to be tab delimited. I'm relatively new to Java and I'm having a hard time even starting this thing. Any help would be greatly appreciated. The file I have to read from is similar to this:
    Report: Fake Report for Fake Loans
    Report ID: 000001
    Run Date: 04/25/2007
    Office Number ID Number DelqMessage
    033 000101000 N
    034 001234875 Y
    035 123456789 N
    I would essentially need to get all the field names into the header row and the data in the row below it.
    Thanks in advance.

    I have been working on this and I almost have it working correctly. I was able to selectively pull the info I need from the original file and I can output to the new file in a vertical form. The last step is to output a header that says RunDate Office Loan DelqMessage with a tab delimiter. I than have to compile the data and output in rows under the header also in tab delimited format. I think I'm right there but I still get one error I cannot resolve of:
    Error: java.lang.StringIndexOutOfBoundsException: String index out of range: 4
    It is very vague and I have tried everything I can think of to locate the issue so it can be debugged. Below is a copy of the file I'm trying to parse followed by what I have for code so far. Any help would be greatly appreciated.
    Sample of report:
    Report: Fake Report for Fake Loans
    Report ID: 000001
    Run Date: 04/25/2007
    ASC Number Loan ID DelqMessage
    033 000101000 N
    034 001234875 Y
    035 123456789 N
    ASC Number Loan ID DelqMessage
    036 741258963 N
    037 872563987 N
    038 987521455 Y
    ======================================================================
    Fake Report Summary:
    ASC Total: 6
    Loan Total: 6
    Total Delq: 2
    Code:
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.BufferedReader;
    import java.io.PrintWriter;
    import java.io.IOException;
    public class ParseFile {
    public static void main(String[] args) throws IOException {
         // Variable Declaration
         boolean procOn;
         String RunDate = "";
         BufferedReader inputStream = null;
    PrintWriter outputStream = null;
         // Following block of code parses FakeReportToParse.txt and outputs
         // needed portions of the report to characteroutput.txt
    try {
         procOn=false;
         inputStream =
    new BufferedReader(new FileReader("FakeReportToParse.txt"));
    outputStream =
    new PrintWriter(new FileWriter("characteroutput.txt"));
    String l;
    while ((l = inputStream.readLine()) != null) {
         outputStream.println("Rundate\tASCNumber\tLoan\tDelqMessage");
         if (l.indexOf("Run Date:")>=0) {
              RunDate = l.substring(10);
              outputStream.println(RunDate);
         // Processing of report data
         if(l.indexOf("ASC Number Loan ID") >= 0) {
              procOn = true;
         if(l.indexOf("-------------------------") >= 0 || l.indexOf("===============================") >= 0) {
              procOn = false;
         // Output report data to new characteroutput.txt file
         if(procOn) {
              String ASC = l.substring(0, 4).trim();
              String LoanID = l.substring(15, 25).trim();
              String DelqM = l.substring(30).trim();
         outputStream.println(RunDate + "\t" + ASC + "\t" + LoanID + "\t" + DelqM);
         catch(Exception z){
    System.out.println("Error: " + z.toString());
    }

  • Need Help with XML Parsing on to DataGrid

    Hi
    I have retrivied  this  Data  into my HttpService Result function .
    <list>
      <User>
        <ename>JAMES</ename>
        <empno>7900</empno>
      </User>
      <User>
        <ename>FORD</ename>
        <empno>7902</empno>
      </User>
      <User>
        <ename>MILLER</ename>
        <empno>7934</empno>
      </User>
    </list>
    [Bindable]
        private var xmldata:XML;
    private function resultHandler(event:ResultEvent):void{
            xmldata=event.result as XML;
    <mx:DataGrid x="50" y="23" width="469" height="265" dataProvider="{xmldata.User}">
      <mx:columns>
       <mx:DataGridColumn headerText="Type" dataField="ename"/>
       <mx:DataGridColumn headerText="Sales" dataField="empno"/>
      </mx:columns>
    </mx:DataGrid>
    But this is not displaying any data into DataGrid .
    Could anybody please help me .
    Thanks .

    after you get data assign the data to the data grid
    datagrid.dataprovider = xml;
    and also do datagrid.invalidateList() after u get the data if the above line does not help
    also see if the data provider is not null if nothing helped.

  • XSLT with DOM/C++ Parser

    Help,
    Anyone familiar with xslprocess class with DOM Parser for C++? My application needs to transform the original XML document, and then parse the new document (parse elements in tree). The example in the XDK demo directory (XSLSample.cpp) stops short of this. This demo/sample code simply output the newly transformed to the standard output (screen). My attempt to parse the newly transformed XML has been unsuccessful. Most of my code is base direcly from the sample:
    void
    DbXMLLoad::transformXML( const string& filename)
    xmlpar.xmlinit();
    strcpy(xml_doc, (char*)filename.c_str());
    xmlpar.xmlparse((oratext *), xml_doc, (oratext *) 0, flags);
    xslpar.xmlinit();
    strcpy(xsl_doc, "it2xxx.xsl");
    xslpar.xmlparse((oratext *), xsl_doc, (oratext *) 0, flags);
    respar.xmlparse((oratext *) result, (oratext *) 0, flags);
    xslproc.xslprocess(&xmlpar, &xslpar, &respar, &result);
    xslproc.printres(&respar.getDocumentElement(), 1);
    // Parse the newly transformed XML document????
    constructTree(result, 1);
    (void) xmlpar.xmlterm();
    (void) xslpar.xmlterm();
    (void) respar.xmlterm();
    void
    DbXMLLoad::constructTree(Node *node, word level)
    if (node) {
    dumpTree(node, level);
    if ((node->getType() !=DOCUMENT_TYPE_NODE) && node->hasChildNodes()) {
    nodes = node->getChildNodes();
    n_nodes = node->numChildNodes();
    for (i=0; i< n_nodes; i++)
    constructTree(nodes->item(i), level + 1);
    void
    DbXMLLoad::dumpTree(Node *node, uword level)
    switch (node->getType()) {
    case ELEMENT_NODE: // start database processing
    case TEXT_NODE: // continue database processing
    default:
    Appreciate your help. Thanks in advance
    Russ

    what is "respar"?What version of XDK do you use?

  • XML DOM Parser Performance Enhancement

    Hello,
    I parsed an XML file with DOM Parser.
    When I read it (Which is successfully done) I see, in the debugging phase, that there are empty elements
    which might represent a space, tab or newline and that are considered childrenNodes.
    This actually cost us double time to run through everything.
    My main question is how to get rid of the unwanted childrenNodes in order to iterate less on each element?
    Thank you.

    According to the documentation, you should be able to call normalize() on either the document or the root element. In practice, I still have to iterate through the empty elements. Such is life.
    - Saish

  • Very Urgent Please Help Me with XML parsing(DOM parser)

    Hi
    Please help me with the following code.
    I have an XML file
    <catalog>
    <book id="101">
    <title>First Ex With ID 101</title>
    <ID>500</ID>
    <author>RAJU</author>
    <price>39.95</price>
    </book>
    <book id="121">
    <ID>501</ID>
    <title>First Ex With ID 121</title>
    <author>RAJU1</author>
    <price>19.95</price>
    </book>
    </catalog>
    By using DOM parser I have to retrive ID values .After getting this ID values i have to pass these values in someother method of someother class.What i suppose to do?Can anyone help me with this regards ,if possible plese write the code..
    Regards
    Raju G

    Well first up all create a parser class where u parse the document using DOm and get the id node and assigen it to a String sat str.
    Now whatever processiong u want to do , u write in a separate class (say Process.java) in one method say doProcess(String str)
    Now from parser class u just call the doProcess() method with passing str as a parameter.
    eg.
    Process p = new Process();
    p.doProcess(str);
    Hope this will help u.
    ....yogesh

  • Need help with error: XML parser failed: Error An exception occurred! Type:......

    <p>Need help with the following error.....what does it mean....</p><p>28943 3086739136 XML-240304 3/7/07 7:13:23 PM |SessionNew_Job1<br /><font color="#ff0000">28943 3086739136 XML-240304 3/7/07 7:13:23 PM XML parser failed: Error <An exception occurred! Type:UnexpectedEOFException, Message:The end of input was not expected> at</font><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM line <7>, char <8> in <<?xml version="1.0" encoding="WINDOWS-1252" ?><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <DSConfigurations><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <DSConfiguration default="true" name="Configuration1"><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <case_sensitive>no</case_sensitive><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <database_type>Oracle</database_type><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <db_alias_name1>ODS_OWNER</db_alias_name1><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <db_ali>, file <>.<br />28943 3086739136 XML-240307 3/7/07 7:13:23 PM |SessionNew_Job1<br />28943 3086739136 XML-240307 3/7/07 7:13:23 PM XML parser failed: See previously displayed error message.</p><p>Any help would be greatly appreciated.  It&#39;s something to do with my datasource and possibly the codepage but I&#39;m really not sure.</p><p>-m<br /></p>

    please export your datastore as ATL and send it to support. Somehow the internal language around configurations got corrupted - never seen before.

  • DOM Parser fails with regular expression using anchor (carat, dollar)

    I'm using version "Oracle XDK Java 9.0.4.0.0 Production"
    In trying to parse XML against schema: a regular expression fails to parse the data "8:00" with the following simple regular expression: "^.*$" (used to narrow the error)
    The error message is
    <Line 14, Column 25>: XSD-2025: (Error) Invalid text '8:00' in element: 'XYZ'
    If I remove the anchors and just have ".*", the data is parsed successfully.
    I dont understand why the parse fails when I use a anchors in the regular expression, and the java Pattern/Matcher classes succeed with the anchors?

    That "ns670" string is an xml namespace prefix. it should have a corresponding xml namespace declaration somewhere in the xml document (i'm guessing you have not shown the whole document). the actual value of an xml namespace prefix is meaningless. if you parse the xml with a namespace aware DOM parser, it should generate Nodes with the correct namespace. the namespace is the value you care about when extracting data from the document, not the namespace prefix.
    alternately, if you parse the document using a namespace aware DOM parser, you can just look for nodes based on their "local" name (the part after the ":" separator) and ignore the namespace/prefix.
    whatever you do, please do not parse the xml with a regex, see this http://stackoverflow.com/a/1732454/552759 for details (applies to xml as well).

  • Does jdk1.4 come with an inbuilt DOM parser?

    Hello,
    I would just like to know if jdk1.4 comes with an inbuilt DOM parser? i.e. are there any API's, for parsing an xml document, inbuilt within jdk1.4??If yes, can anyone tell me how am i supposed to parse an input xml file and what are the API's present??? thnx in advance

    This works with JDK 1.4:
    import org.w3c.dom.Document;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory ;
    import org.xml.sax.InputSource;
    import java.io.InputStream;
    public class a {
        public Document doit(InputStream is)
        throws java.io.IOException,org.xml.sax.SAXException,javax.xml.parsers.ParserConfigurationException
            javax.xml.parsers.DocumentBuilderFactory dbf=javax.xml.parsers.DocumentBuilderFactory.newInstance();
            DocumentBuilder db = dbf.newDocumentBuilder();
            InputSource isrc = new InputSource( is );
            Document document = db.parse(isrc);
            return document;
    }

Maybe you are looking for