Error while importing XML user file

omp
import

#1

Hi everyone,

when I try to import an xml file through the import plugin I get this error message

  • Element ‘{http://pkp.sfu.ca}role_id’: ‘\n16’ is not a valid value of the atomic type ‘xs:int’.\n
    \n\t\t\t\t\t* Element ‘{http://pkp.sfu.ca}context_id’: ‘\n1’ is not a valid value of the atomic type ‘xs:int’.\n
    \n\t\t\t\t\t

anyone can help?

Thanks!


#2

Hi Alex, Can you post a small section of your XML with the broken bit in question? It sounds like you might have a carriage return or whitespace inside the element, which would be what the parser is complaining about.

Cheers,
Jason


#3

Hi,

here you go

<PKPUsers xmlns="http://pkp.sfu.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pkp.sfu.ca pkp-users.xsd">
<user_groups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pkp.sfu.ca pkp-users.xsd">
<user_group>
<role_id>
16</role_id>
<context_id>
1</context_id>

#4

Hey Alex,

Yes, do you see how it is wrapped, after <role_id>? That carriage return shouldn’t be there. Likewise, after <context_id>.

It should probably look like this:

<PKPUsers xmlns="http://pkp.sfu.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pkp.sfu.ca pkp-users.xsd">
<user_groups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pkp.sfu.ca pkp-users.xsd">
<user_group>
<role_id>16</role_id>
<context_id>1</context_id>

and so on.  How was the XML generated?

Cheers,
Jason

#5

I see what you mean, I’ll try to get back to you after I have tried.

Anyway, I generated the XML from the export plugin in OJS and I am trying to see if I can adapt it for OMP. The thing is that Notepad++ automatically rearranged it, so that’s where the problem was.

Thanks, I’ll let you know as soon as I try it


#6

Looks like it has worked, test users were imported successfully.

Thanks a lot for your help!

Is there any other things I have to be careful about while importing all the users for good?

Thanks


#7

Great!

The only thing I can think of is that there might be schema differences between OJS and OMP, depending on the versions you’re moving between. It might be worth doing this on a test installation first, even with the full data set. And make backups :slight_smile:
Cheers,