Say that you have an XML element that you want to read in the application, but you have several environments in which the path to the dependent files may change.
<root> <element ID="MyConfigFile" url="c:\Program Files\MyProgram\resources\MyProgramconfig.xml" /> <element ID="Executable" url="c:\Program Files\MyProgram\Prog.exe" /> </root>
... so you want to link to a relative directory
@path = "c: \ Program Files \ MyProgram \"
<root> <element ID="MyConfigFile" url="@path\resources\MyProgramconfig.xml" /> <element ID="Executable" url="@path\Prog.exe" /> </root>
Is it possible to use a variable declared in XML itself to refer to a relative directory path?
source share