XML Design suggestion

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
ArunaDas_Maharana
Participant
Posts: 42
Joined: Thu Dec 11, 2008 11:07 am

XML Design suggestion

Post by ArunaDas_Maharana »

hi,

My source and target is xml, i need to do some translation and transformation to this input xml.

earlier i had only translation so i was not parsing my xml achiveing it with xslt.

Now i need to look up database to fech some value. Problem is i have repeating elements at same level.

Please suggest how should i go abt it...
xml:

Code: Select all

	<Payload>
	<Detail>
			<Order>
				<PurCd>Delete</PurCd>
				<POBldTypCd></POBldTypCd>				
				<PointDesc>
                                 	<PointCtryCd>CN</PointCtryCd>
					<PointCityNm>Asia</PointCityNm>
				</PointDesc>	
				<FactoryInfo>
					<VndNbr>11234</VndNbr>
					<VndNm>ABC</VndNm>
					<VndAddrLn1Txt></VndAddrLn1Txt>
				</FactoryInfo>
				<ManufactureInfo>
					<VndNbr>76890</VndNbr>
					<VndNm>ABC</VndNm>
					<VndAddrLn1Txt></VndAddrLn1Txt>
				</ManufactureInfo>
				<ExporterInfo>
					<VndNbr>98760</VndNbr>
					<VndNm>ABC</VndNm>
					<VndAddrLn1Txt></VndAddrLn1Txt>
				</ExporterInfo>
				<ShippingInfo>
					<ShpModeCd>Ocean</ShpModeCd>
					<OrigCtryCd>CN</OrigCtryCd>
			            </ShippingInfo>
				<LegalText>
					<DsctTxt>.</DsctTxt>
				</LegalText>
				<ConsolidatorList>
					<CnclNbr>2098</CnclNbr>
					<CnclNm>EUH</CnclNm>
				</ConsolidatorList>
				<ConsolidatorList>
					<CnclNbr>702</CnclNbr>
					<CnclNm>UPm</CnclNm>
				</ConsolidatorList>
				<Item>
					<ItmStyNbr>895</ItmStyNbr>
					<ItmStyDesc>SANDAL</ItmStyDesc>
									
				</Item>
				<Item>
					<ItmStyNbr>865</ItmStyNbr>
					<ItmStyDesc>SANDAL</ItmStyDesc>
					<SkuNbr>161</SkuNbr>
				</Item>
				<Item>
					<SkuNbr>1110</SkuNbr>
					<Qty>50</Qty>
					
					<Subline>
						<SlnItmStyNbr>865</SlnItmStyNbr>
						<SlnUOMCd>EA</SlnUOMCd>
						</SlnUnitOfMeasure>
						<SlnSzDesc>SMALL</SlnSzDesc>
					</Subline>
					<Subline>
						<SlnItmStyNbr>807</SlnItmStyNbr>
						<SlnSzDesc>SMALL</SlnSzDesc>
					</Subline>
				</Item>
			</Order>
		</Detail>
	</Payload>
consolidator and item repeating a same level
Thanks,
Aruna
shawn.k
Premium Member
Premium Member
Posts: 7
Joined: Wed Oct 06, 2010 10:47 am

Post by shawn.k »

I would suggest you to look at Duke's Xml Best Practices document.
ArunaDas_Maharana
Participant
Posts: 42
Joined: Thu Dec 11, 2008 11:07 am

Post by ArunaDas_Maharana »

managed in current situation with transformer as filter's and some bussiness logic.

Using xslt for the translation to avoid parsing of the xml and trying to keep the adapter thin layer.

Thanks,
Aruna
Post Reply