I'm using xinclude to include some parts of document in another document, for example, in my main document I have:
<document>
<xi:include href="included.xml"
xpointer = "xpointer(*//[@condition="cond1" or not(@condition)])"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</document>
And my included.xml looks like:
<root>
<chapter>
<section condition="cond1">
<para> Condition 1 Para </para>
</section>
<section condition="cond2">
<para> Condition 2 Para </para>
</section>
</chapter>
</root>
My question is, how can I select everything, retaining the proper structure EXCEPT element with attribute condition="cond2" and also none of it's child elements? So I want to select
<root>
<chapter>
<section condition="cond1">
<para> Condition 1 Para </para>
</section>
</chapter>
</root>
The xpointer I have there doesn't work:
xpointer(*//[@condition="cond1" or not(@condition)])