Author |
Message
|
Dhiren |
Posted: Mon May 05, 2008 1:59 am Post subject: NULL elements with the attribute xsi:nil="true" |
|
|
Novice
Joined: 27 Jan 2005 Posts: 17
|
Hello,
I'm having trouble handling NULL elements with attribute xsi:nil="true". The input message set has the 'Nillable' property checked and the .msgset file has the 'Encoding non-Numeric Null' set to "NULLXMLSchema". Inspite of this I get a parseNext error on a date field.
Came across the foll troubleshooting link.. Identical problem scenario and set-up exactly as mentioned in here.. still no Luck..
http://www-1.ibm.com/support/docview.wss?rs=849&context=SSKM8N&dc=DB520&dc=DB560&uid=swg21289387&loc=en_US&cs=UTF-8&lang=en&rss=ct849websphere
Using MB v6.0.2
sample Input XML
.....<paymentAmount>70.81</paymentAmount>
<companyCode>0001</companyCode>
dueDate xsi:null='true'/>
<recoveryType/> .......
Am I missing anything ? Tips/ideas/ wil be greatly appreciated
Thanks. |
|
Back to top |
|
 |
Gaya3 |
Posted: Mon May 05, 2008 2:30 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
|
Back to top |
|
 |
Dhiren |
Posted: Mon May 05, 2008 3:29 pm Post subject: |
|
|
Novice
Joined: 27 Jan 2005 Posts: 17
|
Gyathri,
Thanks for the reply. Yes, I did see that... First off it was a MB v5 soln, and moreoever I could not find the "namespace flag" on the message set.. |
|
Back to top |
|
 |
kimbert |
Posted: Tue May 06, 2008 1:06 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
It's xsi:nil, not xsi:null. |
|
Back to top |
|
 |
dmx0t1 |
Posted: Sun Nov 23, 2008 8:28 pm Post subject: |
|
|
 Apprentice
Joined: 23 Nov 2008 Posts: 27
|
any one have any idea how to output xsi:nil="true"? |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Nov 23, 2008 9:07 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
dmx0t1 wrote: |
any one have any idea how to output xsi:nil="true"? |
With the MRM parser set the element/attribute VALUE = NULL and make sure the message set is configured correctly.
With the XMLNS/XMLNSC parsers use the correct type and namespaces:
SET ns:myelement.xsi:nil TYPE = (XML.Attribute|XMLNSC.Attribute);
SET ns:myelement.xsi:nill = 'true';
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
dmx0t1 |
Posted: Mon Nov 24, 2008 12:55 am Post subject: |
|
|
 Apprentice
Joined: 23 Nov 2008 Posts: 27
|
fjb_saper wrote: |
...
SET ns:myelement.xsi:nil TYPE = (XML.Attribute|XMLNSC.Attribute);
SET ns:myelement.xsi:nill = 'true';
Have fun  |
Thanks fjb_saper for the reply, but I've only been able to achieve <StartKeyValue xsi:nil="true"></StartKeyValue>, how can I get <StartKeyValue xsi:nil="true" /> instead? |
|
Back to top |
|
 |
kimbert |
Posted: Mon Nov 24, 2008 1:47 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
dmx0t1: which domain are you using?
I hope everybody realises that
Code: |
SET ns:myelement.xsi:nil TYPE = (XML.Attribute|XMLNSC.Attribute); |
is not valid ESQL. What fjb_saper means is that you should use XML.Attribute with the XMLNS domain, or XMLNSC.Attribute with the XMLNSC domain. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Nov 24, 2008 4:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
dmx0t1 wrote: |
fjb_saper wrote: |
...
SET ns:myelement.xsi:nil TYPE = (XML.Attribute|XMLNSC.Attribute);
SET ns:myelement.xsi:nill = 'true';
Have fun  |
Thanks fjb_saper for the reply, but I've only been able to achieve <StartKeyValue xsi:nil="true"></StartKeyValue>, how can I get <StartKeyValue xsi:nil="true" /> instead? |
XML is not for human eyes but to be parsed by a processor. As such there is no difference between
<StartKeyValue xsi:nil="true"></StartKeyValue>
and
<StartKeyValue xsi:nil="true" />
Not quite true... the first line while specifying the nil value would allow for children nodes/elements to be inserted between opening and closing tags (there just happen to be none) while the second form specifies at the same time that no children nodes are allowed.
A good parser however should not make any difference between the two.
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
kimbert |
Posted: Mon Nov 24, 2008 4:23 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
he first line while specifying the nil value would allow for children nodes/elements to be inserted between opening and closing tags (there just happen to be none) while the second form specifies at the same time that no children nodes are allowed. |
I am being very pedantic now, but that statement is not true (although it makes no difference to the subject of this thread). If an element has xsi:nil="true" then it *must* be empty. And there really is no difference at all between <a/> and <a></a>. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Nov 24, 2008 4:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
kimbert wrote: |
Quote: |
he first line while specifying the nil value would allow for children nodes/elements to be inserted between opening and closing tags (there just happen to be none) while the second form specifies at the same time that no children nodes are allowed. |
I am being very pedantic now, but that statement is not true (although it makes no difference to the subject of this thread). If an element has xsi:nil="true" then it *must* be empty. And there really is no difference at all between <a/> and <a></a>. |
Thanks for the correction Kimbert. I learn everyday from you  _________________ MQ & Broker admin |
|
Back to top |
|
 |
dmx0t1 |
Posted: Mon Nov 24, 2008 9:58 pm Post subject: |
|
|
 Apprentice
Joined: 23 Nov 2008 Posts: 27
|
To kimbert : i am using XMLNSC domain
kimbert wrote: |
dmx0t1: which domain are you using?
I hope everybody realises that
Code: |
SET ns:myelement.xsi:nil TYPE = (XML.Attribute|XMLNSC.Attribute); |
is not valid ESQL. What fjb_saper means is that you should use XML.Attribute with the XMLNS domain, or XMLNSC.Attribute with the XMLNSC domain. |
this what i did:
Code: |
DECLARE xsi Namespace 'http://www.w3.org/2001/XMLSchema-instance';
SET OutputRoot.XMLNSC.Request.RequestHeader.FromKey.(XMLNSC.Attribute)xsi:nil = 'true'; |
and the output turned out to be <FromKey xsi:nil="true"></FromKey>, though i am hoping broker can kill the closing tag and make it <FromKey xsi:nil="true" /> |
|
Back to top |
|
 |
kimbert |
Posted: Tue Nov 25, 2008 3:57 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I get
Code: |
<FromKey xsi:nil="true" /> |
on my v6.1.0.2 broker.
Are you on the latest fix pack? |
|
Back to top |
|
 |
dmx0t1 |
Posted: Tue Nov 25, 2008 7:14 pm Post subject: |
|
|
 Apprentice
Joined: 23 Nov 2008 Posts: 27
|
i am running version 6.1.0.1...will try 6.1.0.2  |
|
Back to top |
|
 |
|