In which image formats can XMP or IPTC keywords be written?
It's difficult to answer ...
You can read "supported file types" for exif,iptc, xmp, ICC fields here :
https://exiftool.org/
In many cases, XnViewMP does not use exiftool, but one can learn there which file types can't use embedded metadata.
Another way is to use "sidecar files" : these companion files can contain XMP metadata for any file type.
You can generate a xmp sidecar file by ticking "create sidecar" in metadata settings, and
-select a file , unmark / mark it's category , release selected file.
Result : a .xmp file is created, containing xmp data (categories, stars...)
- if you want to create a large amount of sidecar files, use categories filter
- select a category in the filter, select all files shown, unmark / mark the category (in categories pane) , unselect files, .xmp files are created.
- when using xmp sidecar files, each photo needs it's own companion to keep categories or other metadata.
Can the "Export/import categories of file" function be helpful here?
For file types that do not support embedded metadata, yes. First, it's a backup for your categorizing work.
You can install a new instance of PORTABLE xnviewmp somewhere in your PC, when it starts, choose "in program folder" for settings to be stored.
Then export file's categories of first xnviewmp (a xml file), and import it in the second xnviewmp, in order to check if it's a good solution for your specific usage.
( Before importing, you could edit and clean the xml file if necessary or if you need to move photos ...)
What is the difference between "base path of your images" and the "added" folders?
Added folders : when "import" settings are enabled, xnviewmp reads metadata of specifed folders to update it's database (catalog)
Base path : I don't use it, because some bugs occured with this some years ago.It describes the path to the main folder for photos.
I think it can be used to use a shared database, or shared photos in a server.