I have fixed the issue with select statement and its working perfectly I havent used the LASTMOVE or Reference method to read XML elements and attributes
Code:
SET OutputRoot.XMLNSC.root.row[rowCnt] = THE (SELECT THE(SELECT S.*:Property.*:NameValue AS TyrePatternCd FROM T.*:Specification[] AS S
WHERE S.Property.NameValue.(XMLNSC.Attribute)Name='PATTERN' AND S.(XMLNSC.Attribute)Type = 'PHYSICAL') AS product_Info
FROM itemMaster.*:ItemMasterHeader[] AS T );
I changed to
Code:
SET OutputRoot.XMLNSC.root.row[rowCnt].product_Info .TyrePatternCd = THE (SELECT ITEM THE(SELECT ITEM S.*:Property.*:NameValue FROM T.*:Specification[] AS S
WHERE S.Property.NameValue.(XMLNSC.Attribute)Name='PATTERN' AND S.(XMLNSC.Attribute)Type = 'PHYSICAL')
FROM itemMaster.*:ItemMasterHeader[] AS T );
the above change solved my value NULL problem. Now even if the value is null the tree will be same like before with tag as NULL.
I added one more line after that
Code:
SET OutputRoot.XMLNSC.root.row[rowCnt].product_Info .TyrePatternCd.(XMLNSC.Attribute)= NULL
The above code is making the Attribute as NULL since it was fetching the Attribute name also with select query in output XML structure like below
Code:
<root>
<product_Info>
<TyrePatternCd Name ='PATTERN' >value</TyrePatternCd >
</product_Info>
</root>
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