views:

48

answers:

3

I have two XML files located in res/xml/. One file is a normal XML file located in that directory called myfile.xml and I can access it normally as R.xml.myfile.

Eclipse allows you to link files in from other locations. I have another XML file that is linked in from another drive. No matter what I do, i can not access this file by R.xml.newfile. I've even tried a DTD file, and isn't available via R either.

Am I doing something wrong, or is this some kind of bug?

+1  A: 

No matter what I do, i can not access this file by R.xml.newfile. I've even tried a DTD file, and isn't available via R either.

If the "linked" file is not in your res/ directory tree, aapt will not find it. If you can get Eclipse to set up "linked" files as symlinks in Linux/OS X, it might work. Or, you can skip the Eclipse "linked" concept and set up the symlink yourself. Or, you can create your own build script to copy the file from its existing spot to your project's res/ directory.

CommonsWare
A: 

Well if the file is not in res or assest folders or inside your project how would it be available when the application is going to execute on actual device.

If the requirements remain same try accessing the xml file generated by another program as a network resource

success_anil
A: 

use SAX Parser to regain the XML data, i dont know about DTD, but i prefer to use SAX or DOM to access a XML file. Sorry cant paste the code here since the SAX uses lot of classes, so tell me whether you need it or not

Lebriga
Unfortunately, that won't help. The issue isn't how to parse the file, the problem I'm having is that the XML file can't be found by the application.
Bromide
then i believe CommonsWare's answer has solved your question
Lebriga