我创建了一个名为 Config.xml
. 内容如下:
<?xml version="1.0"?>
<configuration>
<property>
<name>
color
</name>
<value>
yellow
</value>
<description>
Color
</description>
</property>
</configuration>
我尝试使用以下代码访问此xml文件:
Configuration conf = new Configuration();
conf.addResource("/Users/XXX/Documents/Config.xml");
System.out.println(conf.get("color"));
``` `null` 正在控制台中打印。请给我建议。
暂无答案!
目前还没有任何答案,快来回答吧!