want to use a simple tool (now, I use "xmllint") to parse a xml file, which use 'xinclude' in multiple levels. There are multiple elements in single file.
then my application can parse the result xml file ea, (there is NO xinclude in it)
the command line is like
xmllint input.xml --xinclude --output output.xml --noent
found this article : XML XInclude and two elements with the same name
have tried parse="text", it does NOT work as expectation.
input.xml
<?xml version="1.0"?>
<Tag1 name="nameABC" xmlns:xi="http://www.w3.org/2003/XInclude">
<Setting name="setting1">111</Setting>
<xi:include href="shared.3.xml" parse="text" />
</Tag1>
shared.3.xml
<Setting name="shared_3___1">3_1</Setting>
<Setting name="shared_3___2">3_2</Setting>
<Setting name="shared_3___3">3_3</Setting>
xmllint result is
<?xml version="1.0"?>
<Tag1 xmlns:xi="http://www.w3.org/2003/XInclude" name="nameABC">
<Setting name="setting1">111</Setting>


<Setting name="shared_3___1">3_1</Setting>
<Setting name="shared_3___2">3_2</Setting>
<Setting name="shared_3___3">3_3</Setting>
</Tag1>
my expectation is
<?xml version="1.0"?>
<Tag1 xmlns:xi="http://www.w3.org/2003/XInclude" name="nameABC">
<Setting name="setting1">111</Setting>
<Setting name="shared_3___1">3_1</Setting>
<Setting name="shared_3___2">3_2</Setting>
<Setting name="shared_3___3">3_3</Setting>
</Tag1>
any idea??? thanks a lot
Cannot put mutiple tags ('Setting') to one wrapper tag ('Settings'), because one file can be included by lots of files. Don't want to parse 'Settings' in so many palaces.