Page 1 of 1

XML Design suggestion

Posted: Fri Jan 14, 2011 2:16 am
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

Posted: Sun Jan 16, 2011 12:31 pm
by shawn.k
I would suggest you to look at Duke's Xml Best Practices document.

Posted: Tue Aug 23, 2011 12:22 pm
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