sachin poddar

Greenhorn
+ Follow
since Feb 10, 2006
Merit badge: grant badges
Biography
Jun 2005 - B.E. in IT from Jabalpur Engg. College
April 2005 - Dec 2007 --Software AG, Pune
Jan 2007 - till now -- Persistent Systems, Pune
For More
pune
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sachin poddar

Originally posted by sweety sinha:
hi all

i am getting average marks in mock exams. how to improve on that???



sweety know yourself. nobody knows you better than yourself ;-) try to find out areas your lacking and you know ....
hello Revathi,

your question is not very clear to me. This is what i got- Initially you have a java property file(.properties) and then you transformed it into xml file, i guess by using java.util.Properties.storeToXML(). Now you want to parse that file using DOM. Why do you want to use DOM? You can read the same xml property file using java.util.Properties.loadFromXML(). Let me know is this is what you wanted.
try launching application with -Xmx512m option
could you please show us content of your XML file, and what you want to print??
Hello Jeff,
try this-
http://xerces.apache.org/xerces2-j/faq-pcfp.html
see section-
"How can I tell the parser to validate against XML Schema and not to report DTD validation errors?"
newbie to xml!
hope you would like this-
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html
go through chapters 2,4,5,6,7
by the way i liked your quote-
"Human beings can alter their lives by altering their state of mind" William James

..but sometimes situations do alter our state of mind!
Hello Adewale ,
try this-
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(fileStream);
String id = document.getElementsByTagName("data").item(0).getAttributes().getNamedItem("id").getNodeValue();

where fileStream is stream to your input file.
One more thing i would like to say is your id attribute value must be in single or double quotes! i.e. like
<data id='1'>

let me know is this is suffice for you!
i have no idea about Springframework but here is quik diff between XML Schemas and DTDs
1. XML Schemas use XML document syntax. Declarations can have richer and more complex internal structures than declarations in DTD. XML Schemas are pure XML documents, DTDs have several limitations.
2. XML Schemas provide data-oriented data types in addition to the more document-oriented data types XML 1.0 DTDs support.
3. XML Schemas support namespaces.

I would suggest, go for XML Schema
[ May 09, 2007: Message edited by: sachin poddar ]
and here is the whole code....
/**
* Delete a file. If file is a directory, delete it and all sub-directories.
*
* @param file file or directory to delete, not null
* @throws NullPointerException if the directory is null
* @throws IOException in case deletion is unsuccessful *
*/
public static void forceDelete(File file) throws IOException {
if(file.isDirectory()) {
File files[] = file.listFiles();
if(files == null) {// null if security restricted
throw new IOException("Failed to list contents of " + file);
}
for (int i = 0; i < files.length; i++) {
File tempFile = files[i];
forceDelete(tempFile);
}
if(!file.delete()) {
String message = "Unable to delete directory " + file ;
throw new IOException(message);
}
} else {
if(!file.exists()) {
throw new FileNotFoundException("File does not exist: " + file);
}
if(!file.delete()) {
String message = "Unable to delete file: " + file;
throw new IOException(message);
}
}
}
16 years ago
hello everybody,
link http://kokonaing.googlepages.com/ is working now so you peoples can downlod pdf's from this site too!
try this..
double d1= 2.5f;
double d2= 2.6f;
System.out.println(d1);
System.out.println(d2);
.. now i think you've got answer!
congratulations!!
18 years ago
cngratulations!!
and best of luck for your next certification exams.
18 years ago