1

Since JDK 1.5 Properties can be loaded from a simple XML file (see IBM article). Is it possible to use XInclude in one of these XML properties files to compose multiple files?

Edward Dale
  • 29,597
  • 13
  • 90
  • 129

1 Answers1

0

As far as I know, java.util.Properties uses DOM to parse xml properties files, and DOM does support XInclude. But it's turned off by default. Maybe you can specify a system property to turn it on (but I don't know).

Another possibility is to try with DTD inclusion:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties [
    <!ENTITY include1 SYSTEM "./include1.xml">
    <!ENTITY include2 SYSTEM "http://foobar.com/include2.xml">
]>

<properties>
    <entry key="foo">bar</entry>
    <entry key="fu">baz</entry>
    &include1;
    &include2;
</properties>

This should work.

Luigi R. Viggiano
  • 8,659
  • 7
  • 53
  • 66