SWORD API error

23 views
Skip to first unread message

Agus Sudiarto

unread,
Sep 21, 2017, 12:35:08 AM9/21/17
to Dataverse Users Community
Dear All Masters...,

i have some problem while use method via SWORD API for entry a new dataset 
here is my xml 

<?xml version='1.0'?>
       xmlns:dcterms='http://purl.org/dc/terms/'>
   <dcterm:title>asasd</dcterm:title>
   <dcterm:creator>asdasd</dcterm:creator>
   <dcterm:creator affiliation=dasas>dasas</dcterm:creator>
   <dcterm:subject>asdas</dcterm:subject>
   <dcterm:description>asdasda</dcterm:description>
   <dcterm:publisher>asda</dcterm:publisher>
   <dcterm:contributor type='Funder'>asdasd</dcterm:contributor>
   <dcterm:date>2017-08-30</dcterm:date>
   <dcterm:type>sdas</dcterm:type>
   <dcterm:source>asda</dcterm:source>
   <dcterm:relation>asda</dcterm:relation>
   <dcterm:coverage>India</dcterm:coverage>
   <dcterm:license>asdasd</dcterm:license>
   <dcterm:rights>Righ</dcterm:rights>
   <dcterm:isReferencedBy holdingsURI='http://dx.doi.org/10.1038/dvn333' agency='DOI' IDNo='10.1038/dvn333'>asdasdas</dcterm:isReferencedBy>
</entry>

and after i execute the command "curl -u nnnnnf-a0bf-4407-88ec-244d42a4d5c6: --data-binary "/var/www/html/swordapi/xml/sosial-manusia_1505967208.xml" -H "Content-Type: application/atom+xml" http://xxx.xxx.16.194:8080/dvn/api/data-deposit/v1.1/swordv2/collection/dataverse/sosial-manusia
"
Error message is :
<sword:error href="Unable to parse SWORD entry: org.apache.abdera.parser.ParseException: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '/' (code 47) in prolog; expected '&lt;'&#x0A; at [row,col {unknown-source}]: [1,1]" xmlns:sword="http://purl.org/net/sword/terms/"><atom:title xmlns:atom="http://www.w3.org/2005/Atom">ERROR</atom:title><atom:updated xmlns:atom="http://www.w3.org/2005/Atom">2017-09-21T11:25:34Z</atom:updated><atom:generator uri="http://www.swordapp.org/" version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"/><sword:treatment>Processing failed</sword:treatment><atom:summary xmlns:atom="http://www.w3.org/2005/Atom">Unable to parse SWORD entry: org.apache.abdera.parser.ParseException: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '/' (code 47) in prolog; expected '&lt;'
 at [row,col {unknown-source}]: [1,1]</atom:summary></sword:error>

how it can be fix ...?
thanks in advance...

Philip Durbin

unread,
Sep 21, 2017, 7:59:27 AM9/21/17
to dataverse...@googlegroups.com
Hi Agus,

A couple things.

1. You need to put the "affiliation" value in quotes. Instead of affiliation=dasas you need affiliation="dasas".

2. It should be "dcterms" rather than "dcterm".

There's an example XML here:

I hope this helps!

Phil

p.s. I found these problems by running your XML file through `xmllint` like this:

cat sosial-manusia_1505967208.xml | xmllint -format -


--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse-community@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-community/147c65c0-a336-46e7-934c-08ceee287d28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages