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 » Issue with Delete Field Statement with environment tree

Post new topic  Reply to topic
 Issue with Delete Field Statement with environment tree « View previous topic :: View next topic » 
Author Message
vickykarumbhu
PostPosted: Mon Aug 10, 2015 6:31 am    Post subject: Issue with Delete Field Statement with environment tree Reply with quote

Newbie

Joined: 08 Jun 2015
Posts: 6

Code:
<parent>
   <child1>aaa</child1>
   <child2>bbb</child2>
   <child3>ccc</child3>
   <child4>
      <one>one</one>
   </child4>
   <child4>
      <one>one</one>
   </child4>
</parent>


Hi I have saved the above response in Environment.Variables.Res = OutputRoot; I need to delete the child4 first occurance from the Environment Tree structure. I have tried this two statements
1) DELETE NEXTSIBLING OF Environment.Variables.Res.child3
2) DELETE FEILD OF Environment.Variables.Res.child3[1]

But the tree remains the same. Could you please guide me on this.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Aug 10, 2015 6:50 am    Post subject: Re: Issue with Delete Field Statement with environment tree Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

vickykarumbhu wrote:
I have tried this two statements
1) DELETE NEXTSIBLING OF Environment.Variables.Res.child3
2) DELETE FEILD OF Environment.Variables.Res.child3[1]


I don't see anything called "Res" in that structure.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Aug 10, 2015 6:59 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Why are you trying to use child3 to access it's sibling child4?

both <some tree path>.child3 and <some tree path>.child3[1] address the first occurrence under <some tree path> of child3.

Also, you do not show the code where you have ensured that the XML data you have copied to the Environment tree will in fact remain XML data.

Vitor wrote:
I don't see anything called "Res" in that structure.

vickykarumbhu wrote:
Environment.Variables.Res = OutputRoot;

Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Aug 10, 2015 7:19 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqjeff wrote:

Vitor wrote:
I don't see anything called "Res" in that structure.

vickykarumbhu wrote:
Environment.Variables.Res = OutputRoot;





Still, it does explain why the code doesn't work.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Aug 10, 2015 7:27 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Vitor wrote:
Still, it does explain why the code doesn't work.

Depending on the contents of OutputRoot at the time of execution...
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Aug 10, 2015 7:40 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqjeff wrote:
Vitor wrote:
Still, it does explain why the code doesn't work.

Depending on the contents of OutputRoot at the time of execution...


Exactly so sir; exactly. My eye is drawn both to the OP's description of the document and the on my desk......
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
ganesh
PostPosted: Mon Aug 10, 2015 9:01 am    Post subject: Re: Issue with Delete Field Statement with environment tree Reply with quote

Master

Joined: 18 Jul 2010
Posts: 294

vickykarumbhu wrote:


Environment.Variables.Res = OutputRoot;


Assign a parser to your environment tree.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Aug 10, 2015 9:33 am    Post subject: Re: Issue with Delete Field Statement with environment tree Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

ganesh wrote:
vickykarumbhu wrote:


Environment.Variables.Res = OutputRoot;


Assign a parser to your environment tree.


Solid advice, but uncertain that's going to help here
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
ganesh
PostPosted: Mon Aug 10, 2015 10:12 am    Post subject: Re: Issue with Delete Field Statement with environment tree Reply with quote

Master

Joined: 18 Jul 2010
Posts: 294

Vitor wrote:


Solid advice, but uncertain that's going to help here


True.



Quote:
I need to delete the child4 first occurance


Figure out the correct path to first occurrence of child4.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Aug 10, 2015 10:14 am    Post subject: Re: Issue with Delete Field Statement with environment tree Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

vickykarumbhu wrote:


Environment.Variables.Res = OutputRoot;


So this means that at a minimum we should see something like (potentially)
Code:
DELETE FIELD Environment.Variables.Res.XMLNSC.parent.child4[1]

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
inMo
PostPosted: Mon Aug 10, 2015 10:30 am    Post subject: Reply with quote

Master

Joined: 27 Jun 2009
Posts: 216
Location: NY

I'm assuming you are assuming that the OP assumed it was not necessary to state that OutputRoot has been parsed by XMLNSC prior to assignment to Env.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Aug 10, 2015 10:41 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

inMo wrote:
I'm assuming you are assuming that the OP assumed it was not necessary to state that OutputRoot has been parsed by XMLNSC prior to assignment to Env.


That's not a bad assumption.

I think Vitor and I are wondering whether anything was assigned to OutputRoot before it was copied to the Environment tree.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Aug 10, 2015 11:34 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqjeff wrote:
inMo wrote:
I'm assuming you are assuming that the OP assumed it was not necessary to state that OutputRoot has been parsed by XMLNSC prior to assignment to Env.


That's not a bad assumption.

I think Vitor and I are wondering whether anything was assigned to OutputRoot before it was copied to the Environment tree.


Or if that parent tag got copied or not.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Issue with Delete Field Statement with environment tree
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.