Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Parsing an XML

 
cserveny
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone please help me out. I am trying to parse and XML by using Caster. I do not really understand how it works. I have an xml file with has some tag like these:
<EXPORT>
<SECTION>
<NAME>Client</NAME>
<FILE>1.new</FILE>
<FIELD name="client_shortname" type="CSF" width="?">
<OBJECT name="Client" method="ClientShortName"/>
</FIELD>
</SECTION>
</EXPORT>
When I run the following line of code on the above code it falls over:
Mapping mapping = new Mapping();
mapping.loadMapping("test.xml");
I have looked at some examples on the web and the example codes had tags like: <mapping><description> bla blab bal</description>
<class name="MMMM">
<field name="XXX"> etc
Does this mean that I am only allowed to use these tags above?
Please help me I have been vaisting 4 hrs on this.
Thanks
Kinga
When I run the
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cserveny
Welcome to the JavaRanch! Please adjust your display name to meet
the JavaRanch Naming Policy. You can change it here.
Thanks!
and welcome to the JavaRanch!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic