| Author |
IBM XML parser for JAVA
|
Kavitha Chandrasekaran
Ranch Hand
Joined: Jul 24, 2002
Posts: 34
|
|
I am new to using XML in VAJ 3.5.3 environment. I am using VAJ 3.5.3. I have imported IBM XML Parser for Java to my work bench. The example class compiles properly, but when run, I get a NoClassDefFoundError com.ibm.xml.parser.Parser. How do I eliminate this error and run the code. Please help. /** * Starts the application. * @param args an array of command-line arguments */ public static void main(java.lang.String[] args) { Parser parser; Document doc; Element root; FileInputStream FIS; Node child,child2; try { // Open the XML file passed as a parameter in memory. FIS = new FileInputStream("d:/contacts.xml"); // Instantiating a Java based XML parser // Passing the XML file to the XML parser parser = new Parser("d:/contacts.xml"); doc = parser.readStream(FIS); // Loading the memvar root with the root element in the XML tree root = doc.getDocumentElement(); child = root.getFirstChild(); child2 = child.getNextSibling(); // Printing out the name of the root element in the XML tree // in a DOS window System.out.println("The Root Element is: " + root.getNodeName()); System.out.println("The First Child is: " + child.getNodeName()); System.out.println("The First Child is: " + child2.getNodeName()); } // Primitive exception handling catch (Exception excp) { System.out.println("Exception raised:" + excp.toString()); } } The xml file in D drive is <?xml version="1.0" ?> <EmpDetails> <EmpName id="eoo1" age="22">Tesr</EmpName> <Address>D3-83 NDA</Address> </EmpDetails>
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
|
As this is really a question of how to configure a particular IDE, I'll move it to the IDE forum for you.
|
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
|
 |
 |
|
|
subject: IBM XML parser for JAVA
|
|
|