cancel
Showing results for 
Search instead for 
Did you mean: 

Data Type Creation

Former Member
0 Kudos

Hi All,

I have a question, it might be a very basic question for you guys but please help me. I have to create a data type in xi to attain the following xml structure. Please let me know how to do it.

<Row>

<Field name="NAME" value="" />

<Field name="AGE" value="" />

<Field name="EMAIL" value="" />

<Field name="PHONE" value="" />

</Row>

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Create Data Type Row

Insert Element Field -- occurences - 0..unbounded

Insert Attributes - Name, Value

Thanks,

Beena.

Former Member
0 Kudos

Hi Beena,

Can you show me the sample using my xml structure. I mean how to get "Field name" and "Value" before and after the field.

Thank you for the quick reply

Answers (5)

Answers (5)

Former Member
0 Kudos

The problem is solved. Thank you guys for all the quick replies. I have created a Element Field and attributes name and value.

And then duplicated the subtree in the mapping, coz this was the only way i could solve the problem.In data type I cannot create multiple elements with same name.

Thanks again. I have awarded the points.

Former Member
0 Kudos

Steps to be followed in the creation of datatype

<Row>
<Field name="NAME" value="" />
<Field name="AGE" value="" /> 
<Field name="EMAIL" value="" />
<Field name="PHONE" value="" />
</Row>

1) Right click on the datatype and provide a name for it.

2) Now a screen appears where we can edit thw data type structure as we need.

3) Create the root element Row by adding the a new row.Dont specify Type for it.

4) Right click on the root element and choose insert subelement.Create Field.dont specify type.

5) Right click on the above created subelement ,choose insert attributes.Create name.Specify type.

6) Repeat the above step to create the value attribute also.

Specify type.

former_member193376
Active Contributor
0 Kudos

Hi

The Nodes which you have created is your field name and you can give your default value in the DEFAULT TAB. if there is no data , then leave it blank

Thanks

Saiyog

Former Member
0 Kudos

Hi,

You want to create the data type of that structure ? if yes

Then

Select your component version --> Interface objects --> data types --> right click say new --> Give any name

Add the fields(One icon is with + select Insert subelement)

Name : Name

Type : String

Occurance : 1 or n (according to ur requirement)

Again click on Add the fields button(now you select insert element)

Name : Age

Type : integer

Occurance : 1 or n (according to ur requirement)

Again click on Add the fields button(now you select insert element)

Name : Email

Type : String

Occurance : 1 or n (according to ur requirement)

Again click on Add the fields button(now you select insert element)

Name : Phone

Type : integer

Occurance : 1 or n (according to ur requirement)

Former Member
0 Kudos

Thanks for the quick reply. I would like to know how I can get the "Field name=" and "value=" before and after my element in the tag.

thank you

Former Member
0 Kudos

Field is an element and name and value are attributes.

So create multiple field elements with name and value attributes.

Thanks,

Beena.

Former Member
0 Kudos

check this xsd:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://reliant.com/xi/BDRC" targetNamespace="http://reliant.com/xi/BDRC">

<xsd:complexType name="row">

<xsd:sequence>

<xsd:element name="field" minOccurs="0" maxOccurs="unbounded">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

4db854d05f1911ddb25d00065bb3316c

</xsd:appinfo>

</xsd:annotation>

<xsd:complexType>

<xsd:simpleContent>

<xsd:extension base="xsd:string">

<xsd:attribute name="name" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

4db9db705f1911ddc2d000065bb3316c

</xsd:appinfo>

</xsd:annotation>

</xsd:attribute>

<xsd:attribute name="value" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

4db9db715f1911dd905900065bb3316c

</xsd:appinfo>

</xsd:annotation>

</xsd:attribute>

</xsd:extension>

</xsd:simpleContent>

</xsd:complexType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

Former Member
0 Kudos

Hi,

This is the XSD file, after create the Data structure you select the XSD tab in IR then it automatically generates the XSD file.

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:tmo:pi:test" targetNamespace="urn:tmo:pi:test">

<xsd:complexType name="a_dt">

<xsd:sequence>

<xsd:element name="name" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

8bae4ce05f1911ddb71900065b7eae37

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="age" type="xsd:integer">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

8bb15a205f1911ddc59000065b7eae37

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="email" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

8bb15a215f1911ddb2c000065b7eae37

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="phone" type="xsd:integer">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

8bb15a225f1911ddc47e00065b7eae37

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

Former Member
0 Kudos

So do i have to create Field element with attributes at the same level as ROW or at the sublevel as other elements. And do i have to create Field element with attributes before each element. If poddible can you show me step by step for my structure.

Thank you

Former Member
0 Kudos

Hi,

First time after give the data type name, we can select the sub element, next time onwords we can select the insert element.

I mention the above how to do step by step, follow that.

former_member193376
Active Contributor
0 Kudos

Hi

1)Right click on Data types and click on new

2)Give a name and say create

3)click on INsert element and give your root or parent node.

4)create your child nodes at another sublevel.

By default the nodes do not contain anything unless mapped.

Thanks

Saiyog

update thread if any doubts

Edited by: Saiyog Gonsalves on Jul 31, 2008 5:40 PM