I have detected the following issue with createlabellinkfile: we create the xml file based on the SVG objects' structure, but one of the object names (Sao Tome & Principe) causes an invalid xml. We will review all of our maps to avoid the use of non xml-standard characters, but in the meantime there is a workaround. Add another entry to the script where you make modifications to the xml file, including a fix for Sao Tome & Principe as follows:
elseif($_ -match "<DataText>Sao Tome & Principe</DataText>"){ write-output "<DataText>Sao Tome and Principe</DataText>" } elseif($_ -match "<DisplayText>Sao Tome & Principe</DisplayText>"){ write-output "<DisplayText>Sao Tome and Principe</DisplayText>" } elseif($_ -match "<SvgText>Sao Tome & Principe</SvgText>"){ write-output "<SvgText>Sao Tome and Principe</SvgText>" }Now that you have a valid XML, all you have to do is populate the map with a datasource containing the data in your desired format. For example, I created a basic Data.csv file with the following data:
Country,PopulationUSA,100United Kingdom,120The Netherlands,130France,140Argentina,80
Then I get the data from the csv and pass it to out-map as follows:
import-csv data.csv | out-map -label Country -value Population -MapSource World\WorldCountries -LabelLinkFile countries.xml
Note that I need to specify the column used as label and the column used as value because import-csv returns all the data as string. If you use a different datasource in which the values are returned as numbers (e.g. invoke-sql), then you wouldn't need that.