tags:

views:

71

answers:

1

I have two different XML files (IzPack installation to be exact) which a common part. Naturally, I would like to keep this common part in one (external) file and to include it into two XML installation files.

I cannot make it work as it appears that XInclude can only include files with XML elements. To illustrate the example, here is some code:

File 1:

<packs>
 <pack name="1">
 ...
 </pack>
 <pack name="2">
 ...
 </pack>
<packs>

File 2:

<packs>
 <pack name="1">
 ...
 </pack>
 <pack name="2">
 ...
 </pack>
 <pack name="3">
 ...
 </pack>
<packs>

I would like the included file to contain only

 <pack name="1">
 ...
 </pack>
 <pack name="2">
 ...
 </pack>

But it looks like it's impossible. What am I missing ?

Update: The Xinclude code looks like:

<packs>  
  <xi:include xmlns:xi="w3.org/2001/XInclude"; href="browserPacks.xml" parse="text"/>

A: 

How does your xinclude look like? Have you tried parse=text:

 <xi:include href="common.xml" parse="text"
      xmlns:xi="http://www.w3.org/2001/XInclude"/&gt;

So with this, you should be able to have your file1 look like this:

<packs>
   <xi:include href="common.xml" parse="text"
          xmlns:xi="http://www.w3.org/2001/XInclude"/&gt;
<packs>

and your file2 like this:

<packs>
   <xi:include href="common.xml" parse="text"
          xmlns:xi="http://www.w3.org/2001/XInclude"/&gt;
   <pack name="3">
      ....
   </pack>
<packs>
marc_s
Yes, I tried parse="text" - no luck. I'm starting to think that it's a bug in IzPack, although it uses javax.xml
Demiurg