XERCES SAX BUG

Hi there,
I have been having a problem with the latest version of XERCES (2.7.1).
Whenever I try to read a certain XML document using the SAX parser, it returns less text content for one of the elements than it should.
The element is called <NAME> and the content for this element starts 2105 characters into the document.
Can anybody help?
Cian

What is missing? Do you see the first part of the text for this <NAME> element, or the last part?
How are you consolidating the text information? Are you aware that SAX may call the characters() method multiple times even if there is only one text block?
You need to collect the results (perhaps using a StringBuffer) until you get to the endElement() method call.
Is this your problem?
Dave Patterson

Similar Messages

  • Xerces SAX parser don`t initialize a characters array

    Xerces SAX parser don`t initialize a characters array from characters() method in DefaultHandler.
    I use jdk 1.5.12.
    For value "22-11-2009" variables start=1991, length=9.
    Result: "22-11-200"

    My handler:
    package com.epam.xmltask.parsers;
    import com.epam.xmltask.model.Category;
    import com.epam.xmltask.model.Goods;
    import com.epam.xmltask.model.Products;
    import com.epam.xmltask.model.Subcategory;
    import com.epam.xmltask.utils.Constants;
    import com.epam.xmltask.utils.DateConverter;
    import java.text.ParseException;
    import java.util.Date;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.Attributes;
    import org.xml.sax.ErrorHandler;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.helpers.DefaultHandler;
    public class SAXProductsParser extends DefaultHandler implements IProductsParser {
        private Logger logger = null;
        private SAXParser parser = null;
        private ErrorHandler errorHandler = null;
        private Products products = null;
        private Category category = null;
        private Subcategory subcategory = null;
        private Goods goods = null;
        private String currentField = Constants.EMPTY_STRING;
        protected Logger getLogger() {
            if (logger == null) {
                logger = Logger.getLogger(SAXProductsParser.class.getName());
            return logger;
        protected SAXParser getParser() throws Exception {
            if (parser == null) {
                try {
                    SAXParserFactory parserFactory = SAXParserFactory.newInstance();
                    parserFactory.setNamespaceAware(true);
                    parserFactory.setValidating(true);
                    parser = parserFactory.newSAXParser();
                    parser.setProperty(Constants.SCHEMA_LANGUAGE, Constants.XML_SCHEMA);
                } catch (Exception ex) {
                    getLogger().log(Level.SEVERE, null, ex);
                    throw ex;
            return parser;
        public ErrorHandler getErrorHandler() {
            if (errorHandler == null) {
                errorHandler = new ProductsErrorHandler();
            return errorHandler;
        public Products getProducts(String uri) throws Exception {
            try {
                products = new Products();
                getParser().parse(uri, this);
                return products;
            } catch (Exception ex) {
                getLogger().log(Level.SEVERE, null, ex);
                throw ex;
        @Override
        public void startElement(String uri, String localName,
                String qName, Attributes attributes) {
            if (Constants.CATEGORY.equals(qName)) {
                String name = attributes.getValue(Constants.NAME);
                category = new Category(name);
            } else if (Constants.SUBCATEGORY.equals(qName)) {
                String name = attributes.getValue(Constants.NAME);
                subcategory = new Subcategory(name);
            } else if (Constants.GOODS.equals(qName)) {
                String name = attributes.getValue(Constants.NAME);
                goods = new Goods(name);
            } else if (Constants.NOT_IN_STOCK.equals(qName)) {
                goods.setIsInStock(false);
            } else {
                currentField = qName;
        @Override
        public void endElement(String uri, String localName, String qName) {
            if (Constants.CATEGORY.equals(qName)) {
                products.addCategory(category);
                category = null;
            } else if (Constants.SUBCATEGORY.equals(qName)) {
                category.addSubcategory(subcategory);
                subcategory = null;
            } else if (Constants.GOODS.equals(qName)) {
                subcategory.addGoods(goods);
                goods = null;
            } else {
                currentField = Constants.EMPTY_STRING;
        @Override
        public void characters(char[] chars, int start, int length) throws SAXException {
            String field = new String(chars, start, length).trim();
            if (goods != null) {
                if (Constants.PRODUSER.equals(currentField)) {
                    goods.setProducer(field);
                } else if (Constants.MODEL.equals(currentField)) {
                    goods.setModel(field);
                } else if (Constants.DATE_OF_ISSUE.equals(currentField)) {
                    Date date = null;
                    try {
                        date = DateConverter.getConvertedDate(field);
                    } catch (ParseException ex) {
                        getLogger().log(Level.SEVERE, null, ex);
                        throw new SAXException(ex);
                    goods.setDateOfIssue(date);
                } else if (Constants.COLOR.equals(currentField)) {
                    goods.setColor(field);
                } else if (Constants.PRICE.equals(currentField)) {
                    Float price = Float.valueOf(field);
                    goods.setPrice(price);
        @Override
        public void error(SAXParseException ex) throws SAXException {
            getErrorHandler().error(ex);
        @Override
        public void fatalError(SAXParseException ex) throws SAXException {
            getErrorHandler().fatalError(ex);
        @Override
        public void warning(SAXParseException ex) throws SAXException {
            getErrorHandler().warning(ex);
    }

  • Xerces - SAX - ContentHandler question

    hi,
    I am just trying to work out how to get at variables with a registered and set ContentHandler after the parsing process.
    e.g.
    XMLReader reader = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
    ContentHandler contentHandler = new CustomContentHandler();
    reader.setContentHandler(contentHandler);If I had a method inside my customerHandler,
      public boolean getFlag(){
        return flag;
      }i would have thought this may work but does not,
    XMLReader reader = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
    ContentHandler contentHandler = new CustomContentHandler();
    reader.setContentHandler(contentHandler);
    ContentHandler handler = reader.getContentHandler();
    if(handler.getFlag()){
    ....process
    }else{
      ....do something else
    }is something like this possible.
    I know all logic can go in the handler, but acn this be done?
    jp.

    ahhh!!!
    I probably would have got round to thinking to do that,
    I tried CustomerContentHandler handler = (ContentHandler)reader.getContentHandler();
    the reason I want to do it this way was just to keep logic native to the xml processing in the Handler, and then send a msg back to the web service client, depending on what went on in the handler, for example,
    public class MyWebService{
      XMLReader reader = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
    ContentHandler contentHandler = new CustomContentHandler();
    reader.setContentHandler(contentHandler);
    reader.parse("my sax input source")
    CustomContentHandler handler = (CustomContentHandler) reader.getContentHandler();
    if(handler.getFlag()){
      build msg response
    }else{
       build other msg response
    return messageResponse;
    }I'm not sure if I could have send the messageResponse from within the ContentHandler ?

  • Xerces Sax not parsing a Unicode char

    My SaxParser (xerces) is failing when parsing, complaining about Unicode: 0x1d.
    I am reading from a file (InputSource), and have set the encoding to UTF-8.
    Is there any way to not parse data in specified xml elements? Without explicitly escaping the illegal character....
    Thanks,
    Karen

    Having performed some research, I discovered that this is a control character and while it is an acceptable Unicode character, it is not a valid UTF-8 character.
    Control characters are in the range U+0000....U+001F, and most of them are written out as '?'. 0x1d(Group Separator), however, is not escaped and therefore Xerces cannot parse it.
    I have written a util class that escapes control chars in Unicode.
    Thanks.

  • SAX Parser in OC4J

    I'm trying to read a XML file in an EJB using a SAX parser.
    I tried the following statement to create the reader
    XMLReader xr = XMLReaderFactory.createXMLReader("oracle.xml.parser.v2.SAXParser");
    but I obtain the following exception:
    java.lang.ClassNotFoundException: oracle.xml.parser.v2.SAXParser
    at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:118)
    The same works correctly from a command line application outside OC4J.
    Is there another SAX Parser I can use in OC4J?
    Andrea Mattioli

    I'm also seeing the a similar problem trying to get my EJB to parse SAX using the Xerces parser. If I do
    XMLReader myReader = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
    and place xerces.jar into $(OC4J_INSTALL_ROOT)\j2ee\home\lib then at runtime I get
    java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
    This is despite the fact that calling Class.forName() on the same class name works fine. Setting the system property org.xml.sax.driver and calling createXMLReader with no parameters results in the same error.
    I can force use of the Xerces SAX parser by bypassing the factory and just calling
    XMLReader myReader = new org.apache.xerces.parsers.SAXParser();
    but that seems a tad hacky and I don't want to hardwire SAX parser implementation choice into my code.
    Is this a known bug?
    Also which parser is getting used by default in OC4J i.e. if I don't set org.xml.sax.driver and use the no parameters variant of createXMLReader()?
    Thanks
    Alan

  • How to use Xerces parser in my code

    Hello all,
    This is my first time in the forumn. I am a beginer to xml. I am trying to use xerces SAX parser to parse the xml document. I have downloaded xerces 2.6.2 in the c drive. Can you please guide me how can I use it in my piece of code and how to execute. I tried using the parser available on my system. This code works fine. But I am confused with how can modify my code to parse using Xerces parser.
    Help appreciated!
    import javax.xml.parsers.SAXParserFactory;//This class creates instances of SAX parser factory
    import javax.xml.parsers.SAXParser;//factory returns the SAXParser
    import javax.xml.parsers.ParserConfigurationException;//if the parser configuration does not match throws exception
    /*2 statements can be substituted by import org.xml.sax.*;
         This has interfaces we use for SAX Parsers.
         Has Interfaces that are used for SAX Parser.
    import org.xml.sax.XMLReader;
    import org.xml.sax.SAXException;
    import java.io.*;
    import java.util.*;
    public class CallSAX_18 {
         public static void main (String []args)
                   throws SAXException,
                   ParserConfigurationException
                   IOException {
         /*     3 statement below can be substitued by this below 1 statement when using other parser
    XMLReader xmlReader = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
              SAXParserFactory factory = SAXParserFactory.newInstance();
              SAXParser saxParser = factory.newSAXParser();
              XMLReader xmlReader = saxParser.getXMLReader();
              /*/MyContentHandler has callback methods that the SAX parser will use.This class implements startElement() endElement() etc methods.
              DBContentHandler dbcontent = new DBContentHandler();
              xmlReader.setContentHandler(dbcontent);
              xmlReader.parse(new File(args[0]).toURL().toString());

    Well, I am not too familiar with SAX, but I know my DOMs 8-)
    is there a reason you are using SAX to parse versus DOM?
    what is your final objective that you want to accomplish? Perhaps
    DOM might be better? Are you trying to parsing XML into nodes?

  • Question About Xerces Parser and Java  JAXP

    Hi,
    I have confusion about both of these API Xerces Parser and Java JAXP ,
    Please tell me both are used for same purpose like parsing xml document and one is by Apache and one is by sun ?
    And both can parse in SAX, or DOM model ?
    Is there any difference in performane if i use xerces in my program rather then JAXP, or is ther any other glance at all.
    Please suggest some thing i have and xml document and i want to parse it.
    Thanks

    Hi
    Xerces is Apaches implementation of W3C Dom specifiacation.
    JAXP is a API for XML parsing its not implementation.
    Sun ships a default implementation for JAXP.
    you have factory methods for selecting a parser at run time or you can set in some config file about what is the implementaion class for the SAXParser is to be chosen (typically you give give the class file of xerces sax parser or dom parser etc..)
    go to IBM Developerworks site and serch for Xerces parser config. which have a good explination of how to do it.
    and browse through j2ee api .may find how to do it.

  • SAX driver property

    Hi All,
    I am using apache xerces SAX driver in my java application. However,
    when I start the program I am having to specify the driver property like below
    java -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser MySAXAppI believe that it is possibel to have my java environment to have a compiled-in default but I do not know how to do this.
    Can someone please tell me how to do this so I don't have to keep setting the system property.
    Many Thanks

    And further to above...when I create the parser in my tomcat based servlet using the line, I don't need to set the system property, however when I do it from standalone java application I need to set the system property mentioned above...can someone please explain why this is and where it is set....It's driving me mad.....
    XMLReader xr = XMLReaderFactory.createXMLReader();

  • Creating an xml file from java.

    I trying to create an xml file using a java program. I just wondering what is the best way to go about it and what should i use jdom ,xerces sax etc.

    Use JAXP+SAX.
    Here an example:import java.io.*;
    // SAX classes.
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    //JAXP 1.1
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.*;
    import javax.xml.transform.sax.*;
    // PrintWriter from a Servlet
    PrintWriter out = response.getWriter();
    StreamResult streamResult = new StreamResult(out);
    SAXTransformerFactory tf = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
    // SAX2.0 ContentHandler.
    TransformerHandler hd = tf.newTransformerHandler();
    Transformer serializer = hd.getTransformer();
    serializer.setOutputProperty(OutputKeys.ENCODING,"ISO-8859-1");
    serializer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM,"users.dtd");
    serializer.setOutputProperty(OutputKeys.INDENT,"yes");
    hd.setResult(streamResult);
    hd.startDocument();
    AttributesImpl atts = new AttributesImpl();
    // USERS tag.
    hd.startElement("","","USERS",atts);
    // USER tags.
    String[] id = {"PWD122","MX787","A4Q45"};
    String[] type = {"customer","manager","employee"};
    String[] desc = {"Tim@Home","Jack&Moud","John D'o�"};
    for (int i=0;i<id.length;i++)
      atts.clear();
      atts.addAttribute("","","ID","CDATA",id);
    atts.addAttribute("","","TYPE","CDATA",type[i]);
    hd.startElement("","","USER",atts);
    hd.characters(desc[i].toCharArray(),0,desc[i].length());
    hd.endElement("","","USER");
    hd.endElement("","","USERS");
    hd.endDocument();
    [i]This xml generation program might be the best solution because it uses JAXP 1.1 so it will work under JDK 1.4 or JDK 1.2/1.3 with XALAN2 library (or any XML library JAXP 1.1 compliant). It's also memory-friendly because it doesn't need DOM.
    See http://www.javazoom.net/services/newsletter/xmlgeneration.html
    Hope That Helps                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Error validating xml schema

    Hi,
    I'm getting an error trying to validate an xml document using xml schema(xsd). The java code/schema/xml/error are listed below.
    Not sure what the error
    " Invalid content was found starting with element 'ticker'. One of '{ticker}' is expected." means.
    Using jre 1.6
    Any input appreciated.
    Thanks !
    // Java Code
         SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
         Schema schema = sf.newSchema(schemaURL);
         Validator validator = schema.newValidator();
         validator.validate(new StreamSource(is));
    // Schema
    <xs:element name="stocktrade">
    <xs:complexType>
    <xs:sequence>
         <xs:element name="ticker" type="xs:string"/>
         <xs:element name="price" type="xs:string"/>
         <xs:element name="quantity" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    // XML doc
    <stocktrade
    xmlns ... and other attributes
    >
    <ticker>aaa</ticker>
    <price>23.5</price>
    <quantity>11</quantity>
    </stocktrade>
    // Error
    Exception in thread "main" org.xml.sax.SAXParseException: cvc-complex-type.2.4.
    : Invalid content was found starting with element 'ticker'. One of '{ticker}' i
    expected.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSA
    ParseException(Unknown Source)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Un
    nown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
    Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
    Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErr
    rReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.report
    chemaError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handle
    tartElement(Unknown Source)

    When I tried this with Xerces SAX, I got---
    org.xml.sax.SAXNotRecognizedException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
    Maybe Xerces has not implemented the schemaLanguage property.
    I have been successfully using Xerces-dependent properties to do validation:
    XMLReader parser = saxParser.getXMLReader();
    parser.setFeature( "http://xml.org/sax/features/validation", true);
    parser.setFeature( "http://xml.org/sax/features/namespaces", true);
    parser.setFeature( "http://apache.org/xml/features/validation/schema", true);
    parser.setFeature( "http://apache.org/xml/features/validation/schema-full-checking", true);
    if (noNamespaceSchemaLocation!=null) {
    parser.setProperty(
    "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
    noNamespaceSchemaLocation);
    if (schemaLocation!=null) {
    parser.setProperty(
    "http://apache.org/xml/properties/schema/external-schemaLocation",
    schemaLocation);
    Also, as DrClap pointed out, for the schema location I use URIs.
    Please let me know if you got the jaxp schemaLocation property to work and how you did it.

  • IllegalArgumentException - error validating xml with schema

    I'm trying to validate an XML document using the following:
    JAXP 1.2
    Xerces 1.4.4
    JDK 1.4.1
    The xml is valid and I can confirm it with XML Spy when I point it to the schema definition. But, I get an IllegalArgumentException when I try to do it in my class.
    Here's the code...
    public static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
    public static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
    public static final String CIS_SCHEMA = "D:\\dev\\xml\\cis.xsd";
    public static final String[] SCHEMAS = { W3C_XML_SCHEMA, CIS_SCHEMA };
    private static DocumentBuilderFactory dbf;
    private static DocumentBuilder db;
    try {
         dbf.setNamespaceAware(true);
         dbf.setValidating(true);
         dbf.setAttribute(JAXP_SCHEMA_LANGUAGE, SCHEMAS);
    } (catch ...) {
    I get the following error:
    java.lang.IllegalArgumentException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
    Any ideas?

    When I tried this with Xerces SAX, I got---
    org.xml.sax.SAXNotRecognizedException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
    Maybe Xerces has not implemented the schemaLanguage property.
    I have been successfully using Xerces-dependent properties to do validation:
    XMLReader parser = saxParser.getXMLReader();
    parser.setFeature( "http://xml.org/sax/features/validation", true);
    parser.setFeature( "http://xml.org/sax/features/namespaces", true);
    parser.setFeature( "http://apache.org/xml/features/validation/schema", true);
    parser.setFeature( "http://apache.org/xml/features/validation/schema-full-checking", true);
    if (noNamespaceSchemaLocation!=null) {
    parser.setProperty(
    "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
    noNamespaceSchemaLocation);
    if (schemaLocation!=null) {
    parser.setProperty(
    "http://apache.org/xml/properties/schema/external-schemaLocation",
    schemaLocation);
    Also, as DrClap pointed out, for the schema location I use URIs.
    Please let me know if you got the jaxp schemaLocation property to work and how you did it.

  • Problems parsing xml

    I am currently writing a program that receives and xml address, parses the file and finds the name of a certain graphic file named in the xml file. Now if this was Perl I'd be all set, but doing it with java is confusing me a bit. I currently have Xerces SAX all set up, but I'm not sure exactly how to search through the file and find something. Thanks in advance!

    Thought I should give an example of the xml file i am parsing. I access it through a URL, which displays this:
    <?xml version="1.0" ?>
    - <map>
    <image href="http://localhost/TransCADTempFiles/a2aeb27f8.png" scope="-71104104|42365514|0.99284|0.8" width="520" height="420" />
    <directions href="http://localhost" />
    </map>
    The only thing that will ever change is the png file.
    Thanks!!

  • JAXB compiling errors

    I have a problem during the compiling of a schema. It returns the following errors:
    parsing a schema...
    [WARNING] src-import.0: Failed to read imported schema document 'xlink.xsd'.
    line 29 of graphml-structure.xsd
    [ERROR] src-resolve: Cannot resolve the name 'xlink:href' to a(n) attribute decl
    aration component.
    line 663 of graphml-structure.xsd
    [ERROR] src-ct.0.1: Complex Type Definition Representation Error for type 'locat
    or.type'. Element 'attribute' is invalid, misplaced, or occurs too often.
    line 663 of graphml-structure.xsd
    At the 29th line of "graphml-structure.xsd" is written:
    <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink.xsd">
    I visited that page but I haven't found any xlink.xsd. Any idea?

    Well, in the end I fixed that in some way... I got from a friend of mine the xlink.xsd (why is it not available at w3c web site?! Or maybe I simply didn't find it) and succeeded in the compiling. The Java code generated was too much for my tastes though, so I decided to drop JAXB and use Xerces/SAX in its place. That surely meant a little more coding efforts, but it defintely resulted in a cleaner and shorter code, hence in a faster execution of the application.

  • Best parser for handling very large XML  document

    which is the best parser whenread and extract information from very large XML document

    Any SAX-parser, since DOM would use 6 times as much primary memory as the file-size.
    Xerces SAX-parser is in my experience the fastest.
    Gil

  • Parsing XML [error in DocType]

    hi,
    I am trying to parse to xml documents using Xerces SAX parser. I this case I have set the validation, and namespace awarness off.
    XML-1.
    <?xml version="1.0" ?>
    <!DOCTYPE presence PUBLIC "-//IETF//DTD RFCxxxx XPIDF 1.0//EN" "xpidf.dtd">
    <presence>
    <presentity uri="notifier@d17-021:5062;method=SUBSCRIBE" />
    <atom atomid="009">
    <address uri="sip:notifier@d17-021:5062">
    <status status="open" />
    <note>Online</note>
    </address>
    </atom>
    </presence>
    In this case i have the file "xpidf.dtd" in my path, and the parser is reading it (or else it gives a file not found error)
    the error i get is : org.xml.sax.SAXParseException: The text declaration may only appear at the very beginning of the external parsed entity.
    Now I can get pass the problem by commenting out line 2, [not 1, commenting out line one dose not solve the problem], so essentialy the problem lies within line 2. but what ??? The '<' is in the first column of the second line.
    now XML 2-
    <?xml version="1.0"?>
    <!DOCTYPE presence SYSTEM "http://schemas.microsoft.com/2002/09/sip/presence">
    <presence>
    <presentity uri="notifier@d17-021:5062;method=SUBSCRIBE" />
    <atom atomid="wav7">
    <address uri="sip:notifier@d17-021:5062">
    <status status="open" />
    <note>Online</note>
    </address>
    </atom>
    </presence>
    In teh above case i get an error:-
    java.net.ConnectException: Connection timed out: connect
    it seems that the parser is trying to get the dtd form the specified path, now my question here is, can i stop the parser from connecting out and try getting the dtd. I do not need to validate the xml's, coz in my case i am sure about the formation of the xml and a non-conforming XML is not critical.
    TIA
    Naunidh.

    I can not do without it :((
    The other end sends the xml file only in the give format.
    I do not need to validate but, yes i need to parse.
    Even if i can validate and parse, I have no issues....but parsing is a must.

Maybe you are looking for