Here is an example:
<svg width="200" height="200">
<rect x="50" y="50" width="100" height="100"/>
<line x1="0" y1="0" x2="200" y2="200" stroke="red" stroke-width="5" stroke-dasharray="5"/>
</svg>
https://codepen.io/anon/pen/oyqYKZ
I want the red line to be cut out from the rect, so that where there are red dashes on the rect there should be holes in the rect.
I tried to use a clipPath: https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Clipping_and_masking. But that seems to only cut out the "fill" rather than the stroke.