Storing paths in p:variables

XProc pipeline snippet:  
  <p:variable  
   name ="cwd" 
   select ="'/path/to/my/project'" 
  />
  <p:variable 
   name ="dir-lib"  
   select ="concat($cwd,'/lib')" />
  <p:variable 
   name ="dir-mylib" 
   select ="concat($cwd,'/mylib')" />
  <p:variable 
   name ="dir-src" 
   select ="concat($cwd,'/src')" />
  <p:variable 
   name ="dir-tests" 
   select ="concat($cwd,'/tests')" />
  <p:variable 
   name ="dir-build" 
   select ="concat($cwd,'/build')" />
  <p:variable 
   name ="dir-logs" 
   select ="concat($cwd,'/logs')" />


Motivation:
 Basically, I’ve been hardcoding all these paths, and I’m trying to make things more maintainable.
 
 Note: I usually prefer to always put a trailing slash on directories wherever possible.  My pipeline is still be tweaked all the time, and I don’t remember why I departed from the trailing slashes, but it bugs me.  I just wanted that on record. ☺ 

Looking for:
 Feedback, alternatives, best practices.  

Received on Wednesday, 25 May 2011 14:28:19 UTC