问题描述:

I created a xml files named Config.xml. Below is the content:

<?xml version="1.0"?>

<configuration>

<property>

<name>

color

</name>

<value>

yellow

</value>

<description>

Color

</description>

</property>

</configuration>

I tried to access this xml file using the below code:

 Configuration conf = new Configuration();

conf.addResource("/Users/XXX/Documents/Config.xml");

System.out.println(conf.get("color"));

null is getting printed in the console. Please advice.

相关阅读:
Top