Skip to content

Namespace-prefixes of elements and attributes in XML input files are deleted #377

@TobiasNx

Description

@TobiasNx

If decode XML it seems that namespaces in element and attribute names are deleted:

			<mods:mods ID="duepublico_mods_00074526">
				<mods:name type="personal" xlink:type="simple">
					<mods:displayForm>Armbruster, André</mods:displayForm>
					<mods:role>
						<mods:roleTerm authority="marcrelator" type="code">aut</mods:roleTerm>
						<mods:roleTerm authority="marcrelator" type="text">Author</mods:roleTerm>
					</mods:role>
					<mods:nameIdentifier type="gnd">1081830107</mods:nameIdentifier>
					<mods:namePart type="family">Armbruster</mods:namePart>
					<mods:namePart type="given">André</mods:namePart>
				</mods:name>

FLUX:

default infile = FLUX_DIR + "mods.xml";


infile
| open-file
| decode-xml
| handle-generic-xml
| encode-xml // (or: encode-json)
| write(FLUX_DIR + "result.xml")
;

encoded as XML

				<name>
					<type>personal</type>
					<type>simple</type>
					<displayForm>
						<value>Armbruster, André</value>
					</displayForm>
					<role>
						<roleTerm>
							<authority>marcrelator</authority>
							<type>code</type>
							<value>aut</value>
						</roleTerm>
						<roleTerm>
							<authority>marcrelator</authority>
							<type>text</type>
							<value>Author</value>
						</roleTerm>
					</role>
					<nameIdentifier>
						<type>gnd</type>
						<value>1081830107</value>
					</nameIdentifier>
					<namePart>
						<type>family</type>
						<value>Armbruster</value>
					</namePart>
					<namePart>
						<type>given</type>
						<value>André</value>
					</namePart>
				</name>

or encoded as JSON

			"name": {
				"type": "personal",
				"type": "simple",
				"displayForm": {
					"value": "Armbruster, André"
				},
				"role": {
					"roleTerm": {
						"authority": "marcrelator",
						"type": "code",
						"value": "aut"
					},
					"roleTerm": {
						"authority": "marcrelator",
						"type": "text",
						"value": "Author"
					}
				},
				"nameIdentifier": {
					"type": "gnd",
					"value": "1081830107"
				},
				"namePart": {
					"type": "family",
					"value": "Armbruster"
				},
				"namePart": {
					"type": "given",
					"value": "André"
				}
			},

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions