Liquid Studio 2021
Data Mapping / Data Mapper Functions / By Category / File / CombinePath
In This Topic
    CombinePath
    In This Topic

    Function Name
    CombinePath
    Category
    File
    Icon
    Description
    Combines several path parts together adding the \ separator
    Inputs
    Path Part 1 The first part of the path to add
    Path Part 2 The second part of the path to add
    ... More inputs can be added see Variable Function Inputs
    Outputs
    Path The combined path string.
    Properties
    None -

    Reads all the values from the inputs and combines them to form a path, adding the path separator \ if required.

    Unconnected inputs are ignored.

    Sample output

    Input Path Part 1 Input Path Part 2 Input Path Part 3 Output
    c:\temp\ Folder test.txt c:\temp\Folder\test.txt
    c:\temp Folder test.txt c:\temp\Folder\test.txt
    c:\temp \Folder test.txt \Folder\test.txt
    c:\temp Folder\ test.txt c:\temp\Folder\test.txt
    c:\ temp \Folder\test.txt \Folder\test.txt
    c:\ temp Folder\test.txt c:\temp\Folder\test.txt
    temp Folder test.txt temp\Folder\test.txt
    .\temp Folder test.txt temp\Folder\test.txt
    ..\temp Folder test.txt temp\Folder\test.txt
    c:\temp .\Folder test.txt c:\temp\.\Folder\test.txt
    c:\temp ..\Folder test.txt c:\temp\..\Folder\test.txt
    ..\temp test.txt ..\temp\test.txt
     

    Output in XSLT may differ slightly

    Example

    A range of functions are provided for working with Uri's and Path's. The following example demonstrates how these can be used.

     

    In the following example we have a directory c:\UriExamples\ that contains the files Bookstore.xsd, Input001.xml, Input002.xml & ResolvedUri.Output.xml.

    In our transform we have configured "ListFiles" to operate on the directory "c:\UriExamples\" and use the pattern "Input*.xml"

    As you can see the ListFiles component gets the full paths of all the files that match the pattern. These filenames are then fed into the various Uri functions and output into an XML writer.

    The result of the transform is as follows

    Transform Output
    Copy Code
    <FileProperties>
      <File>
        <FullFilename>C:\UriExamples\Input001.xml</FullFilename>
        <Filename>Input001.xml</Filename>
        <Extension>.xml</Extension>
        <Path>C:\UriExamples</Path>
        <AltFullFilename>C:\UriExamples\Backup\Input001.xml</AltFullFilename>
        <BackupFilename>C:\UriExamples\Input001.xml.bak</BackupFilename>
      </File>
      <File>
        <FullFilename>C:\UriExamples\Input002.xml</FullFilename>
        <Filename>Input002.xml</Filename>
        <Extension>.xml</Extension>
        <Path>C:\UriExamples</Path>
        <AltFullFilename>C:\UriExamples\Backup\Input002.xml</AltFullFilename>
        <BackupFilename>C:\UriExamples\Input002.xml.bak</BackupFilename>
      </File>
    </FileProperties>
    

    Let's examine the output in more detail

    Compatibility

    Native Execution Engine, XSLT 2.0, C#

    This is a scalar function so the standard rules apply if multiple values are presented to one or more inputs.

    See Also