Skip to content

Commit 917782f

Browse files
committed
Merge #252 from branch '251-throwFixExecutionException' of https://github.com/metafacture/metafacture-fix
2 parents 101a371 + 1117166 commit 917782f

File tree

5 files changed

+37
-0
lines changed

5 files changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"contribution" : [ {
3+
"agent" : {
4+
"label" : "COLEMAN, Julie",
5+
"label" : "KAY, Christian J."
6+
}
7+
} ]
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<collection xmlns="http://www.loc.gov/MARC21/slim">
3+
<record>
4+
<datafield tag="700" ind1="1" ind2=" ">
5+
<subfield code="a">COLEMAN, Julie</subfield>
6+
<subfield code="e">Editor</subfield>
7+
<subfield code="a">KAY, Christian J.</subfield>
8+
<subfield code="e">NS</subfield>
9+
</datafield>
10+
</record>
11+
</collection>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
set_array("contribution[]")
2+
3+
do list(path: "700[01] ", "var": "$i")
4+
set_hash("contribution[].$append.agent")
5+
copy_field("$i.a", "contribution[].$last.agent.label")
6+
end
7+
8+
replace_all("contribution[].*.agent.label", "(?<!\\p{Upper})\\.$|[,]$", "")
9+
retain("contribution[]")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FLUX_DIR + "input.xml"
2+
|open-file
3+
|decode-xml
4+
|handle-marcxml
5+
|fix(FLUX_DIR + "test.fix")
6+
|encode-json(prettyPrinting="true")
7+
|write(FLUX_DIR + "output-metafix.json")
8+
;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See issue #251

0 commit comments

Comments
 (0)