Author |
Message
|
wbinewbie |
Posted: Thu May 16, 2013 1:40 pm Post subject: Broker 7.0.0.5 not parsing XML? |
|
|
Novice
Joined: 24 Dec 2012 Posts: 11
|
Hi , wondering if anyone noticed this issue, we upgraded brokr to 7.0.0.5 recently and after that it dosent seem to be parsing XML, even though the debugger shows the XML tree.
In more detail, at the start of the compute node, I am copying OutputRoot=InputRoot and when provided a well-formed XML as input (that opens in IE), If I check if OutputRoot.XMLNSC IS NOT NULL or InputRoot.XMLNSC IS NOT NULL, the checks fail...
anyone see this strange behaviour? |
|
Back to top |
|
 |
kimbert |
Posted: Thu May 16, 2013 2:00 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
If you suspect something like this, the obvious next steps are:
1. Insert a Trace node after the input node
2. Take a debug-level user trace and read it carefully.
The most likely reason for this that you have specified Parse Timing as 'On demand' on the input node, and your message flow logic is not triggering any parsing at all. This is as-designed. |
|
Back to top |
|
 |
wbinewbie |
Posted: Thu May 16, 2013 2:29 pm Post subject: |
|
|
Novice
Joined: 24 Dec 2012 Posts: 11
|
looks like the issue is that my incoming xml has namespace specified. how do i handle namespaces in broker. Do i need to model the message? |
|
Back to top |
|
 |
rekarm01 |
Posted: Thu May 16, 2013 2:44 pm Post subject: Re: Broker 7.0.0.5 not parsing XML? |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
wbinewbie wrote: |
If I check if OutputRoot.XMLNSC IS NOT NULL or InputRoot.XMLNSC IS NOT NULL, the checks fail... |
What exactly are these checks supposed to be checking for?
InputRoot.XMLNSC and OutputRoot.XMLNSC are typically NAME elements that won't have a value, so "IS NOT NULL" would return FALSE, whether the elements exist or not, and whether the elements have child elements or not.
wbinewbie wrote: |
looks like the issue is that my incoming xml has namespace specified. how do i handle namespaces in broker. Do i need to model the message? |
What happens exactly, when the "incoming xml has namespace specified"? What problem does this cause? The XMLNSC parser should be able to handle XML messages with namespaces, with or without an associated schema. |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 17, 2013 4:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
wbinewbie wrote: |
how do i handle namespaces in broker. |
Same way you handle any other XML artififact.
wbinewbie wrote: |
Do i need to model the message? |
Not need, but you must at least account for the namespaces.
I agree with my associate; what are you trying to do? Whatever it is, that code probably won't do it. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
new2z |
Posted: Fri May 17, 2013 12:46 pm Post subject: |
|
|
Novice
Joined: 16 May 2013 Posts: 15
|
@@wbinewbie
you may want to use browse to these sections from the infocenter corresponding to your broker version. Not that the way you work with namespaces will change between versions.
1. Developing message flow applications > Transforming messages > Using ESQL > Writing ESQL > Manipulating messages in the XML domains > Manipulating messages in the XMLNSC domain > The message body
2. Developing message flow applications > Transforming messages > Using ESQL > Writing ESQL > Manipulating messages in the XML domains > Working with XML messages
Thanks |
|
Back to top |
|
 |
wbinewbie |
Posted: Sun May 19, 2013 1:09 pm Post subject: |
|
|
Novice
Joined: 24 Dec 2012 Posts: 11
|
I am just trying to do simple operations such as existence of a tag or value of a certain tag in XML. What i see is that it works fine in the case of XML inout messages that dint have a namespace defined in the opening tag - i.e xmlns=... but fails when the message has a namespace defined.. |
|
Back to top |
|
 |
wbinewbie |
Posted: Sun May 19, 2013 1:35 pm Post subject: |
|
|
Novice
Joined: 24 Dec 2012 Posts: 11
|
so for example, if I have :
Quote: |
<StartTag xmlns="urn:iso:std:iso:20022:tech:xsd:setr" xmlns:t="http://www.w3.org/namespace/">
<Tag1>34566775</Tag1>
<Tag2>123456</Tag2>
</StartTag>
|
How do i check for existence or values of Tag1 and Tag2? |
|
Back to top |
|
 |
McueMart |
Posted: Mon May 20, 2013 12:31 am Post subject: |
|
|
 Chevalier
Joined: 29 Nov 2011 Posts: 490 Location: UK...somewhere
|
Code: |
IF EXISTS(InputRoot.XMLNSC.*:StartTag.*:Tag1) THEN
...
END IF
|
I'm wildcarding the namespace above but you can reference particular ones if you want (look it up in the infocenter). |
|
Back to top |
|
 |
kimbert |
Posted: Mon May 20, 2013 12:48 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Put in those Trace nodes, as suggested in my last post.
Read the topics - they really do contain useful information.
Post again when you have done both of those things. |
|
Back to top |
|
 |
|