cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with XLM Generator snap

Dawid_Zajdel
New Contributor

I have a problem with generating xml file using XML Gnerator. I have a json and use Mapper snap together with XML Generator to create xml file.
image

My mapper looks like this:

image

So I mapped array to array.

The results of mapper looks ok, but I receive empty output from XML Generator snap:
So it shows that mapper doesn’t work correctly.

In the attachment I will send pipline.XML Generator Community Example_2019_10_17.slp (220.4 KB)

Please suggest how to solve this problem.

6 REPLIES 6

ptaylor
Employee
Employee

I can’t reproduce this. I imported your pipeline and was able to run it after removing the error pipeline, which you didn’t include. I got output from the XML Generator:

17%20AM

ptaylor
Employee
Employee

When I tried to Run (rather than Validate) the pipeline, the File Writer executed and indicates in error in the filename configuration where you use Date.Now() in your expression. It should be Date.now().

30%20PM

Dawid_Zajdel
New Contributor

@ptaylor I am aware that there exists some output for the XML Generator, but as you see on your screen the tags (Worker) are empty and that is a problem. The output from Mapper has some data for Workers but XML Generator does not.

To be more precise, for JSON generator we receive JSON with information regarding 5 workers and some other fields. I expected that as output from XML Generator I would also receive only 5 tags workers (without additional tags), and each tag would contain information about one worker.
The template XML teoreticaly looks ok:

image

In mapper snap I mapped array worker from json and array workers from XML Generator but it doesn’t work.

Could you please tell me how the mapper snap or XML Generator snap should be set so that the output from XML Generator contains an xml file with correctly filled tags?

How did you generate the template in your XML Generator? Using an xsd file?

The expressions in your template don’t match the input document. All of the object names in that start with “peci:”, except for the ones you renamed in your Mapper. Can you remove that “peci:” prefix from everything?