Combines 2, 3 or 4 path segments into a single path using the correct platform-specific directory separator.
This function respects the operating system path separator, for example when using ORIGAM Server running in Linux-based Docker container, the default separator will be “/”.
The function behaves similarly to .NET System.IO.Path.Combine described here.
NAMESPACE
xmlns:fs="http://xsl.origam.com/filesystem
SYNTAX
2 segments:
string CombinePath(string path1, string path2)
4 segments:
string CombinePath(string path1, string path2, string path3, string path4)
PARAMETERS
| Name | Description |
|---|---|
| path1 | Base path |
| path2 | Path segment to be appended |
| (path3 | Another path segment to be appended ) |
| ( path4 | Last path segment to be appended ) |
EXAMPLE
Example with 2 segments for Windows based system:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:AS="http://schema.advantages.cz/AsapFunctions"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:fs="http://xsl.origam.com/filesystem" exclude-result-prefixes="AS date fs">
<xsl:template match="/">
<ROOT>
<xsl:value-of select="fs:CombinePath('C:\Data','Files\input.xml')"/>
</ROOT>
</xsl:template>
</xsl:stylesheet>
Result
<?xml version="1.0" encoding="utf-8"?>
<ROOT>C:\Data\Files\input.xml</ROOT>