Can't run very simple DOM parsing source on my machine - please help :(
Hi Guys,
I am trying to run the following very simple program on my machine to parse a very simple XML file.
It just returns Document object NULL.
Same code is working fine on another machine.
Note: there is no silly mistake. i have valid xml file at valid place.
Please help.
import org.apache.xerces.parsers.*;
import org.w3c.dom.*;
import org.xml.sax.*;
import java.io.*;
class XML
public static void main(String[] args)
try{
String caseFile = "c:\\case-config\\config.xml";
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(true);
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(caseFile);
System.out.println("\n\n----" + doc);
}catch(Exception e)
e.printStackTrace();
}
You could also work with JDOM, which I find easier to use than regular DOM:
import org.xml.sax.InputSource;
import java.io.FileReader;
import org.jdom.input.SAXBuilder;
import org.jdom.Document;
String caseFile = "c:/case-config/config.xml";
InputSource inputSource = new InputSource(new FileReader(caseFile));
SAXBuilder builder= new SAXBuilder();
Document document = builder.build(inputSource);Just an alternate suggestion.
Similar Messages
-
I am trying to download Firefox on my laptop which runs Vista. I am getting the following error message: Your Firefox profile can't be loaded, it may be missing or innaccessible." Please help.
See:
* http://kb.mozillazine.org/Recovering_a_missing_profile
* http://kb.mozillazine.org/Profile_in_use
* https://support.mozilla.com/kb/Firefox+is+already+running+but+is+not+responding -
hello am using mac book pro ,recently i updated my computer to OS X MAVERICKS ,where my launch pad in my dock is slow,when i move the track pad to next page in launch pad ,it is very slow ,it takes two to three swipes ,please help me
Hey rajafromind!
I have an article here that can help you troubleshoot this issue:
OS X Mavericks: If graphics-intensive tasks slow down your Mac
http://support.apple.com/kb/PH13952
The following article may also have some helpful information for you:
OS X Mavericks: If your Mac runs slowly
http://support.apple.com/kb/PH13895
Thanks for being a part of the Apple Support Communities!
Regards,
Braden -
When I went to bed I had 3,000 song and multiple playlists. This morning I have ~30 songs and no playlists. What could have happened to my songs playlists? I run iTunes on a Windows 7 64-bit machine. HELP! (oh, and the Songs are not in recycle bin)
My wife's ipod nano was plugged into the machine overnight.
When she went running with it, there were no songs on it. She checked the computer and was horrified to see that the playlists had disappeared and most of the songs had disappeared.
QUESTIONS:
1. What could it be?
2. How can I fix it?Hi, there alot of us suffering from this phernomonon but there is a forum topic about is already.
https://discussions.apple.com/message/16767377#16767377
Come check it out.
Hope this works out for all of us. -
when i run installation itunes,i see this massage "there is a problem with this windows installer package.a program required for this install to complete could not be run. contact your support personnel or package vendor."please help me for installation itunes on my pc completely.
Apparently it's an itunes issue. I just tried to update and got the same issue. Called att to activate my iphone 4s and they say they can do the swap but apple is telling them itunes is down atm. So will have to wait
-
I can't load 1 Imovie project. Imovie shows 5 projects but only 4 icons show of those. 1 projects symbol won't come up so I can't click on it to work on or play. Please help me as there's lots of work on this project I don't want to lose.
The performance fixes is a biggy for me, though the other missing
stuff I use makes me have to use both versions for various things:
"but they seem to be committed to another release/version."
Well ... now that's the rub. I would actually welcome this intermediate version to play with (even with the cost of upgrading) if I could rely on it to be finalized into 6.0, full featured, without it taking as long as it has to Upgrade from AA3.0. I would say it was a VERY smart move to give us a preview of 6.0, if I felt in, say, six months they would provide us the fully functional update. But, HOW many years has it been. I felt screwed over while they played around with Sound Booth.
I was with you for a minute in most of what you said, until your credibility went down a couple notches with me on the statement trivializing midi functionality. I though that was a very clueless statement:
"but I have no need for a midi controller and if I want a drummer to keep perfect time I'll get a drum machine."
It does make some of your other statements suspect, tho I won't take it as far as therealdobro's "what's your stake" question. -
and it doesnt work and it keeps crashing and i sent a report to itunes so they can refunde my money back but they wont answer me back please help me
We are all itunes users just like you. We cannot refund anything.
There are no refunds, but you can try contacting itunes support. Click "Support" at the top of this page, then click the link under "Contact Us" -
hey, i just updated my iPad 2 to the newest update and know my apps have gone and i can't re-download the paid app i bought no happy please help!!!!!!
Are the apps in your iTunes library on your computer and did you select them to sync? Are you sure that you are syncing correctly?
Read this.
http://support.apple.com/kb/HT1386 -
i was updating software and suddenly my IPHONE started asking for I tunes on mobile screen , how can i get by screen back or How i can restore without loosing data , I m more worried about data , Please help in resolutio
What exactly are you seeing on the phone's screen ? If the iTunes icon and cable then the phone is in recovery mode, in which case it's too late to take a new backup or to copy any content off the phone - you will have to connect the phone to your computer's iTunes and reset it back to factory defaults, after which you can restore to the last backup that you took or just resync your content to it
-
I recently upgraded to IOS 10.9.5 and now I can't export anything from final cut Pro X. Could somebody please help me with this?
SSign in to the App Store using the Apple ID that was used to purchase the software.
-
The original computer I installed lightroom 3 on, has crashed and I need to install it on my new computer. I can't seem to figure out how to do that. Please help?
Lightroom - all versions
Windows
http://www.adobe.com/support/downloads/product.jsp?product=113&platform=Windows
Mac
http://www.adobe.com/support/downloads/product.jsp?product=113&platform=Macintosh -
Hi, we just bought a Macbook air and we can't find the 'reminders' app in the applications or through the spotlight search. Is there a link to download the app? I can't find it online or through the app store. Please help!
Reminders is automatically installed with 10.8 or above. A new Mac should have 10.9; it's possible that, with a third-party vendor, you have an earlier OS. Check under the Apple menu in the top left and click About This Mac. That will tell you what version of OS X you have.
Matt -
I forget my apple Id secure question, and I can't reset it , what am I supposed to do ? Please help .....help
1. Turn off iPad
2. Turn on computer and launch iTunes (make sure you have the latest version of iTune)
3. Plug USB cable into computer's USB port
4. Hold Home button down and plug the other end of cable into docking port.
DO NOT RELEASE BUTTON until you see picture of iTunes and plug
5. Release Home button.
ON COMPUTER
6. iTunes has detected iPad in recovery mode. You must restore this iPad before it can be used with iTunes.
7. Select "Restore iPad"... i do this but not working -
I can't make or receive calls on my iPhone 4S. Please help
I can't make or receive calls on my iPhone 4S. Please help.
Try a Reset...............
Definately call Your Carrier..........
Then Apple Help.. -
i cannot transfer some videos to my iphone 3gs. the file is in MPEG4 format. i can view in itunes but cannot be transfered to iphone. Please help me with this problem.
In iTunes, Advanced>Create iPod or iPhone version
Maybe you are looking for
-
How can i print out the waveform chart?
hello everybody, how can i print out the "waveform chart". can i do it just push the button. ( example; stop button is stop the program etc..) i checked the NI examples but i can't understand. i'm new to the Labview. pls help me. i added the my pro
-
17" MacBook Pro to 30" HD Display issue using Mini DisplayPort to Dual-Link DVI Adaptor.
Just replaced the Western Digital hard drive on my MacBook Pro with a SSD now running Lion 10.8.2, (updating from Snow Leopard latest version). I have a 30" HD Apple display monitor and very much love using it. The issue. The MacBook Pro will only al
-
What happened to the app called "APPLETS"?
So I am trying to find this app on the app store, but it doesn't show up... Did they replace it or something ? Please help me.. I had important info there and It seems like I lost it..
-
Ant - Create Connection Pool on WebLogic 10.1.3
Hi, I have created the following build.xml file to create a Datasource on weblogic using ANT . The file is as follows: <?xml version="1.0" encoding="windows-1252" ?> <project name="deploy" default="all" basedir="."> <property file="build.properties
-
Why is my named anchor link not working
Can someone please help. I am a novice at Dreamweaver - but my website works well with almost all links working. Situation : The problem lies on the following page www.ozonesystems.co.uk/airunits There are 7 links in the table which point to Named A