ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Unable to access child elements in XML with repetitive tags

Post new topic  Reply to topic
 Unable to access child elements in XML with repetitive tags « View previous topic :: View next topic » 
Author Message
Muthukrishnan
PostPosted: Thu Jun 13, 2013 12:39 am    Post subject: Unable to access child elements in XML with repetitive tags Reply with quote

Apprentice

Joined: 16 Feb 2013
Posts: 48

Hi,

I am trying to retrieve one of the child elements in the XML. The requirement is to check for an element for a particular child with 'Attribute' as "Short Description". Here I need to fetch the value '205' from the below XML input. But everytime I am getting only '203'. Please help.

Below is the input xml tree

Code:


<SyncItemMaster>
  <ApplicationArea>
    <DataArea>
     <ItemMaster>
      <ItemMasterHeader>
       <Description type="Description">203</Description>
       <Description type="Short Description">204</Description>
       <Description type="Long Description">205</Description>
       <OwnerParty category="CUSTOMER">
          <Location>
            <UserArea>
              <StartDate>2009-01-01</StartDate>
              <EndDate>2011-09-15</EndDate>
            </UserArea>
          </Location>
        </OwnerParty>
        <OwnerParty>
          <Name>001</Name>
          <Location Type="COUNTRY"/>
        </OwnerParty> 
    </ItemMasterHeader>
   </ItemMaster>
   </DataArea> 
  </ApplicationArea>
</SyncItemMaster>


 



I tried using the below esql



Code:


SET OutputRoot.XMLNSC.root.row[rowCnt].Product_Info.description = THE (SELECT ITEM THE(SELECT ITEM itemMaster.*:ItemMasterHeader.*:Description FROM T.*:Description[] AS C WHERE C.(XMLNSC.Attribute)type = 'Short Description') FROM itemMaster.*:ItemMasterHeader[] AS T );

Back to top
View user's profile Send private message Send e-mail
cociu_2012
PostPosted: Thu Jun 13, 2013 12:53 am    Post subject: Re: Unable to access child elements in XML with repetitive t Reply with quote

Acolyte

Joined: 06 Jan 2012
Posts: 72

Muthukrishnan wrote:


Code:


SET OutputRoot.XMLNSC.root.row[rowCnt].Product_Info.description = THE (SELECT ITEM THE(SELECT ITEM itemMaster.*:ItemMasterHeader.*:Description FROM T.*:Description[] AS C WHERE C.(XMLNSC.Attribute)type = 'Short Description') FROM itemMaster.*:ItemMasterHeader[] AS T );



You have posted a very similar question on a diferent thread. You also got a very nicely reworked query. If you having trouble understanding queries, try clasic reference parsing. While lastmove and next sibling.
Back to top
View user's profile Send private message
Muthukrishnan
PostPosted: Thu Jun 13, 2013 5:47 pm    Post subject: Re: Unable to access child elements in XML with repetitive t Reply with quote

Apprentice

Joined: 16 Feb 2013
Posts: 48

Yes. I tried myself again now and it worked. Please mark this as closed.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Unable to access child elements in XML with repetitive tags
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.