onix2 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +209 -0
- data/README.markdown +69 -0
- data/TODO +14 -0
- data/dtd/2.1r3/iso-amsa.ent +173 -0
- data/dtd/2.1r3/iso-amsb.ent +146 -0
- data/dtd/2.1r3/iso-amsc.ent +49 -0
- data/dtd/2.1r3/iso-amsn.ent +117 -0
- data/dtd/2.1r3/iso-amso.ent +77 -0
- data/dtd/2.1r3/iso-amsr.ent +205 -0
- data/dtd/2.1r3/iso-box.ent +67 -0
- data/dtd/2.1r3/iso-cyr1.ent +94 -0
- data/dtd/2.1r3/iso-cyr2.ent +53 -0
- data/dtd/2.1r3/iso-dia.ent +41 -0
- data/dtd/2.1r3/iso-grk3.ent +70 -0
- data/dtd/2.1r3/iso-lat1.ent +89 -0
- data/dtd/2.1r3/iso-lat2.ent +148 -0
- data/dtd/2.1r3/iso-mfrk.ent +79 -0
- data/dtd/2.1r3/iso-mopf.ent +53 -0
- data/dtd/2.1r3/iso-mscr.ent +79 -0
- data/dtd/2.1r3/iso-num.ent +103 -0
- data/dtd/2.1r3/iso-num.old.ent +103 -0
- data/dtd/2.1r3/iso-pub.ent +110 -0
- data/dtd/2.1r3/iso-tech.ent +183 -0
- data/dtd/2.1r3/onix-international.dtd +1012 -0
- data/dtd/2.1r3/onix-xhtml.elt +672 -0
- data/dtd/2.1r3/reference.elt +4758 -0
- data/dtd/2.1r3/xhtml-special.ent +79 -0
- data/dtd/2.1r3/xhtml-symbol.ent +242 -0
- data/lib/onix2.rb +85 -0
- data/lib/onix2/addressee_identifier.rb +29 -0
- data/lib/onix2/apa_product.rb +785 -0
- data/lib/onix2/audience_range.rb +37 -0
- data/lib/onix2/code_list_extractor.rb +69 -0
- data/lib/onix2/contributor.rb +55 -0
- data/lib/onix2/discount_coded.rb +29 -0
- data/lib/onix2/header.rb +68 -0
- data/lib/onix2/imprint.rb +31 -0
- data/lib/onix2/language.rb +29 -0
- data/lib/onix2/lists.rb +134 -0
- data/lib/onix2/market_representation.rb +38 -0
- data/lib/onix2/measure.rb +29 -0
- data/lib/onix2/media_file.rb +33 -0
- data/lib/onix2/other_text.rb +35 -0
- data/lib/onix2/price.rb +47 -0
- data/lib/onix2/product.rb +97 -0
- data/lib/onix2/product_identifier.rb +27 -0
- data/lib/onix2/publisher.rb +33 -0
- data/lib/onix2/reader.rb +157 -0
- data/lib/onix2/sales_restriction.rb +25 -0
- data/lib/onix2/sales_rights.rb +28 -0
- data/lib/onix2/sender_identifier.rb +29 -0
- data/lib/onix2/series.rb +28 -0
- data/lib/onix2/series_identifier.rb +27 -0
- data/lib/onix2/simple_product.rb +47 -0
- data/lib/onix2/stock.rb +29 -0
- data/lib/onix2/subject.rb +33 -0
- data/lib/onix2/supply_detail.rb +53 -0
- data/lib/onix2/title.rb +33 -0
- data/lib/onix2/version.rb +3 -0
- data/lib/onix2/website.rb +29 -0
- data/lib/onix2/writer.rb +86 -0
- data/spec/addressee_identifier_spec.rb +33 -0
- data/spec/apa_product_spec.rb +116 -0
- data/spec/audience_range_spec.rb +44 -0
- data/spec/contributor_spec.rb +38 -0
- data/spec/discount_coded_spec.rb +34 -0
- data/spec/header_spec.rb +153 -0
- data/spec/imprint_spec.rb +31 -0
- data/spec/language_spec.rb +38 -0
- data/spec/lists_spec.rb +33 -0
- data/spec/market_representation_spec.rb +33 -0
- data/spec/measure_spec.rb +38 -0
- data/spec/media_file_spec.rb +38 -0
- data/spec/other_text_spec.rb +33 -0
- data/spec/price_spec.rb +52 -0
- data/spec/product_identifier_spec.rb +34 -0
- data/spec/product_spec.rb +102 -0
- data/spec/publisher_spec.rb +33 -0
- data/spec/reader_spec.rb +155 -0
- data/spec/sales_restriction_spec.rb +27 -0
- data/spec/sender_identifier.rb +33 -0
- data/spec/series_identifier_spec.rb +33 -0
- data/spec/series_spec.rb +47 -0
- data/spec/spec_helper.rb +15 -0
- data/spec/stock_spec.rb +39 -0
- data/spec/subject_spec.rb +34 -0
- data/spec/supply_detail_spec.rb +97 -0
- data/spec/title_spec.rb +38 -0
- data/spec/website_spec.rb +33 -0
- data/spec/writer_spec.rb +78 -0
- data/support/codes/001.tsv +10 -0
- data/support/codes/002.tsv +5 -0
- data/support/codes/003.tsv +7 -0
- data/support/codes/005.tsv +13 -0
- data/support/codes/006.tsv +76 -0
- data/support/codes/007.tsv +123 -0
- data/support/codes/008.tsv +7 -0
- data/support/codes/009.tsv +7 -0
- data/support/codes/010.tsv +34 -0
- data/support/codes/011.tsv +11 -0
- data/support/codes/012.tsv +11 -0
- data/support/codes/013.tsv +7 -0
- data/support/codes/014.tsv +4 -0
- data/support/codes/015.tsv +13 -0
- data/support/codes/016.tsv +6 -0
- data/support/codes/017.tsv +90 -0
- data/support/codes/018.tsv +3 -0
- data/support/codes/019.tsv +7 -0
- data/support/codes/020.tsv +0 -0
- data/support/codes/021.tsv +31 -0
- data/support/codes/022.tsv +9 -0
- data/support/codes/023.tsv +9 -0
- data/support/codes/024.tsv +11 -0
- data/support/codes/025.tsv +29 -0
- data/support/codes/026.tsv +75 -0
- data/support/codes/027.tsv +75 -0
- data/support/codes/028.tsv +8 -0
- data/support/codes/029.tsv +16 -0
- data/support/codes/030.tsv +15 -0
- data/support/codes/031.tsv +3 -0
- data/support/codes/032.tsv +2 -0
- data/support/codes/033.tsv +36 -0
- data/support/codes/034.tsv +14 -0
- data/support/codes/035.tsv +6 -0
- data/support/codes/036.tsv +3 -0
- data/support/codes/037.tsv +6 -0
- data/support/codes/038.tsv +36 -0
- data/support/codes/039.tsv +8 -0
- data/support/codes/040.tsv +6 -0
- data/support/codes/041.tsv +6 -0
- data/support/codes/042.tsv +16 -0
- data/support/codes/043.tsv +4 -0
- data/support/codes/044.tsv +13 -0
- data/support/codes/045.tsv +12 -0
- data/support/codes/046.tsv +3 -0
- data/support/codes/047.tsv +4 -0
- data/support/codes/048.tsv +11 -0
- data/support/codes/049.tsv +84 -0
- data/support/codes/050.tsv +8 -0
- data/support/codes/051.tsv +27 -0
- data/support/codes/052.tsv +1 -0
- data/support/codes/053.tsv +3 -0
- data/support/codes/054.tsv +23 -0
- data/support/codes/055.tsv +13 -0
- data/support/codes/056.tsv +2 -0
- data/support/codes/057.tsv +5 -0
- data/support/codes/058.tsv +21 -0
- data/support/codes/059.tsv +4 -0
- data/support/codes/060.tsv +2 -0
- data/support/codes/061.tsv +3 -0
- data/support/codes/062.tsv +5 -0
- data/support/codes/063.tsv +0 -0
- data/support/codes/064.tsv +13 -0
- data/support/codes/065.tsv +25 -0
- data/support/codes/066.tsv +4 -0
- data/support/codes/067.tsv +2 -0
- data/support/codes/068.tsv +15 -0
- data/support/codes/069.tsv +4 -0
- data/support/codes/070.tsv +2 -0
- data/support/codes/071.tsv +9 -0
- data/support/codes/072.tsv +7 -0
- data/support/codes/073.tsv +36 -0
- data/support/codes/074.tsv +489 -0
- data/support/codes/075.tsv +2 -0
- data/support/codes/076.tsv +12 -0
- data/support/codes/077.tsv +19 -0
- data/support/codes/078.tsv +148 -0
- data/support/codes/079.tsv +17 -0
- data/support/codes/080.tsv +19 -0
- data/support/codes/081.tsv +11 -0
- data/support/codes/082.tsv +17 -0
- data/support/codes/083.tsv +68 -0
- data/support/codes/084.tsv +10 -0
- data/support/codes/085.tsv +23 -0
- data/support/codes/086.tsv +5 -0
- data/support/codes/087.tsv +6 -0
- data/support/codes/088.tsv +0 -0
- data/support/codes/089.tsv +1 -0
- data/support/codes/090.tsv +11 -0
- data/support/codes/091.tsv +248 -0
- data/support/codes/092.tsv +7 -0
- data/support/codes/093.tsv +13 -0
- data/support/codes/094.tsv +3 -0
- data/support/codes/095.tsv +3 -0
- data/support/codes/096.tsv +185 -0
- data/support/codes/097.tsv +1 -0
- data/support/codes/098.tsv +21 -0
- data/support/codes/099.tsv +24 -0
- data/support/codes/100.tsv +4 -0
- data/support/codes/101.tsv +2 -0
- data/support/codes/102.tsv +3 -0
- data/support/codes/121.tsv +127 -0
- data/support/codes/138.tsv +6 -0
- data/support/codes/139.tsv +70 -0
- data/support/codes/140.tsv +7 -0
- data/support/codes/141.tsv +10 -0
- data/support/codes/142.tsv +12 -0
- data/support/codes/143.tsv +7 -0
- data/support/codes/144.tsv +4 -0
- data/support/codes/145.tsv +5 -0
- data/support/codes/146.tsv +3 -0
- data/support/codes/147.tsv +7 -0
- data/support/codes/148.tsv +3 -0
- data/support/codes/149.tsv +4 -0
- data/support/codes/150.tsv +124 -0
- data/support/codes/151.tsv +7 -0
- data/support/codes/152.tsv +2 -0
- data/support/codes/153.tsv +14 -0
- data/support/codes/154.tsv +9 -0
- data/support/codes/155.tsv +5 -0
- data/support/codes/156.tsv +4 -0
- data/support/codes/157.tsv +4 -0
- data/support/codes/158.tsv +24 -0
- data/support/codes/159.tsv +6 -0
- data/support/codes/160.tsv +0 -0
- data/support/codes/161.tsv +3 -0
- data/support/codes/162.tsv +3 -0
- data/support/codes/163.tsv +7 -0
- data/support/codes/164.tsv +2 -0
- data/support/codes/165.tsv +2 -0
- data/support/codes/166.tsv +2 -0
- data/support/codes/167.tsv +3 -0
- data/support/codes/168.tsv +2 -0
- data/support/codes/169.tsv +3 -0
- data/support/codes/170.tsv +0 -0
- data/support/codes/171.tsv +2 -0
- data/support/codes/172.tsv +1 -0
- data/support/codes/173.tsv +2 -0
- data/support/codes/174.tsv +2 -0
- data/support/codes/175.tsv +175 -0
- data/support/codes/176.tsv +12 -0
- data/support/codes/177.tsv +2 -0
- data/support/codes/178.tsv +17 -0
- data/support/entities.txt +1499 -0
- data/support/extract.rb +25 -0
- data/support/switch-onix-2.1-short-to-reference.xsl +24 -0
- data/support/switch-onix-tagnames-1.1.xsl +25 -0
- data/support/switch-onix-tagnames-2.0.xsl +37 -0
- metadata +440 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: 50f126800e100d586d04c08d38dda4ae2848d1f0
|
4
|
+
data.tar.gz: 2d9c6ce7a8af1235618b03bc836939ffa69f822d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2e6e5326ef686ed74da30fd453139c0cbbb966fb40a3537d4f6ff18c8901c11945b607ce571f567ecc50a3751466b6da88a49f7cff369a3e88aac72825f91990
|
7
|
+
data.tar.gz: c326ca07e60476dc8b30c2866ae4a01e52f38635c64ba15532ff4f9c5e8e1db80fdf7aab137633e1e657a55b3cb3f6d8e4006b3e03435a7cc36f4c61620b377f
|
data/CHANGELOG
ADDED
@@ -0,0 +1,209 @@
|
|
1
|
+
v1.0.0 (4th December 2014)
|
2
|
+
- Rename ONIX to ONIX2
|
3
|
+
- Add SalesRight to Product
|
4
|
+
- Remove Normaliser
|
5
|
+
|
6
|
+
v0.9.5 (28th December 2012)
|
7
|
+
- Bugfix: AudienceRangeValue can be non-numeric
|
8
|
+
|
9
|
+
v0.9.4 (24th April 2012)
|
10
|
+
- Upgrade roxml dependency
|
11
|
+
- expand APAProduct to allow the nett price to be set
|
12
|
+
|
13
|
+
v0.9.3 (8th November 2011)
|
14
|
+
- Fix ordering of elements within thew Price composite
|
15
|
+
|
16
|
+
v0.9.2 (7th November 2011)
|
17
|
+
- add basic support for setting and retrieving discount codes on prices
|
18
|
+
|
19
|
+
v0.9.1 (5th September 2011)
|
20
|
+
- relax activesupport dependency to work with rails 3 or 3.1
|
21
|
+
|
22
|
+
v0.9.0 (14th April 2011)
|
23
|
+
- switch back to the vanilla roxml gem. Ben is maintaining it again and
|
24
|
+
he has merged in my bug fixes
|
25
|
+
- clarify comments explaining encoding behaviour
|
26
|
+
- Add options hash to ONIX2::Reader. Only option at this stage is :encoding,
|
27
|
+
which allows the user to override the assumed encoding of the input XML
|
28
|
+
- API change, so new minor version
|
29
|
+
|
30
|
+
v0.8.5 (21st December 2010)
|
31
|
+
- update packaging - use bundler and rspec 2.x
|
32
|
+
- support normalising short tag files that include HTML tags
|
33
|
+
|
34
|
+
v0.8.4 (18th October 2010)
|
35
|
+
- some small fixes to xml names from Tim
|
36
|
+
- make all code lists available via the ONIX2::Lists class
|
37
|
+
|
38
|
+
v0.8.3 (9th September 2010)
|
39
|
+
- Fix for race condition in ONIX2::Normaliser
|
40
|
+
- thanks to pixelvixen for reporting
|
41
|
+
- force roxml to be 3.1.6 or higher. Earlier versions misbehaved when monkey
|
42
|
+
patching nokogiri
|
43
|
+
|
44
|
+
v0.8.2 (6th May 2010)
|
45
|
+
- fix APAProduct#series and APAProduct#series=
|
46
|
+
|
47
|
+
v0.8.1 (5th January 2010)
|
48
|
+
- Use nokogiri's support for transparent entity conversion when reading an ONIX file
|
49
|
+
- Removed entity replacement from ONIX2::Normaliser
|
50
|
+
- the external dependency on sed made me uncomfortable, and it wasn't really
|
51
|
+
necessary now that nokogiri can do it for us
|
52
|
+
- Removed utf-8 normalisation from ONIX2::Normaliser
|
53
|
+
- nokogiri also handles this really cleanly and transparently. Regardless of
|
54
|
+
the source file encoding, Nokogiri::Reader returns utf-8 encoded data
|
55
|
+
- Add the release attribute to files we generate
|
56
|
+
- it's optional in 2.1, but mandatory in 3.0. As we start to see 3.0 files in the
|
57
|
+
wild it will help to have a rapid way to distinguish between them
|
58
|
+
- Add ONIX2::Reader#release - to detect the release version of files we read in
|
59
|
+
|
60
|
+
v0.8.0 (31st October 2009)
|
61
|
+
- Replace LibXML dependency with Nokogiri. Nokogiri is under active development, has
|
62
|
+
a responsive maintainer and is significantly more stable
|
63
|
+
- Switch to ROXML 3.x
|
64
|
+
- roxml also switched from libxml to nokogiri
|
65
|
+
- roxml removed deprecated parts of it's API
|
66
|
+
- should now avoid various conflicts with mongrel
|
67
|
+
- Ensure APAProduct#price returns the first product price and ignores
|
68
|
+
the price type
|
69
|
+
|
70
|
+
v0.7.8 (19th October 2009)
|
71
|
+
- add support for additional elements (mostly series and audience related)
|
72
|
+
- thanks tim
|
73
|
+
|
74
|
+
v0.7.7 (1st October 2009)
|
75
|
+
- optimise sed usage in ONIX2::Normaliser. *huge* speed improvement on
|
76
|
+
large files.
|
77
|
+
|
78
|
+
v0.7.6 (21st September 2009)
|
79
|
+
- provide access to the PackQuantity element
|
80
|
+
|
81
|
+
v0.7.5 (8th September 2009)
|
82
|
+
- Don't raise an exception on malformed dates when reading files
|
83
|
+
|
84
|
+
v0.7.4 (2nd September 2009)
|
85
|
+
- Expand ONIX2::Normaliser
|
86
|
+
- strip control chars
|
87
|
+
- add encoding declaration to valid utf-8 files that aren't declared
|
88
|
+
as such
|
89
|
+
|
90
|
+
v0.7.3 (19th August 2009)
|
91
|
+
- Switch from java to xsltproc to convert short tag ONIX files
|
92
|
+
to reference tags
|
93
|
+
|
94
|
+
v0.7.2 (19th August 2009)
|
95
|
+
- Added ONIX2::Normaliser class
|
96
|
+
- for normalising various ONIX files into a form that makes them easy
|
97
|
+
to process. Shouldn't be necesary to pre-process files like this, but
|
98
|
+
I'm sick of trying to wrestle the libxml ruby bindings
|
99
|
+
|
100
|
+
v0.7.1 (24th June 2009)
|
101
|
+
- Small tweak to ordering of elements in the Product group
|
102
|
+
|
103
|
+
v0.7.0 (17th June 2009)
|
104
|
+
- try using LibXML for reader again
|
105
|
+
- retrieving the ONIX version of the input file is currently disabled, as
|
106
|
+
that seems to be the source of our instability
|
107
|
+
- Various Ruby 1.9 compatability tweaks
|
108
|
+
- add source file coding declarations. All source files are UTF-8
|
109
|
+
- ONIX2::Reader ensures all input data is converted to UTF-8
|
110
|
+
- the ROXML based objects seem to forget the encoding when they're marshalled,
|
111
|
+
so force string based attributes *back* to UTF-8
|
112
|
+
|
113
|
+
v0.6.7 (Unreleased)
|
114
|
+
- add some accessors to the Title composite
|
115
|
+
|
116
|
+
v0.6.6 (Unreleased)
|
117
|
+
- Forget the S on an element name
|
118
|
+
|
119
|
+
v0.6.5 (Unreleased)
|
120
|
+
- Ruby 1.9 compat
|
121
|
+
|
122
|
+
v0.6.4 (Unreleased)
|
123
|
+
- Add APAProduct#price
|
124
|
+
|
125
|
+
v0.6.3(Unreleased)
|
126
|
+
- Bump ROXML dependency to 2.5.3 to get libxml-ruby 1.1.3 compatibility
|
127
|
+
|
128
|
+
v0.6.2 (Unreleased)
|
129
|
+
- Fix a small typo in APAProduct
|
130
|
+
|
131
|
+
v0.6.1 (Unreleased)
|
132
|
+
- Stopped using LibXMLs Reader class as the basis for our reader.
|
133
|
+
- We were getting too many segfaults (even 1 is too many!)
|
134
|
+
- until we resolve it, reverted to manual string parsing
|
135
|
+
- This is a fairly major regression of functionality. For 99% of files
|
136
|
+
it won't matter, but for some corner cases it will. ie UTF-16 encoded
|
137
|
+
files
|
138
|
+
- Will also be noticeably slower
|
139
|
+
- Hopefully only a short term fix, until I work out what is going on with
|
140
|
+
libxml
|
141
|
+
|
142
|
+
v0.6.0 (18th March 2009)
|
143
|
+
- remove use of threads in ONIX2::Reader
|
144
|
+
- a producer/consumer pattern was useful in the REXML stream parsing days, but
|
145
|
+
now LibXML's Reader binding provides a better alternative
|
146
|
+
- API left unchanged, this was all under the hood
|
147
|
+
- bump required ROXML version to 2.5.2
|
148
|
+
|
149
|
+
v0.5.1 (4th March 2009)
|
150
|
+
- Fix a single letter typo
|
151
|
+
|
152
|
+
v0.5 (2nd March 2009)
|
153
|
+
- Switch ROXML dependency from a patched version to vanilla
|
154
|
+
- Vanilla ROXML now has all the features we need
|
155
|
+
- This change should be transparent to ONIX gem users
|
156
|
+
|
157
|
+
v0.4.7 (9th December 2008)
|
158
|
+
- Contributor sub elements should match the order specified in the DTD
|
159
|
+
|
160
|
+
v0.4.6 (2nd December 2008)
|
161
|
+
- 2 new accessors on the contributor class - bio and corporate name
|
162
|
+
|
163
|
+
v0.4.5 (21st November 2008)
|
164
|
+
- APAProduct wrapper should generate valid MediaFile composites
|
165
|
+
|
166
|
+
v0.4.4 (19th November 2008)
|
167
|
+
- Added support for more elements from MarketRepresentation
|
168
|
+
|
169
|
+
v0.4.3 (11th November 2008)
|
170
|
+
- Added support for AgentName and MarketPublishingStatus
|
171
|
+
|
172
|
+
v0.4.2 (1st November 2008)
|
173
|
+
- Remove final remnants of REXML code
|
174
|
+
- Minor reordering of elements to match DTD
|
175
|
+
|
176
|
+
v0.4.1 (UNRELEASED)
|
177
|
+
- Added accessors to various product measurements. Height, weight, etc.
|
178
|
+
- Reduced time for an ONIX2::Reader class to initialise
|
179
|
+
|
180
|
+
v0.4.0 (28th October 2008)
|
181
|
+
- Major rework: now based on ROXML instead of xml-mapping
|
182
|
+
- Mostly API Compatible
|
183
|
+
- StreamReader and StreamWriter renamed to Reader and Writer
|
184
|
+
- ROXML is based on libxml, so things should be significantly faster
|
185
|
+
|
186
|
+
v0.2.7 (Unreleased)
|
187
|
+
- Add line breaks after each product
|
188
|
+
|
189
|
+
v0.2.5 (Unreleased)
|
190
|
+
- Make PublishingStatus a two_digit_node
|
191
|
+
|
192
|
+
v0.2.4 (Unreleased)
|
193
|
+
- Initialise the media files array of a new product correctly
|
194
|
+
|
195
|
+
v0.2.3 (Unreleased)
|
196
|
+
- Switch a few more fields over to TwoDigitNodes
|
197
|
+
- Make the product availability field accessible from APAProduct
|
198
|
+
|
199
|
+
v0.2.2 (Unreleased)
|
200
|
+
- Add a new nodetype (DateNode) for YYYYMMDD fields
|
201
|
+
|
202
|
+
v0.2.1 (Unreleased)
|
203
|
+
- Add a new nodetype (TwoDigitNode) for two digit codes
|
204
|
+
|
205
|
+
v0.2.0 (16th July 2008)
|
206
|
+
- Add support for reading and storing subject codes (BIC, BISAC, etc)
|
207
|
+
|
208
|
+
v0.1.0 (12th June 2008)
|
209
|
+
- Initial Release
|
data/README.markdown
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
## ONIX
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/exAspArk/onix2.svg?branch=master)](https://travis-ci.org/exAspArk/onix2)
|
4
|
+
|
5
|
+
The ONIX standard is a somewhat verbose XML format that is rapidly becoming the
|
6
|
+
industry standard for electronic data sharing in the book and publishing
|
7
|
+
industries.
|
8
|
+
|
9
|
+
This library provides a slim layer over the format and simplifies both reading
|
10
|
+
and writing ONIX files in your ruby applications.
|
11
|
+
|
12
|
+
This replaces the obsolete rbook-onix gem that was spectacular in its crapness.
|
13
|
+
Let us never speak of it again.
|
14
|
+
|
15
|
+
## Feature Support
|
16
|
+
|
17
|
+
This library currently only handles ONIX 2.1 files (all revisions). At some
|
18
|
+
point I'll need to work out what to do about supporting ONIX 3.0 files. I
|
19
|
+
suspect a separate library will be the simplest solution.
|
20
|
+
|
21
|
+
ONIX2::Reader only handles the reference tag versions of ONIX 2.1. Use
|
22
|
+
ONIX2::Normaliser to convert any short tag files to reference tags.
|
23
|
+
|
24
|
+
ONIX2::Writer only generates reference tag ONIX files.
|
25
|
+
|
26
|
+
It baffles me why anyone thought designing two parallel versions of the ONIX
|
27
|
+
spec was a good idea. Use reference tags my friends, and let short tags fade
|
28
|
+
away into irrelevant obscurity.
|
29
|
+
|
30
|
+
## DTD Loading
|
31
|
+
|
32
|
+
To correctly handle named entities when reading an ONIX file, this gem attempts
|
33
|
+
to load the DTD describing the ONIX format into memory. By default, this means
|
34
|
+
each file you read will require several hundred Kb of data to be downloaded
|
35
|
+
over the net.
|
36
|
+
|
37
|
+
This is obviously not desirable in most cases. To avoid it, you need to add copies
|
38
|
+
of the ONIX DTDs into your system XML catalog. On Debian and Ubuntu systems,
|
39
|
+
the quickest way to do that is to build and install the package available @
|
40
|
+
http://github.com/yob/onix-dtd
|
41
|
+
|
42
|
+
## Installation
|
43
|
+
|
44
|
+
gem install onix
|
45
|
+
|
46
|
+
## Usage
|
47
|
+
|
48
|
+
See files in the examples directory to get started quickly. For further reading
|
49
|
+
view the comments to the following classes:
|
50
|
+
|
51
|
+
* ONIX2::Reader - For reading ONIX files
|
52
|
+
* ONIX2::Writer - For writing ONIX files
|
53
|
+
* ONIX2::Normaliser - For normalising ONIX files before reading them. Fixes encoding issues, etc
|
54
|
+
* ONIX2::Lists - For building hashes of code lists from the ONIX spec
|
55
|
+
|
56
|
+
## Licensing
|
57
|
+
|
58
|
+
This library is distributed under the terms of the MIT License. See the included file for
|
59
|
+
more detail.
|
60
|
+
|
61
|
+
## Contributing
|
62
|
+
|
63
|
+
All suggestions and patches welcome, preferably via a git repository I can pull from.
|
64
|
+
To be honest, I'm not really expecting any, this is a niche library.
|
65
|
+
|
66
|
+
## Further Reading
|
67
|
+
|
68
|
+
- The source: [http://github.com/yob/onix/tree/master](http://github.com/yob/onix/tree/master)
|
69
|
+
- The official specs [http://www.editeur.org/8/ONIX/](http://www.editeur.org/8/ONIX/)
|
data/TODO
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
- finish adding support for all tags in a Product record
|
2
|
+
- contributor still needs some obscure tags added
|
3
|
+
- add a new node type for dates that should be in the form YYYYMMDD
|
4
|
+
- allow symbols to be used instead of numeric codes
|
5
|
+
- contribution type, id type, etc
|
6
|
+
- validations
|
7
|
+
- hard stuff from the spec
|
8
|
+
- 2 digit numbers, 8 digit dates, char limits on text fields
|
9
|
+
- code lists
|
10
|
+
- only values in code lists allowed in relevant fields
|
11
|
+
- regional requirements
|
12
|
+
- titlepage minimum set of tags
|
13
|
+
- APA (if different to titlepage)
|
14
|
+
- documentation
|
@@ -0,0 +1,173 @@
|
|
1
|
+
|
2
|
+
<!--
|
3
|
+
File isoamsa.ent produced by the XSL script mmldtd.xsl
|
4
|
+
from input data in unicode.xml.
|
5
|
+
|
6
|
+
Please report any errors to
|
7
|
+
David Carlisle <davidc@nag.co.uk>.
|
8
|
+
|
9
|
+
The numeric character values assigned to each entity
|
10
|
+
(should) match either official Unicode assignments
|
11
|
+
or assignments provisionally allocated by the
|
12
|
+
Unicode Consortium based on the characters in the `STIX'
|
13
|
+
propsal for mathematics. Note that these assignments
|
14
|
+
have not been ratified by the corresponding ISO
|
15
|
+
committee and thus should be considered liable to
|
16
|
+
change.
|
17
|
+
|
18
|
+
Entity names in this file are derived from files carrying the
|
19
|
+
following notice:
|
20
|
+
|
21
|
+
(C) International Organization for Standardization 1991
|
22
|
+
Permission to copy in any form is granted for use with
|
23
|
+
conforming SGML systems and applications as defined in
|
24
|
+
ISO 8879, provided this notice is included in all copies.
|
25
|
+
|
26
|
+
-->
|
27
|
+
|
28
|
+
<!ENTITY angzarr "⍼" ><!--angle with down zig-zag arrow -->
|
29
|
+
<!ENTITY cirmid "⫯" ><!--circle, mid below -->
|
30
|
+
<!ENTITY cudarrl "⤸" ><!--left, curved, down arrow -->
|
31
|
+
<!ENTITY cudarrr "⤵" ><!--right, curved, down arrow -->
|
32
|
+
<!ENTITY cularr "↶" ><!--/curvearrowleft A: left curved arrow -->
|
33
|
+
<!ENTITY cularrp "⤽" ><!--curved left arrow with plus -->
|
34
|
+
<!ENTITY curarr "↷" ><!--/curvearrowright A: rt curved arrow -->
|
35
|
+
<!ENTITY curarrm "⤼" ><!--curved right arrow with minus -->
|
36
|
+
<!ENTITY dArr "⇓" ><!--/Downarrow A: down dbl arrow -->
|
37
|
+
<!ENTITY Darr "↡" ><!--down two-headed arrow -->
|
38
|
+
<!ENTITY ddarr "⇊" ><!--/downdownarrows A: two down arrows -->
|
39
|
+
<!ENTITY DDotrahd "⤑" ><!--right arrow with dotted stem -->
|
40
|
+
<!ENTITY dfisht "⥿" ><!--down fish tail -->
|
41
|
+
<!ENTITY dHar "⥥" ><!--down harpoon-left, down harpoon-right -->
|
42
|
+
<!ENTITY dharl "⇃" ><!--/downharpoonleft A: dn harpoon-left -->
|
43
|
+
<!ENTITY dharr "⇂" ><!--/downharpoonright A: down harpoon-rt -->
|
44
|
+
<!ENTITY duarr "⇵" ><!--down arrow, up arrow -->
|
45
|
+
<!ENTITY duhar "⥯" ><!--down harp, up harp -->
|
46
|
+
<!ENTITY dzigrarr "" ><!--right long zig-zag arrow -->
|
47
|
+
<!ENTITY erarr "⥱" ><!--equal, right arrow below -->
|
48
|
+
<!ENTITY harr "↔" ><!--/leftrightarrow A: l&r arrow -->
|
49
|
+
<!ENTITY hArr "⇔" ><!--/Leftrightarrow A: l&r dbl arrow -->
|
50
|
+
<!ENTITY harrcir "⥈" ><!--left and right arrow with a circle -->
|
51
|
+
<!ENTITY harrw "↭" ><!--/leftrightsquigarrow A: l&r arr-wavy -->
|
52
|
+
<!ENTITY hoarr "⇿" ><!--horizontal open arrow -->
|
53
|
+
<!ENTITY imof "⊷" ><!--image of -->
|
54
|
+
<!ENTITY lAarr "⇚" ><!--/Lleftarrow A: left triple arrow -->
|
55
|
+
<!ENTITY Larr "↞" ><!--/twoheadleftarrow A: -->
|
56
|
+
<!ENTITY larrbfs "⤟" ><!--left arrow-bar, filled square -->
|
57
|
+
<!ENTITY larrfs "⤝" ><!--left arrow, filled square -->
|
58
|
+
<!ENTITY larrhk "↩" ><!--/hookleftarrow A: left arrow-hooked -->
|
59
|
+
<!ENTITY larrlp "↫" ><!--/looparrowleft A: left arrow-looped -->
|
60
|
+
<!ENTITY larrpl "⤹" ><!--left arrow, plus -->
|
61
|
+
<!ENTITY larrsim "⥳" ><!--left arrow, similar -->
|
62
|
+
<!ENTITY larrtl "↢" ><!--/leftarrowtail A: left arrow-tailed -->
|
63
|
+
<!ENTITY latail "⤙" ><!--left arrow-tail -->
|
64
|
+
<!ENTITY lAtail "⤛" ><!--left double arrow-tail -->
|
65
|
+
<!ENTITY lbarr "⤌" ><!--left broken arrow -->
|
66
|
+
<!ENTITY lBarr "⤎" ><!--left doubly broken arrow -->
|
67
|
+
<!ENTITY ldca "⤶" ><!--left down curved arrow -->
|
68
|
+
<!ENTITY ldrdhar "⥧" ><!--left harpoon-down over right harpoon-down -->
|
69
|
+
<!ENTITY ldrushar "⥋" ><!--left-down-right-up harpoon -->
|
70
|
+
<!ENTITY ldsh "↲" ><!--left down angled arrow -->
|
71
|
+
<!ENTITY lfisht "⥼" ><!--left fish tail -->
|
72
|
+
<!ENTITY lHar "⥢" ><!--left harpoon-up over left harpoon-down -->
|
73
|
+
<!ENTITY lhard "↽" ><!--/leftharpoondown A: l harpoon-down -->
|
74
|
+
<!ENTITY lharu "↼" ><!--/leftharpoonup A: left harpoon-up -->
|
75
|
+
<!ENTITY lharul "⥪" ><!--left harpoon-up over long dash -->
|
76
|
+
<!ENTITY llarr "⇇" ><!--/leftleftarrows A: two left arrows -->
|
77
|
+
<!ENTITY llhard "⥫" ><!--left harpoon-down below long dash -->
|
78
|
+
<!ENTITY loarr "⇽" ><!--left open arrow -->
|
79
|
+
<!ENTITY lrarr "⇆" ><!--/leftrightarrows A: l arr over r arr -->
|
80
|
+
<!ENTITY lrhar "⇋" ><!--/leftrightharpoons A: l harp over r -->
|
81
|
+
<!ENTITY lrhard "⥭" ><!--right harpoon-down below long dash -->
|
82
|
+
<!ENTITY lsh "↰" ><!--/Lsh A: -->
|
83
|
+
<!ENTITY lurdshar "⥊" ><!--left-up-right-down harpoon -->
|
84
|
+
<!ENTITY luruhar "⥦" ><!--left harpoon-up over right harpoon-up -->
|
85
|
+
<!ENTITY map "↦" ><!--/mapsto A: -->
|
86
|
+
<!ENTITY Map "⤅" ><!--twoheaded mapsto -->
|
87
|
+
<!ENTITY midcir "⫰" ><!--mid, circle below -->
|
88
|
+
<!ENTITY mumap "⊸" ><!--/multimap A: -->
|
89
|
+
<!ENTITY nearhk "⤤" ><!--NE arrow-hooked -->
|
90
|
+
<!ENTITY nearr "↗" ><!--/nearrow A: NE pointing arrow -->
|
91
|
+
<!ENTITY neArr "⇗" ><!--NE pointing dbl arrow -->
|
92
|
+
<!ENTITY nesear "⤨" ><!--/toea A: NE & SE arrows -->
|
93
|
+
<!ENTITY nharr "↮" ><!--/nleftrightarrow A: not l&r arrow -->
|
94
|
+
<!ENTITY nhArr "⇎" ><!--/nLeftrightarrow A: not l&r dbl arr -->
|
95
|
+
<!ENTITY nlarr "↚" ><!--/nleftarrow A: not left arrow -->
|
96
|
+
<!ENTITY nlArr "⇍" ><!--/nLeftarrow A: not implied by -->
|
97
|
+
<!ENTITY nrarr "↛" ><!--/nrightarrow A: not right arrow -->
|
98
|
+
<!ENTITY nrArr "⇏" ><!--/nRightarrow A: not implies -->
|
99
|
+
<!ENTITY nrarrc "⤳̸" ><!--not right arrow-curved -->
|
100
|
+
<!ENTITY nrarrw "↝̸" ><!--not right arrow-wavy -->
|
101
|
+
<!ENTITY nvHarr "⇎" ><!--not, vert, left and right double arrow -->
|
102
|
+
<!ENTITY nvlArr "⇍" ><!--not, vert, left double arrow -->
|
103
|
+
<!ENTITY nvrArr "⇏" ><!--not, vert, right double arrow -->
|
104
|
+
<!ENTITY nwarhk "⤣" ><!--NW arrow-hooked -->
|
105
|
+
<!ENTITY nwarr "↖" ><!--/nwarrow A: NW pointing arrow -->
|
106
|
+
<!ENTITY nwArr "⇖" ><!--NW pointing dbl arrow -->
|
107
|
+
<!ENTITY nwnear "⤧" ><!--NW & NE arrows -->
|
108
|
+
<!ENTITY olarr "↺" ><!--/circlearrowleft A: l arr in circle -->
|
109
|
+
<!ENTITY orarr "↻" ><!--/circlearrowright A: r arr in circle -->
|
110
|
+
<!ENTITY origof "⊶" ><!--original of -->
|
111
|
+
<!ENTITY rAarr "⇛" ><!--/Rrightarrow A: right triple arrow -->
|
112
|
+
<!ENTITY Rarr "↠" ><!--/twoheadrightarrow A: -->
|
113
|
+
<!ENTITY rarrap "⥵" ><!--approximate, right arrow above -->
|
114
|
+
<!ENTITY rarrbfs "⤠" ><!--right arrow-bar, filled square -->
|
115
|
+
<!ENTITY rarrc "⤳" ><!--right arrow-curved -->
|
116
|
+
<!ENTITY rarrfs "⤞" ><!--right arrow, filled square -->
|
117
|
+
<!ENTITY rarrhk "↪" ><!--/hookrightarrow A: rt arrow-hooked -->
|
118
|
+
<!ENTITY rarrlp "↬" ><!--/looparrowright A: rt arrow-looped -->
|
119
|
+
<!ENTITY rarrpl "⥅" ><!--right arrow, plus -->
|
120
|
+
<!ENTITY rarrsim "⥴" ><!--right arrow, similar -->
|
121
|
+
<!ENTITY rarrtl "↣" ><!--/rightarrowtail A: rt arrow-tailed -->
|
122
|
+
<!ENTITY Rarrtl "⤖" ><!--right two-headed arrow with tail -->
|
123
|
+
<!ENTITY rarrw "↝" ><!--/rightsquigarrow A: rt arrow-wavy -->
|
124
|
+
<!ENTITY ratail "↣" ><!--right arrow-tail -->
|
125
|
+
<!ENTITY rAtail "⤜" ><!--right double arrow-tail -->
|
126
|
+
<!ENTITY rbarr "⤍" ><!--/bkarow A: right broken arrow -->
|
127
|
+
<!ENTITY rBarr "⤏" ><!--/dbkarow A: right doubly broken arrow -->
|
128
|
+
<!ENTITY RBarr "⤐" ><!--/drbkarow A: twoheaded right broken arrow -->
|
129
|
+
<!ENTITY rdca "⤷" ><!--right down curved arrow -->
|
130
|
+
<!ENTITY rdldhar "⥩" ><!--right harpoon-down over left harpoon-down -->
|
131
|
+
<!ENTITY rdsh "↳" ><!--right down angled arrow -->
|
132
|
+
<!ENTITY rfisht "⥽" ><!--right fish tail -->
|
133
|
+
<!ENTITY rHar "⥤" ><!--right harpoon-up over right harpoon-down -->
|
134
|
+
<!ENTITY rhard "⇁" ><!--/rightharpoondown A: rt harpoon-down -->
|
135
|
+
<!ENTITY rharu "⇀" ><!--/rightharpoonup A: rt harpoon-up -->
|
136
|
+
<!ENTITY rharul "⥬" ><!--right harpoon-up over long dash -->
|
137
|
+
<!ENTITY rlarr "⇄" ><!--/rightleftarrows A: r arr over l arr -->
|
138
|
+
<!ENTITY rlhar "⇌" ><!--/rightleftharpoons A: r harp over l -->
|
139
|
+
<!ENTITY roarr "⇾" ><!--right open arrow -->
|
140
|
+
<!ENTITY rrarr "⇉" ><!--/rightrightarrows A: two rt arrows -->
|
141
|
+
<!ENTITY rsh "↱" ><!--/Rsh A: -->
|
142
|
+
<!ENTITY ruluhar "⥨" ><!--right harpoon-up over left harpoon-up -->
|
143
|
+
<!ENTITY searhk "⤥" ><!--/hksearow A: SE arrow-hooken -->
|
144
|
+
<!ENTITY searr "↘" ><!--/searrow A: SE pointing arrow -->
|
145
|
+
<!ENTITY seArr "⇘" ><!--SE pointing dbl arrow -->
|
146
|
+
<!ENTITY seswar "⤩" ><!--/tosa A: SE & SW arrows -->
|
147
|
+
<!ENTITY simrarr "⥲" ><!--similar, right arrow below -->
|
148
|
+
<!ENTITY slarr "←︀" ><!--short left arrow -->
|
149
|
+
<!ENTITY srarr "→︀" ><!--short right arrow -->
|
150
|
+
<!ENTITY swarhk "⤦" ><!--/hkswarow A: SW arrow-hooked -->
|
151
|
+
<!ENTITY swarr "↙" ><!--/swarrow A: SW pointing arrow -->
|
152
|
+
<!ENTITY swArr "⇙" ><!--SW pointing dbl arrow -->
|
153
|
+
<!ENTITY swnwar "⤪" ><!--SW & NW arrows -->
|
154
|
+
<!ENTITY uArr "⇑" ><!--/Uparrow A: up dbl arrow -->
|
155
|
+
<!ENTITY Uarr "↟" ><!--up two-headed arrow -->
|
156
|
+
<!ENTITY Uarrocir "⥉" ><!--up two-headed arrow above circle -->
|
157
|
+
<!ENTITY udarr "⇅" ><!--up arrow, down arrow -->
|
158
|
+
<!ENTITY udhar "⥮" ><!--up harp, down harp -->
|
159
|
+
<!ENTITY ufisht "⥾" ><!--up fish tail -->
|
160
|
+
<!ENTITY uHar "⥣" ><!--up harpoon-left, up harpoon-right -->
|
161
|
+
<!ENTITY uharl "↿" ><!--/upharpoonleft A: up harpoon-left -->
|
162
|
+
<!ENTITY uharr "↾" ><!--/upharpoonright /restriction A: up harp-r -->
|
163
|
+
<!ENTITY uuarr "⇈" ><!--/upuparrows A: two up arrows -->
|
164
|
+
<!ENTITY varr "↕" ><!--/updownarrow A: up&down arrow -->
|
165
|
+
<!ENTITY vArr "⇕" ><!--/Updownarrow A: up&down dbl arrow -->
|
166
|
+
<!ENTITY xharr "" ><!--/longleftrightarrow A: long l&r arr -->
|
167
|
+
<!ENTITY xhArr "" ><!--/Longleftrightarrow A: long l&r dbl arr -->
|
168
|
+
<!ENTITY xlarr "" ><!--/longleftarrow A: long left arrow -->
|
169
|
+
<!ENTITY xlArr "" ><!--/Longleftarrow A: long l dbl arrow -->
|
170
|
+
<!ENTITY xmap "" ><!--/longmapsto A: -->
|
171
|
+
<!ENTITY xrarr "" ><!--/longrightarrow A: long right arrow -->
|
172
|
+
<!ENTITY xrArr "" ><!--/Longrightarrow A: long rt dbl arr -->
|
173
|
+
<!ENTITY zigrarr "⇝" ><!--right zig-zag arrow -->
|