I must be doing some stupid mistake. I have a server that returns the XML <a><b>123</b></a>
and now I would like to match against that XML. So I write something like
xml match {
case <a><b>{_}</b></a> => true
}
This works as long as I do not have to deal with multi-line XML literals. So the important thing is that the server sends me the whole XML as a one-liner. The XML is large enough to explode a single line of code, but I can not figure out how to get this to work.
Server sends <a><b>123</b><c>123</c><d>123</d><e>123</e><f>123</f></a>
and I would like to do this:
xml match {
case <a>
<b>{_}</b>
<c>{valueOfC}</c>
<d>{_}</d>
<e>{_}</e>
<f>{_}</f>
</a> => valueOfC
}
But I always get a MatchError. If I write everything in a single line it works. So the question is: how can I match XML while writing human-readable code?
I have of course tried to find an answer via Google. Funny enough all examples are one-liners or work recursive.