<root>
<p>this is a paragraph </p>
<p>this is a longer paragraph</p>
<p>this is the longest paragraph</p>
</root>
Can use XPath ' /child::para[position()=2]
'
Now if someone inserts text resulting in a new document
<root>
<p>this is a paragraph </p>
<p>new paragraph this is </p>
<p>this is a longer paragraph</p>
<p>this is the longest paragraph</p>
</root>
The signature would break. Is this a good thing or bad thing? If you permit something like:
<root>
<p>this is a paragraph </p>
<?dsig type="begin" id="1">
<p>this is a longer paragraph</p>
<?dsig type="end" id="1">
<p>this is the longest paragraph</p>
</root>
and use
/descendant-or-self::node()
[
ancestor-or-self::node()/previous-sibling::processing-instruction([@type="begin"][@id="1"])
and
ancestor-or-self::node()/following-sibling::processing-instruction(@type="end"][@id="1"]
]
Your signature might be less likely to break.
The breaking or keeping of the signature is a good/bad thing as defined by the application. Boyer's closure requirement means that applications have the expressitivity/power to define whether its a good or bad thing.