K
kcwolle
hello,
I want to split an xml file on processing instructions into different
files.
All content between the two PIs should be included in the new file.
The file name should contain the content of first and the last <no>
elements.
example:
<?split ?>
<h1>... text ...</h1>
<start-element/>
<text>
....text text text...
<nr>4</nr>
</text>
text text text
<nr>18</nr>
<end-element/>
<h6> ... text ...</h6>
<?split ?>
In this case the file name should be: test-no4to18.xml and everything
from <h1> to </h6> should be included.
(btw there can be different start and end tags so that no rule on the
starting and ending elements is possible)
I would like to use an XML module (eg XML::Twigs) but how do I get a
node list that contains all nodes between the processing instructions
for further processing?
Can anybody help me?
Yours
Wolfgang
I want to split an xml file on processing instructions into different
files.
All content between the two PIs should be included in the new file.
The file name should contain the content of first and the last <no>
elements.
example:
<?split ?>
<h1>... text ...</h1>
<start-element/>
<text>
....text text text...
<nr>4</nr>
</text>
text text text
<nr>18</nr>
<end-element/>
<h6> ... text ...</h6>
<?split ?>
In this case the file name should be: test-no4to18.xml and everything
from <h1> to </h6> should be included.
(btw there can be different start and end tags so that no rule on the
starting and ending elements is possible)
I would like to use an XML module (eg XML::Twigs) but how do I get a
node list that contains all nodes between the processing instructions
for further processing?
Can anybody help me?
Yours
Wolfgang