Closed kefo closed 5 years ago
Looks good to me. Simpler. Not essential, but something about this for-each is tugging at me.
Since, ultimately, it is the subfield=x that we're interested in, the for-each could just query for that path specifically:
<xsl:for-each select="../marc:datafield[@tag='490' and @ind1='1'][$pCurrentPos]/marc:subfield[@code='x']" />
BUt maybe not because I'm not entirely sure what is happening a few lines down where you find following-sibling::marc:subfield...
.
The issue is that a repeating $a (for series/subseries) may or may not have a paired $x (which can also repeat). I think the basic unit we have to process to match with the 8XX is the $a (except in the case of a parallel title), then we have to see if the matched $a has a sibling $x that occurs before another $a appears in the field.
I will go ahead and merge this PR, and if we can come up with a better algorithm, I'm happy to deal with that as a separate issue. Thanks, @kefo!
… test for additional scenario. All tests pass.
@wafschneider I'll let you merge this if it looks sensible. I think it is going to be fine and correct but you are waaaaay more familiar with the workings of this section of the XSL and the specs around this.