Posted: Tue Nov 19, 2013 8:34 pm Post subject: Accessing attribute using Reference
Novice
Joined: 13 Aug 2013 Posts: 22
Hi,
My xml looks as below.
<root>
<os:ADDRESS>
<of:ADDRLINE index="1">Bombay</of:ADDRLINE>
<of:ADDRLINE index="2">MUMBAI</of:ADDRLINE>
<of:ADDRLINE index="3">BANG</of:ADDRLINE>
<of:ADDRLINE index="4">HYD</of:ADDRLINE>
</os:ADDRESS>
</root>
I took reference for ADDRESS and navigating one by one.I am not able to access index attribute using the reference. When i am at first place the reference value is coming as Bombay,2nd postion mumbai.
Please help me how to access the index attaribute using the reference?
Code:
DECLARE RF_InBdyAddr REFERENCE TO RF_InBdy.*:Req.*:Dta.*:SYNC_CUSTOMER_005.*:DATAAREA.*:SYNC_CUSTOMER.*:PARTNER.*:ADDRESS;
MOVE InBdyAddr Firstchild;
WHILE LASTMOVE(RF_InBdyAddr) DO
IF RF_InBdyAddr.(XMLNSC.Attribute)index = '1' THEN
SET RF_OutCstPartyMaster.Location.Address.AddressLine1 = FIELDVALUE(RF_InBdy.*:Req.*:Dta.*:SYNC_CUSTOMER_005.*:DATAAREA.*:SYNC_CUSTOMER.*:PARTNER.*:ADDRESS.*:ADDRLINE);
END IF;
MOVE RF_In_Employee NEXTSIBLING REPEAT TYPE NAME;
END WHILE;
One day the customer said: from now on you must always use references...
Try changing this
Code:
SET RF_OutCstPartyMaster.Location.Address.AddressLine1 = FIELDVALUE(RF_InBdy.*:Req.*:Dta.*:SYNC_CUSTOMER_005.*:DATAAREA.*:SYNC_CUSTOMER.*:PARTNER.*:ADDRESS.*:ADDRLINE);
to this
Code:
SET RF_OutCstPartyMaster.Location.Address.AddressLine1 = FIELDVALUE(RF_InBdyAddr);
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum