Author |
Message
|
ghoshly |
Posted: Fri Dec 12, 2014 2:06 pm Post subject: Difference between CREATE LASTCHILD and SET statements |
|
|
Partisan
Joined: 10 Jan 2008 Posts: 333
|
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 |
|
 |
kimbert |
Posted: Sat Dec 13, 2014 4:34 am Post subject: |
|
|
 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 |
|
 |
fjb_saper |
Posted: Sat Dec 13, 2014 5:48 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 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 |
|
 |
maurito |
Posted: Sun Dec 14, 2014 2:22 am Post subject: |
|
|
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 |
|
 |
fjb_saper |
Posted: Sun Dec 14, 2014 5:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 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 |
|
 |
maurito |
Posted: Sun Dec 14, 2014 6:37 am Post subject: |
|
|
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 |
|
 |
fjb_saper |
Posted: Sun Dec 14, 2014 8:26 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 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 |
|
 |
maurito |
Posted: Sun Dec 14, 2014 9:22 am Post subject: |
|
|
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 |
|
 |
rekarm01 |
Posted: Sun Dec 14, 2014 11:11 am Post subject: Re: Difference between CREATE LASTCHILD and SET statements |
|
|
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 |
|
 |
kimbert |
Posted: Sun Dec 14, 2014 11:36 am Post subject: |
|
|
 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 |
|
 |
fjb_saper |
Posted: Sun Dec 14, 2014 11:41 am Post subject: Re: Difference between CREATE LASTCHILD and SET statements |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 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 |
|
 |
maurito |
Posted: Sun Dec 14, 2014 9:11 pm Post subject: Re: Difference between CREATE LASTCHILD and SET statements |
|
|
Partisan
Joined: 17 Apr 2014 Posts: 358
|
|
Back to top |
|
 |
rekarm01 |
Posted: Mon Dec 15, 2014 3:42 am Post subject: Re: Difference between CREATE LASTCHILD and SET statements |
|
|
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 |
|
 |
ghoshly |
Posted: Mon Dec 15, 2014 11:13 am Post subject: Lack of access |
|
|
Partisan
Joined: 10 Jan 2008 Posts: 333
|
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 |
|
 |
rekarm01 |
Posted: Mon Dec 15, 2014 12:01 pm Post subject: Re: Lack of access |
|
|
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 |
|
 |
|