java.util.Properties with XML file.

S

Serguei.Goumeniouk

Dear Experts,
I am looking at the java.util.Properties tools and try to run them with
a XML file. I am confused by a simple problem: in the XML document
description they have declaration for the "key", but not for any
"value" (see attachment). How I can use this structure to access
key/value combinations? Could you please post any example?
Regards,
Serguei.

****************************************************
<?xml version="1.0" encoding="UTF-8"?>
<!-- DTD for properties -->
<!ELEMENT properties ( comment?, entry* ) >
<!ATTLIST properties version CDATA #FIXED "1.0">
<!ELEMENT comment (#PCDATA) >
<!ELEMENT entry (#PCDATA) >
<!ATTLIST entry key CDATA #REQUIRED>
 
R

Roland

Dear Experts,
I am looking at the java.util.Properties tools and try to run them with
a XML file. I am confused by a simple problem: in the XML document
description they have declaration for the "key", but not for any
"value" (see attachment). How I can use this structure to access
key/value combinations? Could you please post any example?
Regards,
Serguei.

****************************************************
<?xml version="1.0" encoding="UTF-8"?>
<!-- DTD for properties -->
<!ELEMENT properties ( comment?, entry* ) >
<!ATTLIST properties version CDATA #FIXED "1.0">
<!ELEMENT comment (#PCDATA) >
<!ELEMENT entry (#PCDATA) >
<!ATTLIST entry key CDATA #REQUIRED>

The data between the opening tag (<entry>) and the closingtag (</entry>)
represents the value. The attribute "key" of <entry> holds the
property's key. Example:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>Example</comment>
<entry key="first.key">First value</entry>
<entry key="second.key">Second value</entry>
</properties>
--
Regards,

Roland de Ruiter
` ___ ___
`/__/ w_/ /__/
/ \ /_/ / \
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,072
Latest member
trafficcone

Latest Threads

Top