So I want to write a JSON dataset.
Using await job.createDataset("iqdata",JSONpath,DatasetModel.JDF);
and writing this JSON Data
{
"job": [{
"impositionwidth": "210.0000",
"impositionheight": "297.0000",
"sectionnumber": 0,
"finishedwidth": "210.0000",
"finishedheight": "297.0000",
"pages": "2",
"foldtype": "Flat Product",
"press": "HP Indigo 7900",
"presspath": {},
"stock": "150gsm Test Stock",
"Stockmatch": {},
"printquantity": {},
"processfront": "CMYK",
"processback": "CMYK",
"artworkname": "Artwork",
"thissection": {}
}]
}
It attaches to the job correctly and I can see in the dataview but when I try to view it I get this error
My JSON seems to be formatted correctly and I'm not sure why Switch is expecting "<"
Has anyone got any idea's?
Writing a Dataset JSON
Re: Writing a Dataset JSON
Switch is only able to read XML (and XML derrivates) as dataset. Datasets from other formats are "just" a way to attach a file to a job, you can't read from it.
There are some node js packages to convert json to xml, I think it is best if you use one of them and then store an XML dataset.
Alternatively, there are also apps to convert json to xml.
There are some node js packages to convert json to xml, I think it is best if you use one of them and then store an XML dataset.
Alternatively, there are also apps to convert json to xml.
Re: Writing a Dataset JSON
Thanks for the info,
I also realized that I have set the datasetmodel set to JDF rather than JSON which didn't help my cause. I will convert to XML just try to take the easy way out.
I also realized that I have set the datasetmodel set to JDF rather than JSON which didn't help my cause. I will convert to XML just try to take the easy way out.