Author |
Message
|
pcelari |
Posted: Tue Nov 08, 2011 10:25 am Post subject: XMLNSC output message attributes becomes elements |
|
|
Chevalier
Joined: 31 Mar 2006 Posts: 411 Location: New York
|
Hello. I'm experiencing strange behavior in output message in XMLNSC domain.
I defined the output message with a correct xsd file, which specifies a few attributes and others element. The input msg is of similar header containing same-named attributes.
However, unless I do a field-by-field copy of all attributes first and then modify them, the attributes in output become elements.
I wonder what is at play in the behavior.
Can our experts here shed some light on this?
thanks a lot!
 _________________ pcelari
-----------------------------------------
- a master of always being a newbie |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Nov 08, 2011 11:08 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Would you care to share a sample of the ESQL you have used with us? _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
pcelari |
Posted: Tue Nov 08, 2011 11:20 am Post subject: |
|
|
Chevalier
Joined: 31 Mar 2006 Posts: 411 Location: New York
|
set OutputRoot.XMLNSC.ns1:Message.MessageId = InputBody.ns:Message.MessageId;
set OutputRoot.XMLNSC.ns1:Message.MessageType = InputBody.ns:Message.MessageType;
set OutputRoot.XMLNSC.ns1:Message.ObjectFormat = InputBody.ns:Message.ObjectFormat;
-- unless I add the following line, the ObjectName will become an element instead of attribte.
set OutputRoot.XMLNSC.ns1:Message.ObjectName = InputBody.ns:Message.ObjectName;
-- This is the ultimate assignment, overriding the last line. But by itself, without the above line, it becomes an element.
set OutputRoot.XMLNSC.ns1:Message.ObjectName = 'Accessory IO'; _________________ pcelari
-----------------------------------------
- a master of always being a newbie |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Nov 08, 2011 11:27 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Either add in (XMLNSC.Attribute) or use Create Field.
Your code doesn't supply any context for the field type to determine that it should be anything other than an element. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Nov 08, 2011 12:11 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
|
Back to top |
|
 |
pcelari |
Posted: Wed Nov 09, 2011 5:30 am Post subject: |
|
|
Chevalier
Joined: 31 Mar 2006 Posts: 411 Location: New York
|
Wow, thanks so much for pointing that out.
Although I have been with WMB for quite a few years, this is the first time I have to deal with attribute.
Again, thanks for caring to respond to such a typical "newbie" question.
 _________________ pcelari
-----------------------------------------
- a master of always being a newbie |
|
Back to top |
|
 |
|