I am using JBuilder X Enterprise and have used it to automatically generate a DTD and Java Class files (using BorlandXML) from an xml file. To access it I use the following code (UserDatabase is the root level element in the XML file and exists as a class that was generated by borland):
This is what happens:<br><br>
if filePath is defined as relative to the root project directory (filePath="xml/xmlFile.xml")...
FileInputStream is not null
userDB is null
if filePath is defined as absolute path (filePath="C:\\xmlFiles\\xmlFile.xml")...
FileInputStream is not null
userDB is null
if filePath is defined as in the root project directory (filePath="xmlFile.xml")...
FileInputStream is not null
userDB is not null
Does anyone have any idea why Borland will simply not allow me to reference XML that is anywhere but in the root project directory?
Thank You
Code:
//DEFINED OUTSIDE OF METHOD AS CLASS ATTRIBUTE
static private UserDatabase userDB;
static private filePath="FILE_PATH_IN_HERE";
//THIS IS ALL INSIDE OF A METHOD IN THE SAME CLASS
FileInputStream xml = new FileInputStream(FilePath);
if (xml==null) System.out.println("FileInput null");
userDB=userDB.unmarshal(xml);
if (userDB==null) System.out.println("userDB null");
This is what happens:<br><br>
if filePath is defined as relative to the root project directory (filePath="xml/xmlFile.xml")...
FileInputStream is not null
userDB is null
if filePath is defined as absolute path (filePath="C:\\xmlFiles\\xmlFile.xml")...
FileInputStream is not null
userDB is null
if filePath is defined as in the root project directory (filePath="xmlFile.xml")...
FileInputStream is not null
userDB is not null
Does anyone have any idea why Borland will simply not allow me to reference XML that is anywhere but in the root project directory?
Thank You