ERROR: contains characters which are not properly URI-encoded

Having trouble installing Oxygen? Got a bug to report? Post it all here.
antoterrence
Posts: 30
Joined: Sat May 04, 2019 5:55 pm

ERROR: contains characters which are not properly URI-encoded

Post by antoterrence »

When I use the following method to set a value for @href

Code: Select all

<topicref processing-role="resource-only"
            href="${makeRelative(${currentFileURL}, ${repo}/ua_common/reusable.dita)}"/>
I get the following error:

Code: Select all

contains characters which are not properly URI-encoded. Is it possible to use variables like this to add default files to a map template
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: ERROR: contains characters which are not properly URI-encoded

Post by Radu »

Hi,

This is probably a continuation of your previous post here:
post53797.html#p53797

What is the ${repo} editor variable? Is it a custom variable, to what precise path value does it expand in this case? It should expand to an URL-like path variable, similar to the "${currentFileURL}" so that the "makeRelative" is able to create a relative reference.
Maybe to debug this problem you can add in the DITA Map various topicrefs:

Code: Select all

<topicref processing-role="resource-only"
            href="${currentFileURL}"/>
<topicref processing-role="resource-only"
            href="${repo}/ua_common/reusable.dita"/>
            
just to see if both editor variables expand properly and their path syntax is similar.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
antoterrence
Posts: 30
Joined: Sat May 04, 2019 5:55 pm

Re: ERROR: contains characters which are not properly URI-encoded

Post by antoterrence »

We have a typical scenario here. The custom template sit in the installation directory. But the collections (reusable topics) that are part of the bookmap template sit in a separate file system. Naturally, the references to the collections files are going to break since the file system (drive names) can vary on individual writer's system. So the ${repo} is a custom variable that points to the folders where the collections file reside on an individual writer's system. When the writer creates a map file using the custom book map template, we don't want the references to be broken. In addition, the resolved references should have relative paths so that when the map file is transported into another system, it works fine. I got the variables to work. However, in some cases (when the template is in installation directory), the path that is created from the ${makerelative} function ends being an absolute path.
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: ERROR: contains characters which are not properly URI-encoded

Post by Radu »

Hi,

About this remark:
However, in some cases (when the template is in installation directory), the path that is created from the ${makerelative} function ends being an absolute path.
And what are those cases? Probably when you create an untitled.ditamap which is not yet saved anywhere, right?
We still have lots of Java API available in the Oxygen SDK so for example an Oxygen plugin can add a custom toolbar action (if you want to by-pass our entire File->New functionality) or you can add "save" listeners to opened documents so that after a document is saved you can make changes to its contents.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply