Author |
Message
|
CuriCAT |
Posted: Thu Apr 05, 2007 4:14 am Post subject: namespace xmlns:xml is generated in output XML only in MB6. |
|
|
 Voyager
Joined: 26 Sep 2006 Posts: 82
|
PROBLEM:
When I generate XML message by using Message Broker 6, it generates extra
XML namespaces xmlns:xml="http://www.w3.org/XML/1998/namespace" which is not
compatible with all the XML parsers. We need to remove that before putting
the message into output queue.
i am using MRM XML. I HAVE MESSAGE SET AND MSG DEFINITIONS for the output message.
If any one knows how to do avoid this (removing the particular namespace) please share with me.
removing it in ESQL is an option. is there any way to configure this it in MRM
my analysis on the problem :
----------------------------------
the namespace attribute(xmlns:xml="http://www.w3.org/XML/1998/namespace" ) is generated by the broker as per the XML specification to http://www.w3.org/TR/REC-xml-names/
"The prefix xml is by definition bound to the namespace name http://www.w3.org/XML/1998/namespace. It MAY, but need not, be declared, and MUST NOT be bound to any other namespace name. Other prefixes MUST NOT be bound to this namespace name, and it MUST NOT be declared as the default namespace"
Also, I have seen the below mentioned comments in a Technical forum http://www.thescripts.com/forum/thread177565.html
This one discusses the same problem what we are facing with IE.
xmlns:xml='http://www.w3.org/XML/1998/namespace' is the problem. This is
one piece of incompatibility brought to XML by XML namespaces. According
to original XML namespaces spec:
"The prefix xml is by definition bound to the namespace name
http://www.w3.org/XML/1998/namespace."
[http://www.w3.org/TR/REC-xml-names/#nsc-NSDeclared]
Apparently Microsoft's interpretation is "nobody can use xml as
namespace prefix, because it's bound by definition". We can see that
this interpretation is consistently implemented in all versions of MSXML
as well as in .NET.
Btw, recently XML Namespaces 1.1 clarified things a bit:
"The prefix xml is by definition bound to the namespace name
http://www.w3.org/XML/1998/namespace. It MAY, but need not, be declared,
and MUST NOT be undeclared or bound to any other namespace name."
[http://www.w3.org/TR/2004/REC-xml-n...4/#xmlReserved]
In ,my case, the problem can be if the receiving systems are developed by using .NET or Microsoft technologies the parser will throw an error. Otherwise the XML outputs generated by Message Broker are complains to XML specification.
FINALLY:
I HAVE TO REMOVE THIS ATTRIBUTE. CAN I DO IT IN MRM? is my question.
--------------------------------
Thanks in advance  |
|
Back to top |
|
 |
kimbert |
Posted: Thu Apr 05, 2007 4:40 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
|
Back to top |
|
 |
CuriCAT |
Posted: Thu Apr 05, 2007 5:23 am Post subject: |
|
|
 Voyager
Joined: 26 Sep 2006 Posts: 82
|
just a coincidence , Isn't it possbile to remove it in ESQL ?  |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Apr 05, 2007 5:24 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You could probably do it in ESQL by ASBITSTREAMing and then reparsing as XMLNSC and then removing the offensive namespace. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Apr 05, 2007 6:08 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
You could probably do it in ESQL by ASBITSTREAMing and then reparsing as XMLNSC and then removing the offensive namespace. |
Well, you could. But I would not recommend it unless you were depending on an MRM-only feature. It would perform very badly indeed.
A better solution would be to build an XMLNSC tree. The style of an XMLNSC tree is very similar indeed to an MRM tree ( just an extra level at the top for the root tag). |
|
Back to top |
|
 |
CuriCAT |
Posted: Wed Apr 11, 2007 6:21 am Post subject: |
|
|
 Voyager
Joined: 26 Sep 2006 Posts: 82
|
I have done this way, this works for me.
By changing the XML wire format settings.
After creating the message set and adding the XML wire format to the message set, change the property “Output Namespace Declaration” under “Namespace settings” in XML wire format properties to use the value “As required” instead of the default value “As start of document”.
Following is the explanation of the values:
At start of document. Declarations for all of the entries in the Namespace schema locations table will be output as attributes of the message in the output XML document. The disadvantage of this option is that in some cases unnecessary declarations may be output.
As required. Declarations will only be output when required by an element or attribute that is in that namespace. The disadvantage of this option is that the same namespace declaration may need to be output more than once in the output XML document.
Thanks for you suggestions! |
|
Back to top |
|
 |
kimbert |
Posted: Wed Apr 11, 2007 11:26 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Thanks for publishing the workaround. I'll refer to this post if/when others hit this problem. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Apr 11, 2007 11:58 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Further to this: you can ask for fixes IC50606 and IC51074 if you want the problem fixed properly. Both fixes will be in the next WMB fix pack. |
|
Back to top |
|
 |
dilse |
Posted: Fri Apr 27, 2007 2:19 pm Post subject: |
|
|
 Master
Joined: 24 Jun 2004 Posts: 270
|
Thanks CuriCat.
Had the same issue luckily had the workaround ready for me.
Thanks,
DilSe.. _________________ DilSe..
Take life as it comes.. |
|
Back to top |
|
 |
|