onix2 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (240) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG +209 -0
  3. data/README.markdown +69 -0
  4. data/TODO +14 -0
  5. data/dtd/2.1r3/iso-amsa.ent +173 -0
  6. data/dtd/2.1r3/iso-amsb.ent +146 -0
  7. data/dtd/2.1r3/iso-amsc.ent +49 -0
  8. data/dtd/2.1r3/iso-amsn.ent +117 -0
  9. data/dtd/2.1r3/iso-amso.ent +77 -0
  10. data/dtd/2.1r3/iso-amsr.ent +205 -0
  11. data/dtd/2.1r3/iso-box.ent +67 -0
  12. data/dtd/2.1r3/iso-cyr1.ent +94 -0
  13. data/dtd/2.1r3/iso-cyr2.ent +53 -0
  14. data/dtd/2.1r3/iso-dia.ent +41 -0
  15. data/dtd/2.1r3/iso-grk3.ent +70 -0
  16. data/dtd/2.1r3/iso-lat1.ent +89 -0
  17. data/dtd/2.1r3/iso-lat2.ent +148 -0
  18. data/dtd/2.1r3/iso-mfrk.ent +79 -0
  19. data/dtd/2.1r3/iso-mopf.ent +53 -0
  20. data/dtd/2.1r3/iso-mscr.ent +79 -0
  21. data/dtd/2.1r3/iso-num.ent +103 -0
  22. data/dtd/2.1r3/iso-num.old.ent +103 -0
  23. data/dtd/2.1r3/iso-pub.ent +110 -0
  24. data/dtd/2.1r3/iso-tech.ent +183 -0
  25. data/dtd/2.1r3/onix-international.dtd +1012 -0
  26. data/dtd/2.1r3/onix-xhtml.elt +672 -0
  27. data/dtd/2.1r3/reference.elt +4758 -0
  28. data/dtd/2.1r3/xhtml-special.ent +79 -0
  29. data/dtd/2.1r3/xhtml-symbol.ent +242 -0
  30. data/lib/onix2.rb +85 -0
  31. data/lib/onix2/addressee_identifier.rb +29 -0
  32. data/lib/onix2/apa_product.rb +785 -0
  33. data/lib/onix2/audience_range.rb +37 -0
  34. data/lib/onix2/code_list_extractor.rb +69 -0
  35. data/lib/onix2/contributor.rb +55 -0
  36. data/lib/onix2/discount_coded.rb +29 -0
  37. data/lib/onix2/header.rb +68 -0
  38. data/lib/onix2/imprint.rb +31 -0
  39. data/lib/onix2/language.rb +29 -0
  40. data/lib/onix2/lists.rb +134 -0
  41. data/lib/onix2/market_representation.rb +38 -0
  42. data/lib/onix2/measure.rb +29 -0
  43. data/lib/onix2/media_file.rb +33 -0
  44. data/lib/onix2/other_text.rb +35 -0
  45. data/lib/onix2/price.rb +47 -0
  46. data/lib/onix2/product.rb +97 -0
  47. data/lib/onix2/product_identifier.rb +27 -0
  48. data/lib/onix2/publisher.rb +33 -0
  49. data/lib/onix2/reader.rb +157 -0
  50. data/lib/onix2/sales_restriction.rb +25 -0
  51. data/lib/onix2/sales_rights.rb +28 -0
  52. data/lib/onix2/sender_identifier.rb +29 -0
  53. data/lib/onix2/series.rb +28 -0
  54. data/lib/onix2/series_identifier.rb +27 -0
  55. data/lib/onix2/simple_product.rb +47 -0
  56. data/lib/onix2/stock.rb +29 -0
  57. data/lib/onix2/subject.rb +33 -0
  58. data/lib/onix2/supply_detail.rb +53 -0
  59. data/lib/onix2/title.rb +33 -0
  60. data/lib/onix2/version.rb +3 -0
  61. data/lib/onix2/website.rb +29 -0
  62. data/lib/onix2/writer.rb +86 -0
  63. data/spec/addressee_identifier_spec.rb +33 -0
  64. data/spec/apa_product_spec.rb +116 -0
  65. data/spec/audience_range_spec.rb +44 -0
  66. data/spec/contributor_spec.rb +38 -0
  67. data/spec/discount_coded_spec.rb +34 -0
  68. data/spec/header_spec.rb +153 -0
  69. data/spec/imprint_spec.rb +31 -0
  70. data/spec/language_spec.rb +38 -0
  71. data/spec/lists_spec.rb +33 -0
  72. data/spec/market_representation_spec.rb +33 -0
  73. data/spec/measure_spec.rb +38 -0
  74. data/spec/media_file_spec.rb +38 -0
  75. data/spec/other_text_spec.rb +33 -0
  76. data/spec/price_spec.rb +52 -0
  77. data/spec/product_identifier_spec.rb +34 -0
  78. data/spec/product_spec.rb +102 -0
  79. data/spec/publisher_spec.rb +33 -0
  80. data/spec/reader_spec.rb +155 -0
  81. data/spec/sales_restriction_spec.rb +27 -0
  82. data/spec/sender_identifier.rb +33 -0
  83. data/spec/series_identifier_spec.rb +33 -0
  84. data/spec/series_spec.rb +47 -0
  85. data/spec/spec_helper.rb +15 -0
  86. data/spec/stock_spec.rb +39 -0
  87. data/spec/subject_spec.rb +34 -0
  88. data/spec/supply_detail_spec.rb +97 -0
  89. data/spec/title_spec.rb +38 -0
  90. data/spec/website_spec.rb +33 -0
  91. data/spec/writer_spec.rb +78 -0
  92. data/support/codes/001.tsv +10 -0
  93. data/support/codes/002.tsv +5 -0
  94. data/support/codes/003.tsv +7 -0
  95. data/support/codes/005.tsv +13 -0
  96. data/support/codes/006.tsv +76 -0
  97. data/support/codes/007.tsv +123 -0
  98. data/support/codes/008.tsv +7 -0
  99. data/support/codes/009.tsv +7 -0
  100. data/support/codes/010.tsv +34 -0
  101. data/support/codes/011.tsv +11 -0
  102. data/support/codes/012.tsv +11 -0
  103. data/support/codes/013.tsv +7 -0
  104. data/support/codes/014.tsv +4 -0
  105. data/support/codes/015.tsv +13 -0
  106. data/support/codes/016.tsv +6 -0
  107. data/support/codes/017.tsv +90 -0
  108. data/support/codes/018.tsv +3 -0
  109. data/support/codes/019.tsv +7 -0
  110. data/support/codes/020.tsv +0 -0
  111. data/support/codes/021.tsv +31 -0
  112. data/support/codes/022.tsv +9 -0
  113. data/support/codes/023.tsv +9 -0
  114. data/support/codes/024.tsv +11 -0
  115. data/support/codes/025.tsv +29 -0
  116. data/support/codes/026.tsv +75 -0
  117. data/support/codes/027.tsv +75 -0
  118. data/support/codes/028.tsv +8 -0
  119. data/support/codes/029.tsv +16 -0
  120. data/support/codes/030.tsv +15 -0
  121. data/support/codes/031.tsv +3 -0
  122. data/support/codes/032.tsv +2 -0
  123. data/support/codes/033.tsv +36 -0
  124. data/support/codes/034.tsv +14 -0
  125. data/support/codes/035.tsv +6 -0
  126. data/support/codes/036.tsv +3 -0
  127. data/support/codes/037.tsv +6 -0
  128. data/support/codes/038.tsv +36 -0
  129. data/support/codes/039.tsv +8 -0
  130. data/support/codes/040.tsv +6 -0
  131. data/support/codes/041.tsv +6 -0
  132. data/support/codes/042.tsv +16 -0
  133. data/support/codes/043.tsv +4 -0
  134. data/support/codes/044.tsv +13 -0
  135. data/support/codes/045.tsv +12 -0
  136. data/support/codes/046.tsv +3 -0
  137. data/support/codes/047.tsv +4 -0
  138. data/support/codes/048.tsv +11 -0
  139. data/support/codes/049.tsv +84 -0
  140. data/support/codes/050.tsv +8 -0
  141. data/support/codes/051.tsv +27 -0
  142. data/support/codes/052.tsv +1 -0
  143. data/support/codes/053.tsv +3 -0
  144. data/support/codes/054.tsv +23 -0
  145. data/support/codes/055.tsv +13 -0
  146. data/support/codes/056.tsv +2 -0
  147. data/support/codes/057.tsv +5 -0
  148. data/support/codes/058.tsv +21 -0
  149. data/support/codes/059.tsv +4 -0
  150. data/support/codes/060.tsv +2 -0
  151. data/support/codes/061.tsv +3 -0
  152. data/support/codes/062.tsv +5 -0
  153. data/support/codes/063.tsv +0 -0
  154. data/support/codes/064.tsv +13 -0
  155. data/support/codes/065.tsv +25 -0
  156. data/support/codes/066.tsv +4 -0
  157. data/support/codes/067.tsv +2 -0
  158. data/support/codes/068.tsv +15 -0
  159. data/support/codes/069.tsv +4 -0
  160. data/support/codes/070.tsv +2 -0
  161. data/support/codes/071.tsv +9 -0
  162. data/support/codes/072.tsv +7 -0
  163. data/support/codes/073.tsv +36 -0
  164. data/support/codes/074.tsv +489 -0
  165. data/support/codes/075.tsv +2 -0
  166. data/support/codes/076.tsv +12 -0
  167. data/support/codes/077.tsv +19 -0
  168. data/support/codes/078.tsv +148 -0
  169. data/support/codes/079.tsv +17 -0
  170. data/support/codes/080.tsv +19 -0
  171. data/support/codes/081.tsv +11 -0
  172. data/support/codes/082.tsv +17 -0
  173. data/support/codes/083.tsv +68 -0
  174. data/support/codes/084.tsv +10 -0
  175. data/support/codes/085.tsv +23 -0
  176. data/support/codes/086.tsv +5 -0
  177. data/support/codes/087.tsv +6 -0
  178. data/support/codes/088.tsv +0 -0
  179. data/support/codes/089.tsv +1 -0
  180. data/support/codes/090.tsv +11 -0
  181. data/support/codes/091.tsv +248 -0
  182. data/support/codes/092.tsv +7 -0
  183. data/support/codes/093.tsv +13 -0
  184. data/support/codes/094.tsv +3 -0
  185. data/support/codes/095.tsv +3 -0
  186. data/support/codes/096.tsv +185 -0
  187. data/support/codes/097.tsv +1 -0
  188. data/support/codes/098.tsv +21 -0
  189. data/support/codes/099.tsv +24 -0
  190. data/support/codes/100.tsv +4 -0
  191. data/support/codes/101.tsv +2 -0
  192. data/support/codes/102.tsv +3 -0
  193. data/support/codes/121.tsv +127 -0
  194. data/support/codes/138.tsv +6 -0
  195. data/support/codes/139.tsv +70 -0
  196. data/support/codes/140.tsv +7 -0
  197. data/support/codes/141.tsv +10 -0
  198. data/support/codes/142.tsv +12 -0
  199. data/support/codes/143.tsv +7 -0
  200. data/support/codes/144.tsv +4 -0
  201. data/support/codes/145.tsv +5 -0
  202. data/support/codes/146.tsv +3 -0
  203. data/support/codes/147.tsv +7 -0
  204. data/support/codes/148.tsv +3 -0
  205. data/support/codes/149.tsv +4 -0
  206. data/support/codes/150.tsv +124 -0
  207. data/support/codes/151.tsv +7 -0
  208. data/support/codes/152.tsv +2 -0
  209. data/support/codes/153.tsv +14 -0
  210. data/support/codes/154.tsv +9 -0
  211. data/support/codes/155.tsv +5 -0
  212. data/support/codes/156.tsv +4 -0
  213. data/support/codes/157.tsv +4 -0
  214. data/support/codes/158.tsv +24 -0
  215. data/support/codes/159.tsv +6 -0
  216. data/support/codes/160.tsv +0 -0
  217. data/support/codes/161.tsv +3 -0
  218. data/support/codes/162.tsv +3 -0
  219. data/support/codes/163.tsv +7 -0
  220. data/support/codes/164.tsv +2 -0
  221. data/support/codes/165.tsv +2 -0
  222. data/support/codes/166.tsv +2 -0
  223. data/support/codes/167.tsv +3 -0
  224. data/support/codes/168.tsv +2 -0
  225. data/support/codes/169.tsv +3 -0
  226. data/support/codes/170.tsv +0 -0
  227. data/support/codes/171.tsv +2 -0
  228. data/support/codes/172.tsv +1 -0
  229. data/support/codes/173.tsv +2 -0
  230. data/support/codes/174.tsv +2 -0
  231. data/support/codes/175.tsv +175 -0
  232. data/support/codes/176.tsv +12 -0
  233. data/support/codes/177.tsv +2 -0
  234. data/support/codes/178.tsv +17 -0
  235. data/support/entities.txt +1499 -0
  236. data/support/extract.rb +25 -0
  237. data/support/switch-onix-2.1-short-to-reference.xsl +24 -0
  238. data/support/switch-onix-tagnames-1.1.xsl +25 -0
  239. data/support/switch-onix-tagnames-2.0.xsl +37 -0
  240. metadata +440 -0
@@ -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
@@ -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
@@ -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 "&#x0237C;" ><!--angle with down zig-zag arrow -->
29
+ <!ENTITY cirmid "&#x02AEF;" ><!--circle, mid below -->
30
+ <!ENTITY cudarrl "&#x02938;" ><!--left, curved, down arrow -->
31
+ <!ENTITY cudarrr "&#x02935;" ><!--right, curved, down arrow -->
32
+ <!ENTITY cularr "&#x021B6;" ><!--/curvearrowleft A: left curved arrow -->
33
+ <!ENTITY cularrp "&#x0293D;" ><!--curved left arrow with plus -->
34
+ <!ENTITY curarr "&#x021B7;" ><!--/curvearrowright A: rt curved arrow -->
35
+ <!ENTITY curarrm "&#x0293C;" ><!--curved right arrow with minus -->
36
+ <!ENTITY dArr "&#x021D3;" ><!--/Downarrow A: down dbl arrow -->
37
+ <!ENTITY Darr "&#x021A1;" ><!--down two-headed arrow -->
38
+ <!ENTITY ddarr "&#x021CA;" ><!--/downdownarrows A: two down arrows -->
39
+ <!ENTITY DDotrahd "&#x02911;" ><!--right arrow with dotted stem -->
40
+ <!ENTITY dfisht "&#x0297F;" ><!--down fish tail -->
41
+ <!ENTITY dHar "&#x02965;" ><!--down harpoon-left, down harpoon-right -->
42
+ <!ENTITY dharl "&#x021C3;" ><!--/downharpoonleft A: dn harpoon-left -->
43
+ <!ENTITY dharr "&#x021C2;" ><!--/downharpoonright A: down harpoon-rt -->
44
+ <!ENTITY duarr "&#x021F5;" ><!--down arrow, up arrow -->
45
+ <!ENTITY duhar "&#x0296F;" ><!--down harp, up harp -->
46
+ <!ENTITY dzigrarr "&#x0F5A2;" ><!--right long zig-zag arrow -->
47
+ <!ENTITY erarr "&#x02971;" ><!--equal, right arrow below -->
48
+ <!ENTITY harr "&#x02194;" ><!--/leftrightarrow A: l&r arrow -->
49
+ <!ENTITY hArr "&#x021D4;" ><!--/Leftrightarrow A: l&r dbl arrow -->
50
+ <!ENTITY harrcir "&#x02948;" ><!--left and right arrow with a circle -->
51
+ <!ENTITY harrw "&#x021AD;" ><!--/leftrightsquigarrow A: l&r arr-wavy -->
52
+ <!ENTITY hoarr "&#x021FF;" ><!--horizontal open arrow -->
53
+ <!ENTITY imof "&#x022B7;" ><!--image of -->
54
+ <!ENTITY lAarr "&#x021DA;" ><!--/Lleftarrow A: left triple arrow -->
55
+ <!ENTITY Larr "&#x0219E;" ><!--/twoheadleftarrow A: -->
56
+ <!ENTITY larrbfs "&#x0291F;" ><!--left arrow-bar, filled square -->
57
+ <!ENTITY larrfs "&#x0291D;" ><!--left arrow, filled square -->
58
+ <!ENTITY larrhk "&#x021A9;" ><!--/hookleftarrow A: left arrow-hooked -->
59
+ <!ENTITY larrlp "&#x021AB;" ><!--/looparrowleft A: left arrow-looped -->
60
+ <!ENTITY larrpl "&#x02939;" ><!--left arrow, plus -->
61
+ <!ENTITY larrsim "&#x02973;" ><!--left arrow, similar -->
62
+ <!ENTITY larrtl "&#x021A2;" ><!--/leftarrowtail A: left arrow-tailed -->
63
+ <!ENTITY latail "&#x02919;" ><!--left arrow-tail -->
64
+ <!ENTITY lAtail "&#x0291B;" ><!--left double arrow-tail -->
65
+ <!ENTITY lbarr "&#x0290C;" ><!--left broken arrow -->
66
+ <!ENTITY lBarr "&#x0290E;" ><!--left doubly broken arrow -->
67
+ <!ENTITY ldca "&#x02936;" ><!--left down curved arrow -->
68
+ <!ENTITY ldrdhar "&#x02967;" ><!--left harpoon-down over right harpoon-down -->
69
+ <!ENTITY ldrushar "&#x0294B;" ><!--left-down-right-up harpoon -->
70
+ <!ENTITY ldsh "&#x021B2;" ><!--left down angled arrow -->
71
+ <!ENTITY lfisht "&#x0297C;" ><!--left fish tail -->
72
+ <!ENTITY lHar "&#x02962;" ><!--left harpoon-up over left harpoon-down -->
73
+ <!ENTITY lhard "&#x021BD;" ><!--/leftharpoondown A: l harpoon-down -->
74
+ <!ENTITY lharu "&#x021BC;" ><!--/leftharpoonup A: left harpoon-up -->
75
+ <!ENTITY lharul "&#x0296A;" ><!--left harpoon-up over long dash -->
76
+ <!ENTITY llarr "&#x021C7;" ><!--/leftleftarrows A: two left arrows -->
77
+ <!ENTITY llhard "&#x0296B;" ><!--left harpoon-down below long dash -->
78
+ <!ENTITY loarr "&#x021FD;" ><!--left open arrow -->
79
+ <!ENTITY lrarr "&#x021C6;" ><!--/leftrightarrows A: l arr over r arr -->
80
+ <!ENTITY lrhar "&#x021CB;" ><!--/leftrightharpoons A: l harp over r -->
81
+ <!ENTITY lrhard "&#x0296D;" ><!--right harpoon-down below long dash -->
82
+ <!ENTITY lsh "&#x021B0;" ><!--/Lsh A: -->
83
+ <!ENTITY lurdshar "&#x0294A;" ><!--left-up-right-down harpoon -->
84
+ <!ENTITY luruhar "&#x02966;" ><!--left harpoon-up over right harpoon-up -->
85
+ <!ENTITY map "&#x021A6;" ><!--/mapsto A: -->
86
+ <!ENTITY Map "&#x02905;" ><!--twoheaded mapsto -->
87
+ <!ENTITY midcir "&#x02AF0;" ><!--mid, circle below -->
88
+ <!ENTITY mumap "&#x022B8;" ><!--/multimap A: -->
89
+ <!ENTITY nearhk "&#x02924;" ><!--NE arrow-hooked -->
90
+ <!ENTITY nearr "&#x02197;" ><!--/nearrow A: NE pointing arrow -->
91
+ <!ENTITY neArr "&#x021D7;" ><!--NE pointing dbl arrow -->
92
+ <!ENTITY nesear "&#x02928;" ><!--/toea A: NE & SE arrows -->
93
+ <!ENTITY nharr "&#x021AE;" ><!--/nleftrightarrow A: not l&r arrow -->
94
+ <!ENTITY nhArr "&#x021CE;" ><!--/nLeftrightarrow A: not l&r dbl arr -->
95
+ <!ENTITY nlarr "&#x0219A;" ><!--/nleftarrow A: not left arrow -->
96
+ <!ENTITY nlArr "&#x021CD;" ><!--/nLeftarrow A: not implied by -->
97
+ <!ENTITY nrarr "&#x0219B;" ><!--/nrightarrow A: not right arrow -->
98
+ <!ENTITY nrArr "&#x021CF;" ><!--/nRightarrow A: not implies -->
99
+ <!ENTITY nrarrc "&#x02933;&#x00338;" ><!--not right arrow-curved -->
100
+ <!ENTITY nrarrw "&#x0219D;&#x00338;" ><!--not right arrow-wavy -->
101
+ <!ENTITY nvHarr "&#x021CE;" ><!--not, vert, left and right double arrow -->
102
+ <!ENTITY nvlArr "&#x021CD;" ><!--not, vert, left double arrow -->
103
+ <!ENTITY nvrArr "&#x021CF;" ><!--not, vert, right double arrow -->
104
+ <!ENTITY nwarhk "&#x02923;" ><!--NW arrow-hooked -->
105
+ <!ENTITY nwarr "&#x02196;" ><!--/nwarrow A: NW pointing arrow -->
106
+ <!ENTITY nwArr "&#x021D6;" ><!--NW pointing dbl arrow -->
107
+ <!ENTITY nwnear "&#x02927;" ><!--NW & NE arrows -->
108
+ <!ENTITY olarr "&#x021BA;" ><!--/circlearrowleft A: l arr in circle -->
109
+ <!ENTITY orarr "&#x021BB;" ><!--/circlearrowright A: r arr in circle -->
110
+ <!ENTITY origof "&#x022B6;" ><!--original of -->
111
+ <!ENTITY rAarr "&#x021DB;" ><!--/Rrightarrow A: right triple arrow -->
112
+ <!ENTITY Rarr "&#x021A0;" ><!--/twoheadrightarrow A: -->
113
+ <!ENTITY rarrap "&#x02975;" ><!--approximate, right arrow above -->
114
+ <!ENTITY rarrbfs "&#x02920;" ><!--right arrow-bar, filled square -->
115
+ <!ENTITY rarrc "&#x02933;" ><!--right arrow-curved -->
116
+ <!ENTITY rarrfs "&#x0291E;" ><!--right arrow, filled square -->
117
+ <!ENTITY rarrhk "&#x021AA;" ><!--/hookrightarrow A: rt arrow-hooked -->
118
+ <!ENTITY rarrlp "&#x021AC;" ><!--/looparrowright A: rt arrow-looped -->
119
+ <!ENTITY rarrpl "&#x02945;" ><!--right arrow, plus -->
120
+ <!ENTITY rarrsim "&#x02974;" ><!--right arrow, similar -->
121
+ <!ENTITY rarrtl "&#x021A3;" ><!--/rightarrowtail A: rt arrow-tailed -->
122
+ <!ENTITY Rarrtl "&#x02916;" ><!--right two-headed arrow with tail -->
123
+ <!ENTITY rarrw "&#x0219D;" ><!--/rightsquigarrow A: rt arrow-wavy -->
124
+ <!ENTITY ratail "&#x021A3;" ><!--right arrow-tail -->
125
+ <!ENTITY rAtail "&#x0291C;" ><!--right double arrow-tail -->
126
+ <!ENTITY rbarr "&#x0290D;" ><!--/bkarow A: right broken arrow -->
127
+ <!ENTITY rBarr "&#x0290F;" ><!--/dbkarow A: right doubly broken arrow -->
128
+ <!ENTITY RBarr "&#x02910;" ><!--/drbkarow A: twoheaded right broken arrow -->
129
+ <!ENTITY rdca "&#x02937;" ><!--right down curved arrow -->
130
+ <!ENTITY rdldhar "&#x02969;" ><!--right harpoon-down over left harpoon-down -->
131
+ <!ENTITY rdsh "&#x021B3;" ><!--right down angled arrow -->
132
+ <!ENTITY rfisht "&#x0297D;" ><!--right fish tail -->
133
+ <!ENTITY rHar "&#x02964;" ><!--right harpoon-up over right harpoon-down -->
134
+ <!ENTITY rhard "&#x021C1;" ><!--/rightharpoondown A: rt harpoon-down -->
135
+ <!ENTITY rharu "&#x021C0;" ><!--/rightharpoonup A: rt harpoon-up -->
136
+ <!ENTITY rharul "&#x0296C;" ><!--right harpoon-up over long dash -->
137
+ <!ENTITY rlarr "&#x021C4;" ><!--/rightleftarrows A: r arr over l arr -->
138
+ <!ENTITY rlhar "&#x021CC;" ><!--/rightleftharpoons A: r harp over l -->
139
+ <!ENTITY roarr "&#x021FE;" ><!--right open arrow -->
140
+ <!ENTITY rrarr "&#x021C9;" ><!--/rightrightarrows A: two rt arrows -->
141
+ <!ENTITY rsh "&#x021B1;" ><!--/Rsh A: -->
142
+ <!ENTITY ruluhar "&#x02968;" ><!--right harpoon-up over left harpoon-up -->
143
+ <!ENTITY searhk "&#x02925;" ><!--/hksearow A: SE arrow-hooken -->
144
+ <!ENTITY searr "&#x02198;" ><!--/searrow A: SE pointing arrow -->
145
+ <!ENTITY seArr "&#x021D8;" ><!--SE pointing dbl arrow -->
146
+ <!ENTITY seswar "&#x02929;" ><!--/tosa A: SE & SW arrows -->
147
+ <!ENTITY simrarr "&#x02972;" ><!--similar, right arrow below -->
148
+ <!ENTITY slarr "&#x02190;&#x0FE00;" ><!--short left arrow -->
149
+ <!ENTITY srarr "&#x02192;&#x0FE00;" ><!--short right arrow -->
150
+ <!ENTITY swarhk "&#x02926;" ><!--/hkswarow A: SW arrow-hooked -->
151
+ <!ENTITY swarr "&#x02199;" ><!--/swarrow A: SW pointing arrow -->
152
+ <!ENTITY swArr "&#x021D9;" ><!--SW pointing dbl arrow -->
153
+ <!ENTITY swnwar "&#x0292A;" ><!--SW & NW arrows -->
154
+ <!ENTITY uArr "&#x021D1;" ><!--/Uparrow A: up dbl arrow -->
155
+ <!ENTITY Uarr "&#x0219F;" ><!--up two-headed arrow -->
156
+ <!ENTITY Uarrocir "&#x02949;" ><!--up two-headed arrow above circle -->
157
+ <!ENTITY udarr "&#x021C5;" ><!--up arrow, down arrow -->
158
+ <!ENTITY udhar "&#x0296E;" ><!--up harp, down harp -->
159
+ <!ENTITY ufisht "&#x0297E;" ><!--up fish tail -->
160
+ <!ENTITY uHar "&#x02963;" ><!--up harpoon-left, up harpoon-right -->
161
+ <!ENTITY uharl "&#x021BF;" ><!--/upharpoonleft A: up harpoon-left -->
162
+ <!ENTITY uharr "&#x021BE;" ><!--/upharpoonright /restriction A: up harp-r -->
163
+ <!ENTITY uuarr "&#x021C8;" ><!--/upuparrows A: two up arrows -->
164
+ <!ENTITY varr "&#x02195;" ><!--/updownarrow A: up&down arrow -->
165
+ <!ENTITY vArr "&#x021D5;" ><!--/Updownarrow A: up&down dbl arrow -->
166
+ <!ENTITY xharr "&#x0F578;" ><!--/longleftrightarrow A: long l&r arr -->
167
+ <!ENTITY xhArr "&#x0F57B;" ><!--/Longleftrightarrow A: long l&r dbl arr -->
168
+ <!ENTITY xlarr "&#x0F576;" ><!--/longleftarrow A: long left arrow -->
169
+ <!ENTITY xlArr "&#x0F579;" ><!--/Longleftarrow A: long l dbl arrow -->
170
+ <!ENTITY xmap "&#x0F57D;" ><!--/longmapsto A: -->
171
+ <!ENTITY xrarr "&#x0F577;" ><!--/longrightarrow A: long right arrow -->
172
+ <!ENTITY xrArr "&#x0F57A;" ><!--/Longrightarrow A: long rt dbl arr -->
173
+ <!ENTITY zigrarr "&#x021DD;" ><!--right zig-zag arrow -->