• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Can't read an XML file.

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm using GWT 2.4 on Windows 7
I'm trying to learn how to read in an xml file from the tutorial at DevGuideXML
It gives instruction on how to get the information from xml that is in a string.
Unfortunately it does not give any information about how to get the xml file into a string.
I found the answer to the following query at stackflow helpful Stackflow
I'm not sure where I should put the xml file in my project.
If I put the xml file in clients package or the server package I get a warning.
The warning occurs when I run the program, it says that it has not found the xml file.
If I put the xml file in the war package the warning stops but the file still does seem to be getting read

Where should I put the xml file?

Here is the contents of the xml file:



Here is my java code to read the xml file:



What I need to know is which package I put the xml file?
Is this code correct?
 
Laurence Turpin
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I resolved my problem.
I found that I had imported the wrong namespace.
I changed the imports for both Text and Element and my program worked.
 
Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!