• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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
 
My previous laptop never exploded like that. Read this tiny ad while I sweep up the shards.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic