Hi,
When you say that they are failing without message, you would not know,
as you are not doing anything with the message!

Try e.printStackTrace();


Mike

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:dom4j-user-admin@;lists.sourceforge.net] On Behalf Of 
> [EMAIL PROTECTED]
> Sent: Thursday 17 October 2002 11:18
> To: [EMAIL PROTECTED]
> Subject: [dom4j-user] help!
> 
> 
> I'm trying to xml load a file to process. But using SAXReader 
> directly it doesn't work! I've to read it with DOM and then 
> convert it to dom4j... I think it's very weird.... Any idea? 
> Thanks a lot! Federico
> 
> (Document url:  
> http://www.informatik.uni-freiburg.de/~may/Mondial/mondial-
> 3.0.xml it's almost 2mb!)
> 
> SAX reader code:
> 
> import java.io.*;
> import java.util.*;
> import org.dom4j.*;
> import org.dom4j.io.*;
> 
> public class xmine2  implements ElementHandler {
>     SAXReader reader = new SAXReader();
>     Document document=null;
> 
>     public xmine2(String url) {
>         try {
> 
>             reader.setIncludeExternalDTDDeclarations(false);
>             reader.setIncludeInternalDTDDeclarations(false);
>             reader.setStripWhitespaceText(true);
>             reader.setStringInternEnabled(true);
>             System.out.println("opening doc");
>             File f= new File(url);
>             if (f.exists()) {
>                 InputStream is= new FileInputStream(url);
>                 document = reader.read(is);
>                 System.out.println("opened doc");
>                 List list = document.selectNodes( "//religions", ".", 
> true);
>                 System.out.println("created list");
>                 ListIterator iterator=list.listIterator();
>                 int i=0;
>                 do {
>                     
> System.out.println(((Node)iterator.next()).asXML());
>                     i++;
>                 } while (iterator.hasNext());
>                 System.out.println(i);
>             } else System.out.println("no file");
>         } catch (Exception e) {e.getMessage();}
> 
> 
>     }
>     public static void main(String[] args) {
>         xmine2 xmine21 = new xmine2("mondial.3.0.xml");
>     }
> }
> 
> 
> DOM to SAX code:
> 
> import org.dom4j.*;
> import org.dom4j.io.*;
> import javax.xml.parsers.DocumentBuilder;
> import javax.xml.parsers.DocumentBuilderFactory;
> import java.util.*;
> import java.io.*;
> 
> public class dom {
>     DOMReader reader;
>     Document d;
> 
>     public dom() {
>         try{
>         DocumentBuilderFactory factory = 
> DocumentBuilderFactory.newInstance
> ();
>         DocumentBuilder builder = factory.newDocumentBuilder();
>         reader=new DOMReader();
> 
>         d=reader.read(builder.parse("mondial.3.0.xml"));
>         List list = document.selectNodes( "//religions", ".", true);
>         ListIterator iterator=list.listIterator();
>         do {
>             System.out.println(((Node)iterator.next()).asXML());
>         } while (iterator.hasNext());
> 
>         } catch (Exception e) {e.getLocalizedMessage();};
>     }
>     public static void main(String[] args) {
>         dom dom1 = new dom();
>     }
> }
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by: viaVerio will pay you up 
> to $1,000 for every account that you consolidate with us. 
> http://ad.doubleclick.net/clk;4749864;7604308;> v?
> 
http://www.viaverio.com/consolidator/osdn.cfm

_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user




-------------------------------------------------------
This sf.net email is sponsored by: viaVerio will pay you up to
$1,000 for every account that you consolidate with us.
http://ad.doubleclick.net/clk;4749864;7604308;v?
http://www.viaverio.com/consolidator/osdn.cfm
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to