I want a simple little command to strip an XML-Header and Footer from a file:
<?xml version="1.0" encoding="UTF-8"?>
<conxml>
<MsgPain001>
<HashValue>A9C72997C702A2F841B0EEEC3BD274DE1CB7BEA4B813E030D068CB853BCFECA6</HashValue>
<HashAlgorithm>SHA256</HashAlgorithm>
<Document>
...
</Document>
<Document>
...
</Document>
</MsgPain001>
</conxml>
...
Should become just
<Document>
...
</Document>
<Document>
...
</Document>
(note the indenting, the indent of the first document-tag should be stripped of.
This sounds like a (greedy) regex
<Document>.*</Document>
But I dont get it due to the linefeeds.
Could someone provide a simple sed script or similar to get it?
I need it in a pipe to compute a hash over the contained documents.
TIA!