• Post Reply Bookmark Topic Watch Topic
  • New Topic

reading the xml files thru java  RSS feed

 
ashok ks
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i read 10 xml files one by one thru .java ?
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this will read one, put in a loop to read any number...

You could have gotten almost identical code from the examples of just about any XML API btw...
 
ashok ks
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If my 10 xml files are in the different directories. How can it gets ?
 
Adrian Yan
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then you can spoon feed the parser one by one, as long as you know where th files are.
 
Sadanand Murthy
Ranch Hand
Posts: 382
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to read in XML file and convert it into an java object then take a look at Castor.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you need to merge the content of multiple XML files into one DOM? That would be a lot trickier. I'm working with a vendor product that reads all the XML files in a tree of directories in a specified order. You could configure the system in one file or a hundred. If any node path is duplicated, the last one in overwrites the old one. So you can have a "master" file that ships with the product and a "custom" file with only a few nodes to override the master values. Any of that sound like what you're doing?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!