Author |
Message
|
fmv0202 |
Posted: Mon Jun 11, 2007 10:49 am Post subject: Converting XMLNS to XML |
|
|
 Apprentice
Joined: 13 Dec 2006 Posts: 28
|
Hello,
I'm currently using WBI MB v5 FP8 and am trying to figure out how to convert XMLNS to XML. I have an incoming message which needs to be formatted in XML without the namespace. The incoming message originally is a soap message which is successfully decoded into a XMLNS message with Support Pack IA81. Can anyone point me in the right direction?
Thanks. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Mon Jun 11, 2007 10:57 am Post subject: Re: Converting XMLNS to XML |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
In my opinion it is better to remove namespaces from XMLNS rather than convert domain from XMLNS to XML.
When you convert domain from XMLNS to XML new tag name will be created by concatenating namespace and original tag. _________________ Marcin
Last edited by marcin.kasinski on Mon Jun 11, 2007 10:59 am; edited 1 time in total |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Mon Jun 11, 2007 10:59 am Post subject: Re: Converting XMLNS to XML |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
ESQL code doing this you can find in this forum:
Code: |
CREATE PROCEDURE StripNamespaces(IN StartRefPtr REFERENCE)
BEGIN
DECLARE FieldRefPtr REFERENCE TO StartRefPtr;
MOVE FieldRefPtr FIRSTCHILD;
IF LASTMOVE(FieldRefPtr) THEN
IF FIELDTYPE(FieldRefPtr) IN (0x01000000, 0x03000000) THEN
SET FieldRefPtr.(XML.NamespaceDecl)* = NULL;
SET FieldRefPtr NAMESPACE = '';
END IF;
END IF;
WHILE LASTMOVE(FieldRefPtr) DO
CALL StripNamespaces(FieldRefPtr);
IF FIELDTYPE(FieldRefPtr) IN (0x01000000, 0x03000000) THEN
SET FieldRefPtr.(XML.NamespaceDecl)* = NULL;
SET FieldRefPtr NAMESPACE = '';
END IF;
MOVE FieldRefPtr NEXTSIBLING;
END WHILE;
END;
|
_________________ Marcin |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jun 11, 2007 11:13 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
In my opinion, it's better to fix the broken code that can't honor or ignore the namespaces.
Would you convert Java code to all run in the default package, if you had a version control system that couldn't handle java packages? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Mon Jun 11, 2007 11:23 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
jefflowrey wrote: |
In my opinion, it's better to fix the broken code that can't honor or ignore the namespaces.
Would you convert Java code to all run in the default package, if you had a version control system that couldn't handle java packages? |
Hm,
It is correct in perfect world
... but not always.
I remember we had requirement to change WS request (with namespaces) to MQ legacy application (without namespaces).
We couldn't change legacy application code.
In this situation we removed namespaces from WS message and sent this message with little modification to legacy application.
This is role of MB also. _________________ Marcin
Last edited by marcin.kasinski on Mon Jun 11, 2007 11:39 am; edited 1 time in total |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jun 11, 2007 11:30 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
marcin.kasinski wrote: |
This is role of MB also. |
Yes, it's the role of MB in an enterprise to allow applications to only support a single data format with the rest of the enterprise - that broker will transform input and output for that application to.
But one reason for doing this is so you can change that interface (i.e., modernize it) without changing anything OTHER than broker.
And it should be very easy to convert something that already speaks XML to being something that supports XML with namespaces - even if it has to ignore the namespaces. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fmv0202 |
Posted: Mon Jun 11, 2007 11:35 am Post subject: |
|
|
 Apprentice
Joined: 13 Dec 2006 Posts: 28
|
You are the man and those are exactly my requirements!! |
|
Back to top |
|
 |
|