Reader
From DISMARC Help
(→ISO2709RecordReader) |
|||
Line 19: | Line 19: | ||
== XmlRecordReader == | == XmlRecordReader == | ||
+ | This Reader will split the XML at a certain XPath. the following settings are needed: | ||
+ | ; Path: The XPath for which will return each of the nodes | ||
+ | ; Namespace: for XPath to work, you may need to specify some namespaces. Use <prefix>=<namepsace> for this value. You can use this setting multiple times. | ||
== SequentialRecordReader == | == SequentialRecordReader == | ||
Line 25: | Line 28: | ||
== DatabaseRecordReader == | == DatabaseRecordReader == | ||
+ | |||
+ | == MarcTextRecordReader == | ||
+ | |||
+ | == OaiRecordReader == |
Revision as of 08:17, 28 July 2008
A reader is part of an Importer
The RecordReaders, as they are actually called, transform the native data into an XML. Record Readers are configured via the ImporterConfig which will set certain settings before you can get an iterator for a passed file. What does that mean? Well, lets say that you have a really long text file where you have to break at each line starting with a BEGIN RECORD. You would need quite a lot of memmory to read the whole file especially when we need to convert it into a different character encoding. That's why you need to tell the RecordRedaer that you need to break at each of the BEGIN RECORD lines, hand it over to the Mapper and continue to read the file as soon as the mapper is done converting the record. This behaviour is called Iterator because we go through each record at a time. The RecordReaders create theses RecordIterators for each file you've uploaded to the application.
So faar, the application can handle the following native data and generate an XML out of it.
Contents |
CsvRecordReader
The CsvRecordReader iterataes through each line of the supplied file and returns an XML with an element for each column. It takes the following settings:
- Enclosure
- What character surrounds the value of a field in the CSV
- Escape
- What character escapes the following character (which is needed to escape the enclosure for example)
- Delimiter
- What character is used to split the line into the fields
- FirstLineIsHeader
- Is the first line the header line, then thsi line will be used as attribute for the XML output
Iso2709recordReader
This Reader doesn't take any settings as it used the standard. It will create a MARC-XML out of the text file.
XmlRecordReader
This Reader will split the XML at a certain XPath. the following settings are needed:
- Path
- The XPath for which will return each of the nodes
- Namespace
- for XPath to work, you may need to specify some namespaces. Use <prefix>=<namepsace> for this value. You can use this setting multiple times.