Author |
Message
|
dilse |
Posted: Tue Sep 13, 2005 8:27 am Post subject: reference variables with default namespace |
|
|
 Master
Joined: 24 Jun 2004 Posts: 270
|
Hi folks,
I am having problem in specifying the default namespace for reference variables. I am on WBIMB V5 with CSD 05. Here is my ESQL scenario.
Code: |
DECLARE dns NAMESPACE 'http://www.ibm.com/industries/financialservices/xxx';
DECLARE xsi NAMESPACE 'http://www.w3.org/2001/XMLSchema-instance';
SET OutputRoot.XMLNS.(XML.XmlDecl)= '';
SET OutputRoot.XMLNS.(XML.XmlDecl).(XML.Version) = '1.0';
SET OutputRoot.XMLNS.(XML.XmlDecl).(XML."Encoding") = 'UTF-8';
SET OutputRoot.XMLNS.dns:Message.(XML.Attribute)bodyType = 'XX-XML';
SET OutputRoot.XMLNS.dns:Message.(XML.Attribute)Version = '';
SET OutputRoot.XMLNS.dns:Message.(XML.NamespaceDecl)xmlns ='http://www.ibm.com/industries/financialservices/xxx';
SET OutputRoot.XMLNS.dns:Message.(XML.NamespaceDecl)xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance';
SET OutputRoot.XMLNS.dns:Message.(XML.Attribute)xsi:schemaLocation = 'http://www.ibm.bom/indudtsries/financialservices/xxxservices.xsd'; |
I was able to specify default namespace(dns) successfully in the above code. I am getting the output without NS! etc...
But when I am trying to create reference to a variable I am finsding it difficult specify default namespace. I tried the following way.
Code: |
DECLARE msgRef REFERENCE TO OutputRoot.XMLNS.dns:Message;
CREATE LASTCHILD OF msgRef NAME 'MyMessage';
DECLARE myMsgRef REFERENCE TO msgRef.dns:MyMessage; |
When I debug the flow with this code it is executing fine in the compute node but it was not able to write to the MQOutput node. Exceptionlist gives this info for 'MyMessage'.
"Element must have a namespace specified if there is a default namespace in scope".
Please throw some light on this as to how to go about declaring a reference with default namespace.
Thanks in advance, _________________ DilSe..
Take life as it comes.. |
|
Back to top |
|
 |
dilse |
Posted: Tue Sep 13, 2005 10:06 am Post subject: |
|
|
 Master
Joined: 24 Jun 2004 Posts: 270
|
I appreciate any kind of input...
Thanks.., _________________ DilSe..
Take life as it comes.. |
|
Back to top |
|
 |
recallsunny |
Posted: Tue Sep 13, 2005 1:12 pm Post subject: |
|
|
 Disciple
Joined: 15 Jun 2005 Posts: 163 Location: Massachusetts
|
Code: |
CREATE LASTCHILD OF msgRef NAME 'MyMessage' NAMESPACE dns; |
Try this to specify the Namespace in CREATE statement. |
|
Back to top |
|
 |
dilse |
Posted: Tue Sep 13, 2005 1:34 pm Post subject: |
|
|
 Master
Joined: 24 Jun 2004 Posts: 270
|
Thanks for reply sunny. I tried with the step you told me but it is coming up with the syntax error saying:
Quote: |
Syntax error : expected ';' but found 'keyword NameSpace'.
The expected token was not found.
Correct the syntax of your expression and redeploy the message flow. |
Any other suggestions????? _________________ DilSe..
Take life as it comes.. |
|
Back to top |
|
 |
mgk |
Posted: Tue Sep 13, 2005 2:16 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hi,
The tooling requires the NAMESPACE clause before the NAME clause like this:
Code: |
CREATE LASTCHILD OF msgRef NAMESPACE dns NAME 'MyMessage'; |
The docs for the CREATE statement do show the NAMESPACE clause, and they do document what it is for and they do document the order of the clauses, and you are allowed to read them
Regards _________________ 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 |
|
 |
dilse |
Posted: Wed Sep 14, 2005 5:06 am Post subject: |
|
|
 Master
Joined: 24 Jun 2004 Posts: 270
|
Thanks a lot mgk & sunny for your input. I read the manual before posting here but I didn't get a clear idea and also searched in this forum but couldn't find one that suits to this situation. _________________ DilSe..
Take life as it comes.. |
|
Back to top |
|
 |
|