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 » Difference between CREATE LASTCHILD and SET statements

Post new topic  Reply to topic Goto page 1, 2  Next
 Difference between CREATE LASTCHILD and SET statements « View previous topic :: View next topic » 
Author Message
ghoshly
PostPosted: Fri Dec 12, 2014 2:06 pm    Post subject: Difference between CREATE LASTCHILD and SET statements Reply with quote

Partisan

Joined: 10 Jan 2008
Posts: 325

Hello,

Could you please help me to differentiate between CREATE LASTCHILD and SET statements when both of them are trying to create similar object.
Code:
      -- Mentioned below line of code generates XML parsing error in output, Need further analysis.
--      CREATE LASTCHILD OF OutputRoot AS RF_ErrorDetails DOMAIN 'XMLNSC' NAME 'CombinedErrorDetails';


I am getting ParserException with the details as
Quote:
BIP5016E: The element with name ''ExceptionDetails'' and field type ''folderType'' is not valid as the child of Root.XML or Root.XMLNSC.
Each child of Root.XMLNSC must represent a valid XML construct for the top level of an XML document. The only field types that are valid in this position are XMLNSC.Comment or XMLNSC.ProcessingInstruction.


However mentioned below code works without any issue. I am just trying to capture the exception details in a queue.

Code:
      SET OutputRoot.XMLNSC.CombinedErrorDetails = '';
      MOVE RF_ErrorDetails TO OutputRoot.XMLNSC.CombinedErrorDetails;

WMB 8.0.0.4 in AIX 7.1 environment.
Back to top
View user's profile Send private message
kimbert
PostPosted: Sat Dec 13, 2014 4:34 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

The best way for you to see the difference is to put in a Trace node and compare the message trees produced by those two statements. I'm surprised that you haven't done that already.

Feel free to post again if you cannot work out the answer from the Trace node outputs.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Dec 13, 2014 5:48 pm    Post subject: Reply with quote

Grand High Poobah

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

Hint: To do what your second line does your first line should in fact be 2 lines...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
maurito
PostPosted: Sun Dec 14, 2014 2:22 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

fjb_saper wrote:
Hint: To do what your second line does your first line should in fact be 2 lines...


not necessarily.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Dec 14, 2014 5:23 am    Post subject: Reply with quote

Grand High Poobah

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

maurito wrote:
fjb_saper wrote:
Hint: To do what your second line does your first line should in fact be 2 lines...


not necessarily.

Now I am baffled... can you explain?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
maurito
PostPosted: Sun Dec 14, 2014 6:37 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

fjb_saper wrote:
maurito wrote:
fjb_saper wrote:
Hint: To do what your second line does your first line should in fact be 2 lines...


not necessarily.

Now I am baffled... can you explain?


The OP had it nearly right in the first line, using the AS keyword to assign it to a REFERENCE, so no need for a MOVE after.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Dec 14, 2014 8:26 am    Post subject: Reply with quote

Grand High Poobah

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

maurito wrote:

The OP had it nearly right in the first line, using the AS keyword to assign it to a REFERENCE, so no need for a MOVE after.


Ah.... but I wasn't even considering the reference. Just the result of the first line which created a field... Like in CREATE LASTCHILD vs SET...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
maurito
PostPosted: Sun Dec 14, 2014 9:22 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

fjb_saper wrote:
maurito wrote:

The OP had it nearly right in the first line, using the AS keyword to assign it to a REFERENCE, so no need for a MOVE after.


Ah.... but I wasn't even considering the reference. Just the result of the first line which created a field... Like in CREATE LASTCHILD vs SET...


I am baffled now. The first line is a CREATE LASTCHILD. It contains an AS clause, so could you expand on why two lines of code ?
Back to top
View user's profile Send private message
rekarm01
PostPosted: Sun Dec 14, 2014 11:11 am    Post subject: Re: Difference between CREATE LASTCHILD and SET statements Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

kimbert wrote:
The best way for you to see the difference is to put in a Trace node and compare the message trees produced by those two statements.

Although with parser exceptions, sometimes the Trace node doesn't write out the whole message tree. That can make troubleshooting more difficult.

ghoshly wrote:
Could you please help me to differentiate between CREATE LASTCHILD and SET statements when both of them are trying to create similar object.

Code:
      -- Mentioned below line of code generates XML parsing error in output, Need further analysis.
--      CREATE LASTCHILD OF OutputRoot AS RF_ErrorDetails DOMAIN 'XMLNSC' NAME 'CombinedErrorDetails';

The last child of OutputRoot should probably not be CombinedErrorDetails; there ought to be something else in between them.

ghoshly wrote:
However mentioned below code works without any issue. I am just trying to capture the exception details in a queue.

Code:
      SET OutputRoot.XMLNSC.CombinedErrorDetails = '';
      MOVE RF_ErrorDetails TO OutputRoot.XMLNSC.CombinedErrorDetails;

Even if this code seems to work, assigning a value (even an empty string) to CombinedErrorDetails is almost certainly the wrong thing to do.

fjb_saper wrote:
Hint: To do what your second line does your first line should in fact be 2 lines...

One CREATE statement can create additional fields as needed, in order to navigate to where the target field should go.
Back to top
View user's profile Send private message
kimbert
PostPosted: Sun Dec 14, 2014 11:36 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

@rekarm01: In this particular case, I am pretty sure that a Trace node would have answered the OP's question. The error message strongly suggests that the tree building completed successfully, and the error was reported by the XMLNSC writer.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Dec 14, 2014 11:41 am    Post subject: Re: Difference between CREATE LASTCHILD and SET statements Reply with quote

Grand High Poobah

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

rekarm01 wrote:
fjb_saper wrote:
Hint: To do what your second line does your first line should in fact be 2 lines...

One CREATE statement can create additional fields as needed, in order to navigate to where the target field should go.


Sure with CREATE FIELD. What happens though when you use the

CREATE LASTCHILD OF --- NAME form? We are not talking about create lastchild of --- Parse here... and how would you write the syntax using the CREATE form ?

So If I understand you right you would have said
CREATE LASTCHILD OF OutputRoot.XMLNSC NAME xyz, even though at that point in time OutputRoot has no child named XMLNSC ???

See Reference http://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ak04950_.htm


_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
maurito
PostPosted: Sun Dec 14, 2014 9:11 pm    Post subject: Re: Difference between CREATE LASTCHILD and SET statements Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

fjb_saper wrote:
and how would you write the syntax using the CREATE form ?

The same way the OP did in his first line.
Code:
CREATE LASTCHILD OF OutputRoot AS RF_ErrorDetails DOMAIN 'XMLNSC' NAME 'CombinedErrorDetails';


See Reference http://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ak04950_.htm
Back to top
View user's profile Send private message
rekarm01
PostPosted: Mon Dec 15, 2014 3:42 am    Post subject: Re: Difference between CREATE LASTCHILD and SET statements Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

kimbert wrote:
@rekarm01: In this particular case, I am pretty sure that a Trace node would have answered the OP's question.

Yes, in this particular case, it probably would have displayed enough of the message tree to answer the OP's question.

fjb_saper wrote:
So If I understand you right you would have said
CREATE LASTCHILD OF OutputRoot.XMLNSC NAME xyz, even though at that point in time OutputRoot has no child named XMLNSC ???

Yes. If OutputRoot.XMLNSC did not already exist, then it would get created, as if with a separate "CREATE FIELD" statement, before creating xyz.
Back to top
View user's profile Send private message
ghoshly
PostPosted: Mon Dec 15, 2014 11:13 am    Post subject: Lack of access Reply with quote

Partisan

Joined: 10 Jan 2008
Posts: 325

Even if I put trace node after and trace gets creates, I do not have right (mqm) access to see the trace file in a new place I am in.

I would try to get access to the trace files; otherwise would try to get some windows box with access and check out the trace.

Though the error details is already there, I am not understanding, why parser is expecting a comment or processing instruction instead of a folder type.

SET command is trying to create the root tag, so I thought it would be a folder type only..
Back to top
View user's profile Send private message
rekarm01
PostPosted: Mon Dec 15, 2014 12:01 pm    Post subject: Re: Lack of access Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

ghoshly wrote:
Even if I put trace node after and trace gets creates, I do not have right (mqm) access to see the trace file in a new place I am in.

Trace nodes can either write to a trace file, or to the usertrace log. The usertrace log may be more useful, and accessible, but requires mqsireadlog and mqsiformatlog to generate a readable usertrace file. Also, either the toolkit, MBExplorer, or mqsichangetrace command may be useful, to change the trace level. Check the Knowledge Center for more details.

ghoshly wrote:
Though the error details is already there, I am not understanding, why parser is expecting a comment or processing instruction instead of a folder type.

Ok, here's a bigger hint: the given CREATE statement is trying to create CombinedErrorDetails as a child of OutputRoot, but the given SET statement is trying to create it as a grandchild of OutputRoot. These are not the same trees. An XML message may have any number of top-level comments and processing instructions, but at most one top-level root folder; any more than that will generate a ParserException.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Difference between CREATE LASTCHILD and SET statements
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.