Author |
Message
|
Sam Uppu |
Posted: Mon Nov 01, 2010 10:55 am Post subject: loosing XML attributes |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
Hi Guys,
I am loosing XML attributes when I copy message to Environment variables.
The input messsage is
Quote: |
<ProviderResponse xmlns="http://data.remotecontract.ipi.hcsc.com" xmlns:ns2="http://impl.ws.ipi.services.hcsc.com">
- <provider>
<type>A5</type>
<specialtyCode>079</specialtyCode>
..
...
...
</ProviderResponse> |
When I save it in Environment variables I am getting the message as below
Quote: |
<NS1:ProviderResponse xmlns:NS1="http://data.remotecontract.ipi.hcsc.com">
<xmlns>http://data.remotecontract.ipi.hcsc.com</xmlns>
<xmlns:ns2>http://impl.ws.ipi.services.hcsc.com</xmlns:ns2>
<NS1:provider>
<NS1:type>0E</NS1:type> |
I am using below code to copy the tree.
Quote: |
CREATE LASTCHILD OF Environment.Data DOMAIN 'XMLNS' NAME 'Provider';
SET Environment.Data.Provider= InputBody; |
Let me know if I am going wrong anywhere. Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 01, 2010 11:07 am Post subject: Re: loosing XML attributes |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Sam Uppu wrote: |
Hi Guys,
I am loosing XML attributes when I copy message to Environment variables.
The input messsage is
Quote: |
<ProviderResponse xmlns="http://data.remotecontract.ipi.hcsc.com" xmlns:ns2="http://impl.ws.ipi.services.hcsc.com">
- <provider>
<type>A5</type>
<specialtyCode>079</specialtyCode>
..
...
...
</ProviderResponse> |
|
At the risk of being fairly silly, I don't see any attributes in this message. Just tags. So what's being lost? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Sam Uppu |
Posted: Mon Nov 01, 2010 11:09 am Post subject: Re: loosing XML attributes |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
Vitor wrote: |
Sam Uppu wrote: |
Hi Guys,
I am loosing XML attributes when I copy message to Environment variables.
The input messsage is
Quote: |
<ProviderResponse xmlns="http://data.remotecontract.ipi.hcsc.com" xmlns:ns2="http://impl.ws.ipi.services.hcsc.com">
- <provider>
<type>A5</type>
<specialtyCode>079</specialtyCode>
..
...
...
</ProviderResponse> |
|
At the risk of being fairly silly, I don't see any attributes in this message. Just tags. So what's being lost? |
The namespaces are copied as elements under ProviderResponse. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Nov 01, 2010 11:21 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Do you see a sibling element named 'XMLNS'? |
|
Back to top |
|
 |
Sam Uppu |
Posted: Mon Nov 01, 2010 11:23 am Post subject: |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
|
Back to top |
|
 |
mqjeff |
Posted: Mon Nov 01, 2010 11:31 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
that's your parser root element. |
|
Back to top |
|
 |
Sam Uppu |
Posted: Mon Nov 01, 2010 4:43 pm Post subject: |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
The message which I store in Environment tree has XMLNS domain assigned.
But the XML attributes are not retained by Environment tree. They are appearing as Elements.
Does Environment tree retain's XML attributes? |
|
Back to top |
|
 |
mgk |
Posted: Tue Nov 02, 2010 1:32 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Can you post a trace node output showing your input message and the Envrionment please... _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Nov 02, 2010 1:34 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Silly question coming up. Are you sure that InputBody is actually InputRoot.XMLNS. Is it possible that you are using XMLNSC or some other parser? |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Nov 02, 2010 1:57 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You have created an XMLNS domain root parser node at
Environment.Data.XMLNS
or possibly
Environment.Data.Provider.XMLNS
You are not assigning any children to it, you are only assigning children to
Environment.Data.Provider. |
|
Back to top |
|
 |
mgk |
Posted: Tue Nov 02, 2010 2:33 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
You are not assigning any children to it, you are only assigning children to Environment.Data.Provider. |
I disagree which is why I asked for a trace. If this code is what was actually used:
Quote: |
CREATE LASTCHILD OF Environment.Data DOMAIN 'XMLNS' NAME 'Provider';
SET Environment.Data.Provider= InputBody; |
Then the "Provider" element is itself owned by a parser of type XMLNS. There should not be a child XMLNS element in this case...
I suspect kimbert may be correct here, but the trace will tell all  _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Nov 02, 2010 2:52 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
mgk wrote: |
Quote: |
You are not assigning any children to it, you are only assigning children to Environment.Data.Provider. |
I disagree which is why I asked for a trace. If this code is what was actually used:
Quote: |
CREATE LASTCHILD OF Environment.Data DOMAIN 'XMLNS' NAME 'Provider';
SET Environment.Data.Provider= InputBody; |
Then the "Provider" element is itself owned by a parser of type XMLNS. There should not be a child XMLNS element in this case... |
And yet, there is apparently an XMLNS element in the tree somewhere.... |
|
Back to top |
|
 |
|