Documentation
¶
Overview ¶
Package crosswalk holds the small MARC-field helpers shared by the derivative export codecs (mods, dublincore, citation, schemaorg, unimarc): ISBD punctuation trimming, subfield joining, subject assembly, year extraction, and JSON string escaping. Centralizing them keeps a fix (or a change to the punctuation rules) in one place rather than drifting across five packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendJSONString ¶
AppendJSONString appends s to b as a quoted, escaped JSON string, escaping the characters JSON requires and dropping invalid UTF-8 bytes so the output is always well-formed.
func AppendXMLText ¶ added in v0.7.0
AppendXMLText appends s to b as escaped XML character data: it escapes the markup-significant runes (& < >) and a carriage return, drops control characters XML 1.0 cannot represent (a lossy export), and drops invalid UTF-8 bytes so the output is always well-formed.
func JoinSub ¶
JoinSub joins the ISBD-trimmed values of f's subfields whose codes appear in codes, in field order, separated by sep. Empty values are skipped.
func Subject ¶
func Subject(f codex.Field) string
Subject assembles a subject string from a 6XX field: the topical and subdivision subfields (a, x, y, z, v) in field order, joined with "--", each value trimmed of trailing spaces.
Types ¶
This section is empty.