Author |
Message
|
Kumar4 |
Posted: Wed Aug 22, 2007 8:14 am Post subject: Problems With Attach Statement. |
|
|
Apprentice
Joined: 12 Aug 2007 Posts: 27
|
Hi,
I have a situration where the XML elements should be attached dynamically. I'm using LocalEnvironment to capture the elements and using ATTACH statement to attach those elements.But the Broker complains as below
BIP2332E: Err
or attaching field '(0x01000010):XMLNS' to field '(0x01000000):Data' which already has a parent.
Is there anyway that I can attach dynamic references to Output Message.?
Below is code
CREATE LASTCHILD OF OutputLocalEnvironment DOMAIN 'XMLNS' FROM InputRoot.XMLNS.Messages.Message.Data.(XML.Element)*;
DECLARE ToBeAttached REFERENCE TO OutputLocalEnvironment.*[<];
ATTACH ToBeAttached TO OutputRoot.XML.Message.Data AS FIRSTCHILD;
Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Aug 22, 2007 8:16 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You've already been told you have to detach it first.
There's really little need to create it in the LocalEnvironment first, and then move it to OutputRoot. You can just create it in OutputRoot in the first place. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
boogey |
Posted: Wed Aug 22, 2007 2:34 pm Post subject: |
|
|
Novice
Joined: 01 Jan 2007 Posts: 21
|
Do try to get the correct version of the loadable implentation library and try it again |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Aug 22, 2007 3:45 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
boogey wrote: |
Do try to get the correct version of the loadable implentation library and try it again |
That makes absolutely no sense at all. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Kumar4 |
Posted: Thu Aug 23, 2007 6:20 am Post subject: |
|
|
Apprentice
Joined: 12 Aug 2007 Posts: 27
|
Hi,
Even though, I detach and attach the dynamic refernces. seems like it is stuck at the same error,
following is the error, I still get. Is there any other way of dealing this?
BIP2340E: Err
or attaching field 'XMLNS' to field 'Data' which belongs to a message in a different group.
CREATE LASTCHILD OF InputLocalEnvironment DOMAIN 'XMLNS' FROM InputRoot.XMLNS.Messages.Message.messageData.(XML.Element)*;
DECLARE ToBeAttached REFERENCE TO InputLocalEnvironment.*[<];
DETACH ToBeAttached;
ATTACH ToBeAttached TO OutputRoot.XML.Message.Data AS LASTCHILD;
Please let me know, Could you please brief the explanation. As it helps me to understand it better.
Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Aug 23, 2007 6:26 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
DO NOT create the field in InputLocalEnvironment.
It's not mutable.
Also, why are you trying to attach an XMLNS tree to an XML domain OutputRoot?
And why would you possibly think that it would work?
Please don't use XML domain. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Kumar4 |
Posted: Thu Aug 23, 2007 10:46 am Post subject: |
|
|
Apprentice
Joined: 12 Aug 2007 Posts: 27
|
Thanks for the suggestion.
I changed the group from XML to XMLNS and tried again. This time it gives me the following error:
BIP2340E: Err
or attaching field 'XMLNS' to field 'Data' which belongs to a message in a different group.
I'm not sure where the mistake is , But I could say that the element was attached to the correct group where it supposed to be.
follwoing is the code
CREATE LASTCHILD OF Environment DOMAIN 'XMLNS' FROM InputRoot.XMLNS.Messages.Message.Data.*;
DECLARE ToBeAttached REFERENCE TO Environment.*[<];
DETACH ToBeAttached;
ATTACH ToBeAttached TO OutputRoot.XMLNS.Message.Data AS LASTCHILD;
Is there anything which I overlooked?
Please let me know , btw thanks for your continued support on this
Last edited by Kumar4 on Mon Aug 27, 2007 7:56 pm; edited 1 time in total |
|
Back to top |
|
 |
shalabh1976 |
Posted: Thu Aug 23, 2007 9:15 pm Post subject: |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
Can a message be detached from Environment and attached to OutputRoot?
For that matter can we detach and attach message trees from other message trees?
I changed the code to :
Code: |
CREATE LASTCHILD OF OutputRoot DOMAIN 'XMLNS' FROM InputRoot.XMLNS.Messages.Message.Data.*;
DECLARE ToBeAttached REFERENCE TO OutputRoot.*[<];
DETACH ToBeAttached;
ATTACH ToBeAttached TO OutputRoot.XMLNS.Message.MIKData AS LASTCHILD; |
This is working fine.
However this may not be what you want. _________________ Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate |
|
Back to top |
|
 |
Kumar4 |
Posted: Fri Aug 24, 2007 6:47 am Post subject: |
|
|
Apprentice
Joined: 12 Aug 2007 Posts: 27
|
Hi,
Thanks for the reply, that one works for me.
But the thing is , I get Input data from CDATA structure of a XML Message. I'm pulling out a message from CDATA inside XML.
This code doesnt work for that scenario. As the error shown above follows.
Regards |
|
Back to top |
|
 |
|