![]() |
BookMARC - Serviços de
Informação Bibliográfica. Edifício Portas de São Miguel, Rua Adriano Lucas, 2ºB, 3020-430 COIMBRA - PORTUGAL Telefone: (351) 239 496 162 - Telefax (351) 239 496 162 http://www.bookmarc.pt - Email: info@BookMARC.pt |
Notes on the prototype and testing environment |
The purpose of the XML scheme for MARC is to provide a formalism for the representation of MARC rules and human oriented information currently held in MARC manuals. The scheme will allow not only HTML, PDF, Windows HELP version of the MARC manual, all generated automatically, but also the production of stylesheets for record transformation with validation or decoding purposes.
The RecordValidator.xsl
stylesheet is automatically
generated by the RecordValidatorGenerator.xslt
stylesheet. This stylesheet uses the information contained in the
sample subset of the UNIMARC manual files to build validation rules to
create the validation stylesheets.
The RecordValidator.xsl
has the following features:
The HTMLFormater.xsl
stylesheet is automatically
generated by the HTMLFormaterGenerator.xslt
. This
stylesheet uses the information contained in the sample subset of the
UNIMARC manual files to create the decoding stylesheets.
The FORMATtoHTML.xsl
stylesheet transforms the XML
version of the sample subset of the UNIMARC manual in an HTML document
for referencial purposes.
Requires Java VM 1.3 or later.
At the DOS prompt or Linux/Unix terminal:
FORMATDescription.xml
file that describes the localization of the sample UNIMARC manual filesThe transform.sh
and transform.bat
are simple scripts that call the command line interpreter of the Saxon
java XLST processor. They take three arguments: XML document, XLS
stylesheet, output file name. They will apply the stylesheet to the XML
document and save the result in the output file.
./bin/transform.sh src/manual/Unimarc0.xml
src/stylesheets/FORMATtoHTML.xsl output/Unimarc0.html
./bin/transform.sh src/xml/FORMATDescription.xml
src/stylesheets/HTMLFormaterGenerator.xslt output/HTMLFormater.xsl
HTMLFormater.xsl
is able to render a record
in HTML:./bin/transform.sh src/xml/Record.xml
output/HTMLFormater.xsl Record.html
./bin/transform.sh src/xml/FORMATDescription.xml
src/stylesheets/RecordValidatorGenerator.xslt output/RecordValidator.xsl
RecordValidator.xsl
is capable of
validating specific records./bin/transform.sh src/xml/Record.xml
output/RecordValidator.xsl output/RecordErrors.xml
This set of additional examples is intended to demonstrate the RecordValidator.xsl
capabilities regarding error detection.In order to test these examples
several errors are going to be inserted in the Record.xml
file. Use the command: ./bin/transform.sh
src/xml/Record.xml output/RecordValidator.xsl
output/RecordErrors.xml
<controlfield tag="999">450981</controlfield>Errors:
<error type="MandatoryControlfield" tag="001"/>
<warning type="UnknownControlfieldTag">
<controlfield xmlns="http://www.loc.gov/MARC21/slim" tag="999">450981</controlfield>
</warning>
<datafield tag="200" ind1="1" ind2=" ">Errors:
<subfield code="a">UNIMARC</subfield>
<subfield code="y">Manual de operações</subfield>
<subfield code="f">Fernanda Maria Guedes de Campos, José Carlos Sottomayor</subfield>
</datafield>
<error type="InvalidSubfieldCode" tagID="d0e49">
<code>y</code>
</error>
<leader>00614kam 22002051 450 </leader>Errors:
<error type="Leader" domain="RECORD-STATUS" start="6" length="1">
<invalid>k</invalid>
<content>00614kam 22002051 450 </content>
<valid-options>
<OPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Corrected Record" value="c"/>
<OPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Deleted Record" value="d"/>
<OPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="New Record" value="n"/>
<OPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Previously Issued Higher Level Record" value="o"/>
<OPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Previously Issued as an Incomplete, Pre-publication Record" value="p"/>
</valid-options>
</error>