Referencing PrivateData in an XSLT
Posted: Wed Aug 26, 2020 12:01 am
I'm using an XSLT to export a .csv file. One of the items in the CSV is pulled from PrivateData. I cannot find the appropriate quoting/escaping level to get it to appear in my output. And there are no errors thrown anywhere. Here's the relevant bit:
;<xsl:value-of select="//*[tag='Job Number']/value"/><xsl:text>_</xsl:text><xsl:value-of select="translate(//*[Job.PrivateData:Key='SQLCustName']/value,' ','-')"/>
The rest of the XSLT works properly, just that there's nothing after the underscore that separates these 2 fields i.e. if 'Job Number' is "123456", the output is "123456_". And yeah I pretty much have to do the replacement of spaces in the PrivateData in this operation - unless it would be less cumbersome to do that when I define the PrivateData, which is done in 2 different places depending on which branch the file takes.
;<xsl:value-of select="//*[tag='Job Number']/value"/><xsl:text>_</xsl:text><xsl:value-of select="translate(//*[Job.PrivateData:Key='SQLCustName']/value,' ','-')"/>
The rest of the XSLT works properly, just that there's nothing after the underscore that separates these 2 fields i.e. if 'Job Number' is "123456", the output is "123456_". And yeah I pretty much have to do the replacement of spaces in the PrivateData in this operation - unless it would be less cumbersome to do that when I define the PrivateData, which is done in 2 different places depending on which branch the file takes.