ajnyga / tsvConverter

Excel to OJS3 XML conversion tool
GNU General Public License v3.0
17 stars 12 forks source link

What is this? #2

Closed josuevalrob closed 6 years ago

josuevalrob commented 6 years ago

Element '{http://pkp.sfu.ca}revision', attribute 'filesize': '' is not a valid value of the atomic type 'xs:int'.

This is where the problem is, the filesize tag is empty

<revision number="1" genre="Article Text" filename="2017-1-1-1.pdf" filesize="" filetype="" user_group_ref="Author" uploader="admin">
<name locale="en_US">2017-1-1-1.pdf</name>
<embed encoding="base64"></embed>
</revision>
ajnyga commented 6 years ago

some sort of libxml error, not sure. What is the value?

josuevalrob commented 6 years ago

Just give it a random value (don't have any pdf file, I'm testing) but I got an error: I give it filesize="25" but editing the xml file. Warnings encountered:

  1. Submission The provided filesize "25" and the actual filesize "" do not match

I think is because there is not any file... i will upload one

josuevalrob commented 6 years ago

I give it a file, with the size 1201 kb but it give me

1. Submission The provided filesize "1201" and the actual filesize "" do not match

The file is in the root, at the same level of convert.php and 2017.xml

this is the xml tag: `

2017-1-1-1.pdf

`

ajnyga commented 6 years ago

did you change the setting here when you created the xml file: https://github.com/ajnyga/tsvConverter/blob/master/convert.php#L27

josuevalrob commented 6 years ago

Now yes.

Warnings encountered:

  1. Submission

The provided filesize "1201" and the actual filesize "" do not match

ajnyga commented 6 years ago

Do you have content between<embed encoding="base64"> </embed>?

ajnyga commented 6 years ago

If you do not change the settings in the convert.php file, then you should create a subfolder called "files" and move the pdf-files there.

josuevalrob commented 6 years ago

File path: files/1.pdf Excel: file2 fileLabel2 fileGenre2 fileLocale2 1.pdf Data set 1 Data Set en convert.php

// Location of full text files
$filesFolder = dirname(__FILE__) . "/files/";

All this give me:

            <submission_file xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" stage="proof" id="1" xsi:schemaLocation="http://pkp.sfu.ca native.xsd">
                <revision number="1" genre="Article Text" filename="2017-1-1-1.pdf" filesize="1201" filetype="" user_group_ref="Author" uploader="admin">
                <name locale="en_US">2017-1-1-1.pdf</name>
                <embed encoding="base64">               </embed>
                </revision>
            </submission_file>

I change it to::

            <submission_file xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" stage="proof" id="3" xsi:schemaLocation="http://pkp.sfu.ca native.xsd">
                <revision number="1" genre="Article Text" filename="3.pdf" filesize="603" filetype="" user_group_ref="Author" uploader="admin">
                <name locale="en_US">3.pdf</name>
                <embed encoding="base64">               </embed>
                </revision>
            </submission_file>

But the result still:

  1. Submission

The provided filesize "1201" and the actual filesize "" do not match

Thanks for your time!

ajnyga commented 6 years ago

If you are adding more than one file per article, then did you change the setting here: https://github.com/ajnyga/tsvConverter/blob/master/convert.php#L21

Also, do you actually have an 2017-1-1-1.pdf file?

And thirdly, do you have actual content between <embed encoding="base64"> </embed> in the xml file?

josuevalrob commented 6 years ago

Sorry, i was working in the cell of pdf 2.

Now i have change to this:

file1 file Label1 fileGenre1 fileLocale1 file2 fileLabel2 fileGenre2 fileLocale2 1 PDF Article Text en 2 Data set 1 Data Set en

And the doc path is: files/1.pdf and files/2.pdf

This is the outpu:

<submission_file xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" stage="proof" id="1" xsi:schemaLocation="http://pkp.sfu.ca native.xsd">
                <revision number="1" genre="Article Text" filename="1" filesize="" filetype="" user_group_ref="Author" uploader="admin">
                <name locale="en_US">1</name>
                <embed encoding="base64">               </embed>
                </revision>
            </submission_file>

And this is the error: Element '{http://pkp.sfu.ca}revision', attribute 'filesize': '' is not a valid value of the atomic type 'xs:int'.

After that i go and change the file size to 1201:

filesize="1202" and this is the error: Submission The provided filesize "1201" and the actual filesize "" do not match

ajnyga commented 6 years ago

The filename is not 1 => should be 1.pdf?

josuevalrob commented 6 years ago

Ok! it work!! now i have an other issue:

Errors occured:

  1. Submission

Unknown uploader admin

ajnyga commented 6 years ago

see again the settings in the beginning of the convert.php file. You can define a username there. If you do not have an useraccount named "admin" then you can use any account name you happen to have. Of course using and admistrator account is a good idea.

josuevalrob commented 6 years ago

Okey its working now! thanks you very much!!

ajnyga commented 6 years ago

You are welcome. Check the new release I did just 10 minutes ago. Details about the changes are in the readme file.