This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes New to Java.  Can you help with whit this (XML) ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "New to Java.  Can you help with whit this (XML) ?" Watch "New to Java.  Can you help with whit this (XML) ?" New topic
Author

New to Java. Can you help with whit this (XML) ?

Filoche Moe
Greenhorn

Joined: Feb 10, 2005
Posts: 1
Hi all.

I'm new to Java (need to do something for my master) and I'm trying to learn how to manipulate XML.

Here's my code :

DOMParser parser;
Document doc;//Document element
Element root;//Root element

public int InitXML (String path)
{
parser = new DOMParser();

try
{
parser.parse(path);
doc = parser.getDocument();
root = doc.getDocumentElement();

}
catch (Exception e)
{
e.printStackTrace(System.err);
System.out.println("XML error in file : " + path );
return 0;

}

return 1; //No error

When using :
parser.parse(path);
I got an error telling me that there whitespace in my shema (I use plain XML, no shema)

Tx for any info that could help me.

Filoche
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: New to Java. Can you help with whit this (XML) ?
 
Similar Threads
How to get an XML field?
Parsing of XML
Adding an attribute to an element
New to XML, need help
SAXException within Servlet