User import plugin error due to invalid XSD schema error : pkp-users.xsd schema missing

Hello!

I’m trying to batch import users with the XML plugin, and am encountering an error due to a missing XSD file on this site.

  • Application Version - 3.3.0.6

  • Description of issue : Trying to import users fails due to the impossibility of validating the schemaLocation : xsi:schemaLocation=“http://pkp.sfu.ca pkp-users.xsd”> . Indeed, navigating to http://pkp.sfu.ca/pkp-users.xsd gives a “page not found” error. Hence, the import plugin fails due to this.

*** Steps you took leading up to the issue :** At first, I was getting various schema errors due to my test entry being invalid. After finding the XML schema sample file and trying to import the sample data, I was getting the following error 17x (once per user_group entry) :
"Element ‘{http://pkp.sfu.ca}name’: This element is not expected. Expected is ( {http://pkp.sfu.ca}permit_metadata_edit ). "

I then tried validating the unaltered schema file in a few XML editors and found it was failing right at the beginning when trying to find the XSD schema on this site :ojs plugin error

Hence, if the unaltered users sample cannot be imported and the issue appears to be on the pkp-users.xsd schema file hosted on this side, could a project member look into this?

If I’m not getting something and the issue is on my side, any help would be appreciated!

  • What you tried to resolve the issue : see above

  • Screenshots : Here are the errors in the OJS interface :
    ojs plugin error - ojs interface

  • Error log messages if applicable : n/a

Hi @revueshec,

Thank you for bringing this to our attention. I’m going to bring this up with our team and see about addressing the missing schema file.

-Roger
PKP Team

Hello Roger,

Thanks for the quick answer!

Cheers,

Frank, HEC Montréal magazines team

Hi @revueshec,

The pkp-users.xml file is available in lib/pkp/plugins/importexport/users/pkp-users.xsd in your OJS installation, or pkp-lib/pkp-users.xsd at stable-3_3_0 · pkp/pkp-lib · GitHub online. (This is for the stable-3_3_0 branch, be sure to use the right branch for your release of OJS/OMP/OPS if it’s not 3.3.0-x.)

The xsi:schemaLocation=" http://pkp.sfu.ca pkp-users.xsd" attribute specifies that the pkp-users.xsd file should be in the current working directory. You can specify the full path to the file on your system in its place. The http://pkp.sfu.ca URL before that is a namespace and not part of the path to pkp-users.xsd.The import errors you’re seeing indicate that the import document you’re using is not compatible with your release of OJS. Rather than getting the file from the main branch, make sure to use the appropriate branch for your particular version of OJS:

In your particular case, in looking more closely at the error messages, what you appear to be having problems with is that the sample XML used is incorrect. It’s missing an element before the <name>element, called permit_metadata_edit.

Can you try again with some of these things in mind and let us know how you make out?

-Roger
PKP Team

Hello Roger,

Thanks for the answer! After looking into this further, I found the location of the pkp-users.xsd in our installation :
location pkp-users-xsd OJS

The users sample file is identical in our installation and the project, so I appended the path in the sample.xml :


<user_groups xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation=“http://pkp.sfu.ca /public_html/lib/pkp/plugins/importexport/users/pkp-users.xsd”>

Importing the sample.xml file then gives the following errors :

This one 17x, as originally :
Element ‘{http://pkp.sfu.ca}name’: This element is not expected. Expected is ( {http://pkp.sfu.ca}permit_metadata_edit ).

Then the following :

Element ‘{http://pkp.sfu.ca}salutation’: This element is not expected. Expected is one of ( {http://pkp.sfu.ca}date_registered, {http://pkp.sfu.ca}date_last_login, {http://pkp.sfu.ca}date_last_email, {http://pkp.sfu.ca}date_validated, {http://pkp.sfu.ca}inline_help, {http://pkp.sfu.ca}auth_id, {http://pkp.sfu.ca}auth_string, {http://pkp.sfu.ca}phone, {http://pkp.sfu.ca}mailing_address, {http://pkp.sfu.ca}billing_address ).

I looked into this with a person more familiar with XML than the newbie I am, and since the sample.xml is identical, we’re not sure where the errors are coming from. Any ideas?

Thanks,

Frank - Revues HEC

Hi everyone

This actually has nothing to do with the location of the pkp-users.xsd file but rather the fact that the sample XML you’re trying to import is missing a field.

If you look at the pkp-users.xsd file here:

You’ll see that on this line:

That XSD imports the main pkp-native.xsd file, which ultimately defines what a user group should look like. THAT file indicates that there should be an element called permit_metadata_edit before the name element:

The sample XML that comes with the plugin is missing this field, and that’s why the import is failing. If you edit the sample XML to include a tag that looks like:

<permit_metadata_edit>true</permit_metadata_edit> (or false, if you don’t want that)

before all of the <name> elements for each of the <user_group> elements at the top of the file, that error should be resolved.

This is probably a minor bug in the plugin, since the sample XML is missing those elements.

Cheers
Jason

Hi @revueshec,

These error likely point to xml tags that appear to be present in your XML, or are in the wrong place (e.g. nested within tags that they are not allowed to be according to the XSD file, that are perhaps not supposed to be - like the <salutation> tag.
If you could perhaps share some output from your XML file here that relate to these errors, I could have a closer look. Just a note, not to include personal information like emails. Alternatively, you could send me your xml file in a private message and I’ll have a look to see if I can spot anything.

-Roger
PKP Team

Hi @rcgillis @jnugent ,

Editing the sample.xml by adding the <permit_metadata_edit> element to each <user_group> entry fixed all the Element ‘{http://pkp.sfu.ca}name’: This element is not expected. Expected is ( {http://pkp.sfu.ca}permit_metadata_edit ). errors.

I then had to change to and to as per instructed in the documentation (Data Import and Export), and importing worked.

One minor issue I still can’t fix :

We have multiple journals in our OJS account, and if an imported user was already present in one, the user information was updated there, and not added to the target magazine. I can’t find anything to fix that, I thought the URL user attribute (http://www.admin-site.com) might help, but it related to user information and not journal information it seems.

Thanks,

Frank

This topic was automatically closed after 13 days. New replies are no longer allowed.