首页 > 解决方案 > Challanges in transforming data with tXMLMap Talend

问题描述

I'am new to talend and have been trying to understand tXMLMap of talend. I have a couple of questions regarding it which I have difficulty in understanding.

  1. Importing schema via xsd: I have seen that the tXMLMap is able to generate the input and output flow when schema is uploaded. But the problem I founded with that schema is that the schema cannot be uploaded as xsd. And the currently uploaded schema is in xml extension containing some talend specific tags. Is there anyway to do this with normal xsd. I saw a method of building schema by uploading to the File xml on the repository but it wasnt doing any good in solving this problem because it is just placed there and not being able to import to tXMLMap. Is there anyway to solve this?

  2. Lets say the input of tXMLMap contains an array in one of it sub branch. Can I map this array to different vairables in the output flow? Can that level of complication be handled by the tXMLMap?

  3. What is the exact need of aggregate and loop in tXMLMap?

标签: schemaetltalend

解决方案


1)在存储库的元数据部分,您将能够创建链接到您的输入 xml/xsd 文件的元数据(模式)。(小心:您需要一个元数据来读取数据,一个来写入数据)然后,当您创建元数据时,您可以在 tXMLMap 中使用它(只需右键单击 tXMLMap 中的根元素(类型必须是文档)和选择“从存储库导入”。

2)您必须在 tXMLMap 中使用“循环元素”并将其放置在您的数组中:这样您就可以从您的数组中提取所有数据并将其发送到您的输出流。

  1. Loop 元素在 tXMLMap 中至关重要:这将允许您从 xml 输入流中正确提取数据。如果您有多个这样的并行循环:

您需要 2 个循环元素(一个用于 elementA ,一个用于 element B )和 2 个输出流才能读取所有数据。


推荐阅读