XML
Posted: Sat Jan 27, 2007 3:11 am
I am creating a Datastage job to create a XML using XML plugin.
In my XML there are some complex nested fields can come 0-n times in the XML.
My way of doing this job is as follows:
1. I had created different jobs for getting the values for each complex entities.
2. In the 2nd job I am adding the output came from job1 in the nested chunk. and in 3rd job adding the output came from the 2nd job in the nested chunk and same proces continued till the last job.
3. All these jobs I had put in a sequence.
4. Running the sequence gives me the complete XML.
The final Material XML created is not in the correct format. The node tags are more then once.
Please suggest how this can be rectified so that the proper XML is generated.
The generated XML is like this. As u can see there are multiple node tag generated.
*************************************************************
<?xml version="1.0" encoding="UTF-8"?>
<Material>
<?xml version="1.0" encoding="UTF-8"?>
<Material>
<?xml version="1.0" encoding="UTF-8"?>
<Material>
<?xml version="1.0" encoding="UTF-8"?>
<Material>
<?xml version="1.0" encoding="UTF-8"?>
<Material>
<MateriaNumber>
0004860
</MateriaNumber>
<MaterialType>
ZPRT
</MaterialType>
<Division>
44
</Division>
<IndustrySector>
M
</IndustrySector>
<BaseUnitofMeasure>
ST
</BaseUnitofMeasure>
<MaterialGroup>
000
</MaterialGroup>
<ProductHierarchy>
0300300026
</ProductHierarchy>
<NetWeight>
0
</NetWeight>
<GrossWeight>
0
</GrossWeight>
<UnitOfWeight>
KG
</UnitOfWeight>
<DocumentNumber>
</DocumentNumber>
<DocumentType>
MIG
</DocumentType>
<TransportationGroup>
STD
</TransportationGroup>
<LogicalDeletionFlag>
</LogicalDeletionFlag>
<DocumentChangeNumber>
000519
</DocumentChangeNumber>
</Material>
<DescriptionDataList>
<DescriptionData>
<MaterialDescription>
MS WIN NT SVER V4.0 W/5 CLIENT
</MaterialDescription>
<LanguageKey>
F
</LanguageKey>
</DescriptionData>
<DescriptionData>
<MaterialDescription>
MS WIN NT SVER V4.0 W/5 CLIENT
</MaterialDescription>
<LanguageKey>
E
</LanguageKey>
</DescriptionData>
</DescriptionDataList>
</Material>
<PlantDataList>
<PlantData>
<Plant>
1011
</Plant>
<ProfitCenter>
</ProfitCenter>
<AvailabilityCheck>
ZV
</AvailabilityCheck>
<LoadingGroup>
</LoadingGroup>
<CommodityCode>
CLEN
</CommodityCode>
<ExportRegulationCode>
DUMM
</ExportRegulationCode>
<NegativeStocksAtPlant>
N
</NegativeStocksAtPlant>
<SerialNumberProfile>
X
</SerialNumberProfile>
</PlantData>
</PlantDataList>
</Material>
<AlternativeUnitOfMeasureList>
<AlternativeUnitOfMeasure>
<UnitOfMeasure>
ST
</UnitOfMeasure>
<DenominatorForConversion>
1
</DenominatorForConversion>
<NumeratorForConversion>
1
</NumeratorForConversion>
</AlternativeUnitOfMeasure>
</AlternativeUnitOfMeasureList>
</Material>
<ClassificationDataList>
<ClassificationData>
<ObjectTableName/>
<ObjectKey>
0004860
</ObjectKey>
<ClassType>
001
</ClassType>
<ObjectClassIndicator>
M
</ObjectClassIndicator>
<ObjectClassAllocationList>
<ObjectClassAllocation>
<ClassNumber>
MM_FIELDS
</ClassNumber>
</ObjectClassAllocation>
</ObjectClassAllocationList>
<CharacteristicValuesList>
<CharacteristicValues>
<CharacteristicName>
O
</CharacteristicName>
<CharacteristicValue>
X
</CharacteristicValue>
</CharacteristicValues>
</CharacteristicValuesList>
</ClassificationData>
<ClassificationData>
<ObjectTableName/>
<ObjectKey>
0004860
</ObjectKey>
<ClassType>
001
</ClassType>
<ObjectClassIndicator>
R
</ObjectClassIndicator>
<ObjectClassAllocationList>
<ObjectClassAllocation>
<ClassNumber>
MM_FIELDS
</ClassNumber>
</ObjectClassAllocation>
</ObjectClassAllocationList>
<CharacteristicValuesList>
<CharacteristicValues>
<CharacteristicName>
O
</CharacteristicName>
<CharacteristicValue>
YES
</CharacteristicValue>
</CharacteristicValues>
</CharacteristicValuesList>
</ClassificationData>
<ClassificationData>
<ObjectTableName/>
<ObjectKey>
0004860
</ObjectKey>
<ClassType>
001
</ClassType>
<ObjectClassIndicator>
M
</ObjectClassIndicator>
<ObjectClassAllocationList>
<ObjectClassAllocation>
<ClassNumber>
MG_COMMON
</ClassNumber>
</ObjectClassAllocation>
</ObjectClassAllocationList>
<CharacteristicValuesList>
<CharacteristicValues>
<CharacteristicName>
O
</CharacteristicName>
<CharacteristicValue>
HW
</CharacteristicValue>
</CharacteristicValues>
</CharacteristicValuesList>
</ClassificationData>
</ClassificationDataList>
</Material>
*************************************************************
[/img]
In my XML there are some complex nested fields can come 0-n times in the XML.
My way of doing this job is as follows:
1. I had created different jobs for getting the values for each complex entities.
2. In the 2nd job I am adding the output came from job1 in the nested chunk. and in 3rd job adding the output came from the 2nd job in the nested chunk and same proces continued till the last job.
3. All these jobs I had put in a sequence.
4. Running the sequence gives me the complete XML.
The final Material XML created is not in the correct format. The node tags are more then once.
Please suggest how this can be rectified so that the proper XML is generated.
The generated XML is like this. As u can see there are multiple node tag generated.
*************************************************************
<?xml version="1.0" encoding="UTF-8"?>
<Material>
<?xml version="1.0" encoding="UTF-8"?>
<Material>
<?xml version="1.0" encoding="UTF-8"?>
<Material>
<?xml version="1.0" encoding="UTF-8"?>
<Material>
<?xml version="1.0" encoding="UTF-8"?>
<Material>
<MateriaNumber>
0004860
</MateriaNumber>
<MaterialType>
ZPRT
</MaterialType>
<Division>
44
</Division>
<IndustrySector>
M
</IndustrySector>
<BaseUnitofMeasure>
ST
</BaseUnitofMeasure>
<MaterialGroup>
000
</MaterialGroup>
<ProductHierarchy>
0300300026
</ProductHierarchy>
<NetWeight>
0
</NetWeight>
<GrossWeight>
0
</GrossWeight>
<UnitOfWeight>
KG
</UnitOfWeight>
<DocumentNumber>
</DocumentNumber>
<DocumentType>
MIG
</DocumentType>
<TransportationGroup>
STD
</TransportationGroup>
<LogicalDeletionFlag>
</LogicalDeletionFlag>
<DocumentChangeNumber>
000519
</DocumentChangeNumber>
</Material>
<DescriptionDataList>
<DescriptionData>
<MaterialDescription>
MS WIN NT SVER V4.0 W/5 CLIENT
</MaterialDescription>
<LanguageKey>
F
</LanguageKey>
</DescriptionData>
<DescriptionData>
<MaterialDescription>
MS WIN NT SVER V4.0 W/5 CLIENT
</MaterialDescription>
<LanguageKey>
E
</LanguageKey>
</DescriptionData>
</DescriptionDataList>
</Material>
<PlantDataList>
<PlantData>
<Plant>
1011
</Plant>
<ProfitCenter>
</ProfitCenter>
<AvailabilityCheck>
ZV
</AvailabilityCheck>
<LoadingGroup>
</LoadingGroup>
<CommodityCode>
CLEN
</CommodityCode>
<ExportRegulationCode>
DUMM
</ExportRegulationCode>
<NegativeStocksAtPlant>
N
</NegativeStocksAtPlant>
<SerialNumberProfile>
X
</SerialNumberProfile>
</PlantData>
</PlantDataList>
</Material>
<AlternativeUnitOfMeasureList>
<AlternativeUnitOfMeasure>
<UnitOfMeasure>
ST
</UnitOfMeasure>
<DenominatorForConversion>
1
</DenominatorForConversion>
<NumeratorForConversion>
1
</NumeratorForConversion>
</AlternativeUnitOfMeasure>
</AlternativeUnitOfMeasureList>
</Material>
<ClassificationDataList>
<ClassificationData>
<ObjectTableName/>
<ObjectKey>
0004860
</ObjectKey>
<ClassType>
001
</ClassType>
<ObjectClassIndicator>
M
</ObjectClassIndicator>
<ObjectClassAllocationList>
<ObjectClassAllocation>
<ClassNumber>
MM_FIELDS
</ClassNumber>
</ObjectClassAllocation>
</ObjectClassAllocationList>
<CharacteristicValuesList>
<CharacteristicValues>
<CharacteristicName>
O
</CharacteristicName>
<CharacteristicValue>
X
</CharacteristicValue>
</CharacteristicValues>
</CharacteristicValuesList>
</ClassificationData>
<ClassificationData>
<ObjectTableName/>
<ObjectKey>
0004860
</ObjectKey>
<ClassType>
001
</ClassType>
<ObjectClassIndicator>
R
</ObjectClassIndicator>
<ObjectClassAllocationList>
<ObjectClassAllocation>
<ClassNumber>
MM_FIELDS
</ClassNumber>
</ObjectClassAllocation>
</ObjectClassAllocationList>
<CharacteristicValuesList>
<CharacteristicValues>
<CharacteristicName>
O
</CharacteristicName>
<CharacteristicValue>
YES
</CharacteristicValue>
</CharacteristicValues>
</CharacteristicValuesList>
</ClassificationData>
<ClassificationData>
<ObjectTableName/>
<ObjectKey>
0004860
</ObjectKey>
<ClassType>
001
</ClassType>
<ObjectClassIndicator>
M
</ObjectClassIndicator>
<ObjectClassAllocationList>
<ObjectClassAllocation>
<ClassNumber>
MG_COMMON
</ClassNumber>
</ObjectClassAllocation>
</ObjectClassAllocationList>
<CharacteristicValuesList>
<CharacteristicValues>
<CharacteristicName>
O
</CharacteristicName>
<CharacteristicValue>
HW
</CharacteristicValue>
</CharacteristicValues>
</CharacteristicValuesList>
</ClassificationData>
</ClassificationDataList>
</Material>
*************************************************************
[/img]