Validating a ditamap produces bogus errors

Questions about XML that are not covered by the other forums should go here.
shuttie27
Posts: 2
Joined: Fri Sep 07, 2012 9:38 pm

Validating a ditamap produces bogus errors

Post by shuttie27 »

Hello

Using oXygen Author 12.2 on Windows Vista SP2.

I have a ditamap that references a bunch of dita XML files in folders at the next level down. My file structure is:

Code: Select all

maps (contains the map)
images
maint (contains the image)
concepts
maint (contains the topic file)
So the relative paths for referenced images in my topic files are in the form href="../../images/maint/myImage.png"

I open the map in the DITA Maps Manager and run the Validate and Check for Completeness routine, with the "Check the existence of non-DITA reference sources" option selected. The results tell me that 23 images referenced in my topic files don't exist.

The paths shown in the results panel are wrong. Author seems to have looked only one level up instead of two. For example, the results panel shows that Author is looking for:
href="../images/maint/myImage.png, and tells me the image doesn't exist.

There is nothing wrong with the ditamap as far as I can tell. If I open one of the topic files in Author, it displays the image without any issues. If I replace an image in the topic file, the resulting XML is exactly the same as before. Nevertheless, if I validate the map afterwards it still lists the image as missing.

Any ideas?

Roger Shuttleworth
London, Canada
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Validating a ditamap produces bogus errors

Post by sorin_ristache »

Hello,
shuttie27 wrote:Using oXygen Author 12.2 on Windows Vista SP2.

...

So the relative paths for referenced images in my topic files are in the form href="../../images/maint/myImage.png"

...

The paths shown in the results panel are wrong. Author seems to have looked only one level up instead of two. For example, the results panel shows that Author is looking for:
href="../images/maint/myImage.png, and tells me the image doesn't exist.
I tried the Validate and Check for COmpleteness action on a map that includes a topic with an image having the same type of relative path, that is href="../../images/image.gif", but I get no validation errors in Oxygen Author 12.2 or in Oxygen Author 14.0. Of course the path is correct and I can see the image in Author editing mode, just like you. Please can you send us a set of sample files for reproducing the error?


Thank you,
Sorin
shuttie27
Posts: 2
Joined: Fri Sep 07, 2012 9:38 pm

Re: Validating a ditamap produces bogus errors

Post by shuttie27 »

Hello Sorin

Thanks for your reply. First let me apologise for posting this among the general XML questions instead of the oXygen Editor list, which would perhaps have been more appropriate (my first post!).

Anyway, I have solved the problem, which was as follows:

The topicrefs in the ditamap had an extra / in them, the result of some over-zealous search and replace routines. So they appeared as:
<topicref href="tasks/maint//inserting_the_widget.xml" type="task"/>.
This was entirely my error, not Author's.

What may be of interest to you, though, is that Author did not report any topicref errors when checking the ditamap; it was able to find all the referenced topic files. It was only *images* within those files that it could not find. For some reason the // in the topicrefs caused it to look at the wrong level, as described in my original post.

Thanks for your help.
Roger
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Validating a ditamap produces bogus errors

Post by sorin_ristache »

Hi Roger,
shuttie27 wrote:What may be of interest to you, though, is that Author did not report any topicref errors when checking the ditamap; it was able to find all the referenced topic files. It was only *images* within those files that it could not find. For some reason the // in the topicrefs caused it to look at the wrong level, as described in my original post.
Yes, the map validation action does not report a double '/' in an href attribute. It issues a warning about that topic though, when that topic (the one referenced in the topicref/@href attribute) is linked from other topic also included in the map. Such a warning is not a direct pointer to the location of the warning, just like the warnings about the image references from the topic with the double '/' href value, so they do not point directly to the cause of the error/warning. We will improve the detection of this type of error in a future version.


Regards,
Sorin
Post Reply