0
我想在Eclipse Indigo的工作區中使用XML實體引用,並且無法按預期方式引用xml文件。我使用的語法如下:如何在eclipse中使用xml實體引用
<?xml version="1.0"?>
<!DOCTYPE doc
[
<!ENTITY planName SYSTEM "/planName.xml">
<!-- planName.xml is in the same folder as the current xml i.e. C:\Users\Workspaces\projectA -->
]>
<commands>
<name>&planName;</name>
</commands>
當我嘗試使用這個文件,我得到以下錯誤:
java.io.FileNotFoundException: C:\Users\Desktop\Softwares\IndigoEclipse\planName.xml (The system cannot find the file specified)
如果在另一方面,我給XML文件的絕對路徑,我可以按預期使用該文件
<?xml version="1.0"?>
<!DOCTYPE doc
[
<!ENTITY planName SYSTEM "C:\Users\Workspaces\projectA\planName.xml">
<!-- absolute path of workspace executes normally -->
]>
<commands>
<name>&planName;</name>
</commands>
我可以在不在Eclipse中給出其絕對路徑的情況下引用實體嗎?
重要的是Java代碼,而不是你用來寫它的IDE。 – 2013-03-15 21:04:35
謝謝JB。我驗證了代碼,但是我不確定是否需要調整IDE中的任何安全設置以便修復此問題 – hbabbar 2013-03-15 21:08:04