Referencing PrivateData in an XSLT

Post Reply
rgpepper
Member
Posts: 80
Joined: Wed Oct 14, 2015 2:09 am

Referencing PrivateData in an XSLT

Post by rgpepper »

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.
rgpepper
Member
Posts: 80
Joined: Wed Oct 14, 2015 2:09 am

Re: Referencing PrivateData in an XSLT

Post by rgpepper »

Maybe it would be helpful to understand the problem I'm trying to solve with the use of PrivateData within this transform. Ultimately I'm trying to effectively over-write the value of a field in the job metadata. I'm using a field in a database that contains a name field (and a job number field) from a previous job. The idea is that when more files are submitted for this same job number, that if they don't key in the name field identical to the original submission, I won't be able to provide the right data to match this file up with the original further down the line - outside of Switch (the csv is provided to Prinergy so it knows which job to associate this new PDF file with). So I'm looking up the job number in the database to get the name that was used the first time for that job number. I need to somehow be able to use the looked-up name in place of the job-supplied name. That's the crux of it.
jan_suhr
Advanced member
Posts: 592
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Referencing PrivateData in an XSLT

Post by jan_suhr »

There are a few apps you could try to get the XML you want and then convert it to CSV. Search for XML in the AppStore and you'll see what can be used.

Otherwise it is a scripting solution that is required.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
Post Reply