Wiki source for VariableXPATH


Show raw source

======XPATH Variable======

Similar to the [[VariablePATH PATH]] environment variable, the shell uses the XPATH variable as a list of directories to search to find xmlsh scripts.



As of version 1.0.2 xmlsh performs the following on startup.
- Converts platform specific directory seperator to "/"
- Splits the XPATH variable using the OS specific path seperator charactor i
- Stores the result into the xmlsh variable XPATH as a sequence of xs:string


On executing subprocesses xmlsh exports the XPATH variable to the subprocess by reversing process and reconstructing the PATH variable to the OS native representation.

Note that on some OS's environment variables are case in-sensitive (Windows). In these OS's any case for PATH (such as "XPath") is converted to all upper case XPATH.



Example: Set the XPATH variable to the directory C:/xmlshscripts
%%
XPATH=C:/xmlshscripts
%%

If you want to set XPATH to more then one directory then you can use any XML expression which produces sequences. The simplest is the sequence constructor ().

Example Set the XPATH variable to 3 directories
%%
XPATH=(/usr/local/bin/xmlshscripts $HOME/xmlsh /opt/myscripts)
%%

Similarly you can use any XML expression which produces sequences such as <[ ]>

%%
XPATH=<["/usr/local/bin/xmlshscripts", concat($HOME,"/xmlsh"), "/opt/myscripts" ]>
%%

As with all sequence variables you can use the += notation to add to the variable

%%
XPATH+=/my/directory
%%
----
[[Variables]]
[[VariablePATH]]

Valid XHTML :: Valid CSS: :: Powered by WikkaWiki