Skip to content

Commit fb844ea

Browse files
authored
Merge pull request #304 from metafacture/300-addFluxExample
Add flux example for MarcXmlEncoder
2 parents 7e65dc4 + 3407f14 commit fb844ea

File tree

7 files changed

+991
-1
lines changed

7 files changed

+991
-1
lines changed

metafacture-biblio/src/main/resources/flux-commands.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
decode-marc21 org.metafacture.biblio.marc21.Marc21Decoder
1717
encode-marc21 org.metafacture.biblio.marc21.Marc21Encoder
1818
handle-marcxml org.metafacture.biblio.marc21.MarcXmlHandler
19-
encode-marcxml org.metafacture.biblio.marc21.MarcXmlEncoder
19+
encode-marcxml org.metafacture.biblio.marc21.MarcXmlEncoder
2020

2121
decode-pica org.metafacture.biblio.pica.PicaDecoder
2222
encode-pica org.metafacture.biblio.pica.PicaEncoder
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// opens file 'fileName', interprets the content as non normalized serialized
2+
// pica+, encode as marc, morphs to marcxml and writes to standard out
3+
4+
default fileName = FLUX_DIR + "nonNormalized.pica";
5+
6+
fileName|
7+
open-file|
8+
as-lines|
9+
lines-to-records|
10+
decode-pica(normalizedSerialization="false", ignoreMissingIdn="true")|
11+
morph(FLUX_DIR + "morph-pica-to-marcxml.xml")|
12+
encode-marc21|
13+
decode-marc21(emitLeaderAsWhole="true", ignoreMissingId="true")|
14+
encode-marcxml|
15+
write("stdout");
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<metamorph xmlns="http://www.culturegraph.org/metamorph"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1">
4+
<rules>
5+
<!-- maps PICA+ to marc21Xml -->
6+
<!-- setting the encoding scheme is mandatory. This sets it to utf8. -->
7+
<entity name="leader" flushWith="record">
8+
<choose>
9+
<data source="003.@" name="characterCodingScheme">
10+
<constant value="a" />
11+
</data>
12+
<data source="????" name="characterCodingScheme">
13+
<constant value="a" />
14+
</data>
15+
</choose>
16+
</entity>
17+
<!-- directly invoke "data" creats "controlfields" -->
18+
<data name="001" source="[email protected]" />
19+
<!-- entities triggers creation of "datafields" following the pattern: -->
20+
<!--'entity.name="$fieldname$ind1$ind2"' => '<datafield tag="$fieldname"
21+
ind1="$ind1" ind2="$ind2">' -->
22+
<!-- and 'source.name="$subfield" => <subfield code="$subfield"/> -->
23+
<entity name="650 0" reset="true">
24+
<data source="044N.a" name="a" />
25+
</entity>
26+
</rules>
27+
</metamorph>

0 commit comments

Comments
 (0)