Change request #1808

The data file specified in an XML file should be relative to the XML file, not the executable

Added by Knödlseder Jürgen over 8 years ago. Updated over 8 years ago.

Status:ClosedStart date:06/23/2016
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:1.1.0
Duration:

Description

If a relative file name is given in a XML file it should be specified relative to the location of the XML file, not the executable. If an absolute path name is specified, the absolute path name should be taken.


Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen over 8 years ago

  • Assigned To set to Knödlseder Jürgen
  • Target version set to 1.1.0

#2 Updated by Knödlseder Jürgen over 8 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 90

The following was implemented:
If a file that is reference in an XML file has no path it will be assumed that the file is located in the same directory as the XML file. In reading the XML file, the path of the XML file will be prepended to the file, and before writing it will be stripped again.

The logic for this has been implemented in the gammalib::xml_file_expand() and gammalib::xml_file_reduce() functions that will be called from the relevant XML methods.

The XML classes had also be reorganised to correctly pass the parent pointers to the children (this is now done in GXmlNode instead of GXmlElement. It is therefore possible to deduce the name of an XML file from each of its nodes (the GXmlNode::filename() method has been implemented for that).

#3 Updated by Knödlseder Jürgen over 8 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

Merged into devel

Also available in: Atom PDF