Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with BorlandXML Interaction

Status
Not open for further replies.

jewishj

Programmer
Nov 30, 2004
1
0
0
US
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):

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top