Opened 10 years ago

Last modified 6 weeks ago

#395 reopened enhancement/feature request

xi:include of non-existing file is ignored

Reported by: Owned by: KaZeR
Priority: minor Milestone: version 0.6.0
Component: core Version: git master
Severity: Keywords: xml. logging


When I add this to my navit.xml:

<xi:include href='/complete/nonsense.xml' />

Navit starts normally, without any warning or error message what so ever. In this nonsense case that's okay, but it made tracking down a configuration problem rather hard. I had:

<xi:include href='navit-gui.xml' xpointer="xpointer(/config/navit/*)" />

in my navit.xml, and Navit refused to start because no GUI was defined. In the end it turned out that the href attribute is resolved relative to the current directory, and not relative to the document containing the <xi:include /> element.

Navit was unable to find the configuration file but never barked. I would have expected an error message or at least a warning when parts of the configuration cannot be found.

I have updated to let users know the path is relative to the CWD.

Tested on SVN revision 2368

Change History (7)

comment:1 Changed 10 years ago by

A suggestion for the error message / warning: include the full path of the file that couldn't be found. For example:

<xi:include href="some/file.xml" />

should result in a message like:

Error:unable to include /current/working/dir/some/file.xml from /home/root/.navit/navit.xml line 15

comment:2 Changed 9 years ago by kazer

  • Milestone set to version 0.2.0

Printing the message in the console should be quite easy. But currently, internal gui (for example) doesn't have a notification framework. This is also what is currently blocking #165.

comment:3 Changed 9 years ago by

A console message would be enough for me right now.

comment:4 Changed 9 years ago by akashihi

  • Milestone changed from version 0.2.0 to version 0.3.0
  • Resolution set to fixed
  • Status changed from new to closed

Partially fixed in r3415

Unfortunately it is generically impossible to show a pretty message box from the config parser. Errors could happen on very early stages and we do not know, at that time, what gui/graphics we will be using and we may not have even navit object, to keep the message for future use. Even more - we don't even sure, that this 'future use' will ever be possible.

So i postpone the ticket to 0.3.0

comment:5 Changed 9 years ago by akashihi

  • Resolution fixed deleted
  • Status changed from closed to reopened

Oops, closed by mistake

comment:6 Changed 6 years ago by usul

  • Keywords xml. logging added
  • Milestone changed from version 0.5.0 to version 0.5.1

Please take care, that xi:include also works with jokes to include all XML files of a directory. So maybe the warning should appear, if there is no file added?

As this improves config stability, I schedule it to the next hotfix release.

comment:7 Changed 6 weeks ago by

  • Milestone changed from version 0.5.1 to version 0.6.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.