This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic