Page 1 of 1

XML

Posted: Sat Jan 27, 2007 3:11 am
by saini
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]

Posted: Sat Jan 27, 2007 7:57 am
by chulett
Sorry, my xml techno-mumbo-jumbo is a little weak. Node tags? Assuming you mean the fact that you have multiple occurrences of these:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?> 
  <Material> 
All of your jobs except for the final job should have the 'Generate XML Chunk' option enabled... or are you already doing that and still having the issue? :?

If that's the case we may have to wait for Ernie to pay us a little visit. Or get a better explanation of how you are building, storing and combining these intermediate pieces of xml.