How to work with XML out put stage? Please explain step by
step? i need to generate XML file using Table data. Given
is the .XSD file. Please help?

Answers were Sorted based on User's Feedback



How to work with XML out put stage? Please explain step by step? i need to generate XML file using..

Answer / srinivas

To load the data into XML file first you need import the xml metadata as you expected structure by using the .xsd file or .xml file.
While importing the structure you must careful about the structure and if any value is repeating then define as a key column.

For example in above xml structre child value is diffrent and parents are same for the three rows like below :

CHANGE NAME DATASOURCE ACTION VALUE
ADD MY GSDBDatabase READ 2011
ADD MY GSDBDatabase READ 2012
ADD MY GSDBDatabase READ 2013

in above table VALUE column is unique and other values are same Note: this is taken from XML definition on question i took only 5 columns because of space issue.

In this situation you should define VALUE column as key column in XML output stage.

Job structure should like below:

SourceStage ---->transformer ----> XML output Stage.

Note:Before loading data into XML file you must sort the data other wise order will be change, what ever order you have in source the same order will load in to XML file So these words are mindful.

If you face any problem please let me knoow

Is This Answer Correct ?    1 Yes 0 No

How to work with XML out put stage? Please explain step by step? i need to generate XML file using..

Answer / muktimca

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

targetNamespace="urn:ford/Application/ImportAuthorization/v1
.0"
xmlns:ie="urn:ford/Application/ImportAuthorization/v1.0"
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:element name="Provisioning"
type="ie:ProvisioningType" />


<xs:complexType name="ProvisioningType">
<xs:annotation>
<xs:documentation>
Root node where “Provisioning” is the name
of the app team.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Entity"
type="ie:EntityObjectType"
minOccurs="1" maxOccurs="1" />
</xs:sequence>

</xs:complexType>


<xs:complexType name="EntityObjectType">
<xs:annotation>
<xs:documentation>
Type of entity either application or
business function.
</xs:documentation>
</xs:annotation>
<xs:sequence>

<xs:element name="EntityName" type="xs:string"
minOccurs="1"
maxOccurs="1" />
<xs:element name="EntityType"
type="ie:EntityTypeType" minOccurs="1"
maxOccurs="1" />
<xs:element name="User" type="ie:UserType"
minOccurs="1"
maxOccurs="unbounded" />
</xs:sequence>

</xs:complexType>


<xs:complexType name="UserType">

<xs:annotation>
<xs:documentation>
User Node, contains 1..n roles for a
user .
</xs:documentation>
</xs:annotation>

<xs:sequence>

<xs:element name="UserName" type="xs:string"
minOccurs="1" maxOccurs="1" />
<xs:element name="Role" type="ie:RoleType"
minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>

</xs:complexType>


<xs:complexType name="RoleType">

<xs:annotation>
<xs:documentation>
Role Node, contains all info for a
role
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="RoleName" type="xs:string"
minOccurs="1"
maxOccurs="1" />
<xs:element name="AttributeFunction"
type="ie:AttributeObjectType" minOccurs="1"
maxOccurs="unbounded" />

</xs:sequence>

</xs:complexType>

<xs:complexType name="AttributeObjectType">

<xs:annotation>
<xs:documentation>
AttributeObject, contains all info for a
role
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="AttributeType"
type="ie:AttributeObjectTypeType" minOccurs="1"
maxOccurs="1" />
<xs:element name="Attribute"
type="ie:AttributeTypeType" minOccurs="1"
maxOccurs="unbounded" />

</xs:sequence>

</xs:complexType>


<xs:complexType name="AttributeTypeType">
<xs:annotation>
<xs:documentation>
Attribute Node, contains all info for an
attribute.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="ChangeType"
type="ie:ChangeTypeType" minOccurs="1"
maxOccurs="1" />
<xs:element name="Name" type="xs:string"
minOccurs="1" maxOccurs="1"/>
<xs:element name="DataSource" type="xs:string"
minOccurs="1" maxOccurs="1"/>
<xs:element name="Action" type="ie:ActionType"
minOccurs="1" maxOccurs="1"/>
<xs:element name="Value" type="xs:string"
minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>


</xs:complexType>

<xs:simpleType name="AttributeObjectTypeType">
<xs:restriction base="xs:string">
<xs:enumeration value="BASE" />
<xs:enumeration value="FILTER" />
<xs:enumeration value="COMPOSITE" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="EntityTypeType">
<xs:restriction base="xs:string">
<xs:enumeration value="BF" />
<xs:enumeration value="APP" />
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="ActionType">
<xs:restriction base="xs:string">
<xs:enumeration value="READ" />
<xs:enumeration value="WRITE" />
</xs:restriction>
</xs:simpleType>


<xs:simpleType name="ChangeTypeType">
<xs:restriction base="xs:string">
<xs:enumeration value="ADD" />
<xs:enumeration value="DELETE" />
</xs:restriction>
</xs:simpleType>

</xs:schema>

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More Data Stage Interview Questions

how to design the change capture stage in(data stage parallel jobs) type 2

2 Answers   IBM,


I have a scenario like Deptno=10---->First record and last record Deptno=20---->First record and last record Deptno=30---->First record and last record I want those first and last records from each department in a single target. How to do this in DataStage, any one can assist me. Thanks in advance.

8 Answers  


1)Source file contains one record, I want 100 records in target file.

3 Answers  


1)What is ur project architecture ? 2)how to move project from developement to uat? 3)What is the difference between datastage 6,7.1 and datasttage 7.5? 4).How to do error handling in datastage? 5)3.Whta is unit testing, system testing and integration testing? 6)What is the Exact difference between BASIC Transformer and NORMAL Transformer?When we will go for BASIC Or NORMAL Transformer 7)why we use third party tools in datastage? 8)What is the purpose of Debugging stages? In real time Where we will use?

6 Answers   CTS, HCL, IBM, Wipro,


what is the difference between lookup stage reject link and merge stage reject link in datastage Parallel jobs? interm of output in Merge Reject link and Look Up Reject link ?

4 Answers   HCL,






how to identifie,is it innerjoin,leftouter join in lookup?

2 Answers   Hexaware,


In which situations we can use normal and sparse lookup stages

4 Answers   IBM,


Different ways a project can be moved to production ?...example ….export-import and Version control.

0 Answers  


Tell me the syntax of Configuration file?

1 Answers  


why do u need the IOS upgradation in a FC switch

0 Answers   IBM,


what is repositery?

0 Answers   IBM,


can any one tell me how to install datastage 8.1 in windows xp with wizard

2 Answers  


Categories