How to generate a metadata based on XSD

Hello,

I am new to the tool and this may be a simple question.

I need to transform an XML payload defined in an XSD format A to another payload defined in an XSD format B. I was hoping to use XMLExtract and XMLWriter for reading/writing the payload and Reformat for transforming the data between formats. The problem I am facing is that tool does offer an option to create a metadata based on XSD schema. Am I doing something that’s not supported or there is a workaround.

I have tried similar model for mapping flat to CSV files. Although, I’ve used the wizard to define my metadata and UniversalReader/Writer to read.

Hello,
it is possible to import metadata from XSD schema in CloverETL Desktop (see Metadata from XSD)

Hello,
it is possible to import metadata from XSD schema in CloverETL Desktop (see Metadata from XSD)

“avackova”

Thank you for the response.

I am having problems with the import process.
With v3.0 of the tool, the XSD import wizard is requiring to provide options for Delimited/Fixlength data that do not apply to XSD. I have tried providing options as stated in the link above and clicking the “next” button (as “Finish” was grayed out) Upon entering the next screen the schema was shown with (red X ball) indicating that something was not right and no XSD nodes were available to choose from.

With version 2.9.4 of the tool, the next button is grayed out and “Finish” is available". However, the output generated by the wizard does not seem to be correct.

The following output is being produced for delimited metadata setting:

<?xml version="1.0" encoding="UTF-8"?>

The following output is being produced for fixlength metadata setting:

<?xml version="1.0" encoding="UTF-8"?>

Can you send the schema?

Can you send the schema?

“avackova”

We are using standard PAIN.008 schema from ISO20022.
XSD is attached.

Hello,
the metadata can’t be imported to CloverETL, because it exists xsd element in the file, that doesn’t satisfy Clover naming restrictions. I’ve reported the problem to our bug tracking system (http://bug.cloveretl.org/view.php?id=5140). An easy workaround is to rename this element in the xsd schema file. When you change line 219 from:

 <xs:element name="pain.008.001.01" type="pain.008.001.01"/>

to:

<xs:element name="pain_008_001_01" type="pain.008.001.01"/>

the wizard works properly.

Hi,
I’m using the xsl transform component to extract the Message Body from a SOAP message (xml). The output is passed to the XMLExtract component from the ouput port of XSLTransformer.
The meta data for the output port needs to be configured to have an xsd structure. I have tried using the generate metadata based on XSD option, however,
1. How is the Delimited Data or the fixed length metadata options are valid in this scenario.
2. On choosing the fixedlength metadata option (field size=0), in the subsequent window, the xsd is broken down into into individual metadata files, implying the xsd structure is no longer valid and cannot be used for the output port.

Regards
evn

Hi evn,

ad 1) If you mean metadata between XLSTransformer and XMLExtract, you probably want to send the whole file to XMLExtract at once. To achieve this, you do not need to extract metadata from XSD, you can just create metadata with one field, delete record delimiter and field delimiter and set EOF as delimiter property in the field. And if you mean metadata on the output edge of XMLExtract, delimited metadata are better for you because there is no limitation for length of values in metadata fields.

ad 2) With your XSD schema, there is no way to create only one metadata file. Each element with cardinality 0:n, 1:n or m:n has to have it’s own metadata.
Here is an example:

<people>
	<person name='adam'>
		<phone>123</phone>
	</person>
	<person name='bob'>
		<phone>789</phone>
	</person>
</people>

Data

name|phone
adam|123
bob|789

Here is possible to have only one metadata because cardinality between person and phone is 1:1.

Another example:

<people>
	<person name='adam'>
		<phone type='home'>123</phone>
		<phone type='work'>321</phone>
	</person>
	<person name='bob'>
		<phone type='home'>789</phone>
		<phone type='work'>987</phone>
	</person>
</people>

Data

name|phone|phone|?type?
adam|123|321
bob|789|987

As you can see, table would be denormalized. Data should be divided into two tables. Therefore two metadata should be created:

Person
person_id|name
1|adam
2|bob

Phone
person_id|type|phone_number
1|home|123
1|work|321
2|home|789
2|work|987

Please, let me know if you have any further questions.

Best regards,