<< | Index | >>
Broken Zip file response in Mechanize.
$ bin/oddb2xml
/path/to/gems/ruby/1.9.1/gems/mechanize-2.5.1/lib/mechanize/http/agent.rb:899:in `rescue in response_read': end of file reached (Mechanize::ChunkedTerminationError) (Mechanize::ChunkedTerminationError)
from /path/to/gems/ruby/1.9.1/gems/mechanize-2.5.1/lib/mechanize/http/agent.rb:878:in `response_read'
from /path/to/gems/ruby/1.9.1/gems/mechanize-2.5.1/lib/mechanize/http/agent.rb:261:in `block in fetch'
from /path/to/ruby/1.9.1/net/http.rb:1322:in `block (2 levels) in transport_request'
from /path/to/ruby/1.9.1/net/http.rb:2671:in `reading_body'
...
use Agent#ingnore_bad_chunking for swissmedicinfo response.
AipsDownload_2012xxxx.xml structure.
<medicalInformation type='fi'>
<title></title>
<authHolder></authHolder>
<atcCode></atcCode>
<substances><substances>
<style></style>
<content>
<![CDATA[
HTML
]]>
</content>
<sections></sections>
</medicalInformation>
<?xml version="1.0" encoding="utf-8"?>
<KOMPENDIUM xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://wiki.oddb.org/wiki.php?pagename=Swissmedic.Datendeklaration" CREATION_DATETIME="2013-01-07T16:27:36.1414021+0900" PROD_DATE="2013-01-07T16:27:36.1414021+0900" VALID_DATE="2013-01-07T16:27:36.1414021+0900">
<ART MONTYPE="fi" LANG="DE" DT="">
<name>
<p>3TC®</p>
</name>
<owner>
<p>ViiV Healthcare GmbH</p>
</owner>
<monid>53663</monid>
<paragraph><![CDATA[
<title><p>3TC®</p></title><div class="paragraph" id="Section7000">
...raw HTML...
]]>
</paragraph>
</ART>
</KOMPENDIUM>
Created -o fi option for :oddb_fi.xml: and :oddb_pi_product.xml:.
bin/oddb2xml ver.1.1.0
Usage:
oddb2xml [option]
-c F, --compress=F Compress format F. {tar.gz|zip}
-a T, --append=T Additional target. T, only 'nonpharma' is available.
-o O, --optional=O Optional output. O, only 'fi' is available. # <= fi option
-t S, --tag-suffix=S XML tag suffix S. Default is none. [A-z0-9_]
If S is given, it is also used as prefix of filename.
-h, --help Show this help message.
oddb_fi_product.xml output.