Author |
Message
|
beth_carlin |
Posted: Tue May 16, 2006 3:27 pm Post subject: how to turn off xml parser in mqsi 2.1 in pubsub compute nod |
|
|
Acolyte
Joined: 08 Jun 2004 Posts: 64
|
Hi Gurus,
I have a very simple pub/sub message flow with a single compute node to pass
the entire InputBody to OutputRoot.XML and everything works great so far. However,
When I try to pass a well_formed and validated xml doc that has some entity reference of
 . The mqsi 2.1 XML parser will reject this
What I would like to know is :
Is there away that I can pass the data thru as it is without invoking the xml parser ?
page 238 of the eSQL manual shows the AsisElement example can be used but that
is for individual elements, How to do it for the entire OutputRoot.XML that is
how to change
SET OutputRoot.XML = InputBody;
without invoking the xml parser
MY brief and simple code is below:
----------------------------
DECLARE C INTEGER;
SET C = CARDINALITY(InputRoot.*[]);
DECLARE I INTEGER;
SET I = 1;
WHILE I < C DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I=I+1;
END WHILE;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
SET OutputRoot.MQMD.Format = 'MQHRF2 ' ;
Set OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId = 1208;
Set OutputRoot.MQRFH2.(MQRFH2.Field)Encoding = 546;
Set OutputRoot.MQRFH2.(MQRFH2.Field)Format = 'MQSTR ';
SET OutputRoot.MQRFH2.psc.Command='Publish';
DECLARE CNT INTEGER;
DECLARE TOPIC CHARACTER;
SET CNT = CARDINALITY(InputRoot.XML.*[]);
-- topic is the last root tag in the tree
SET TOPIC = FIELDNAME(InputRoot.XML.*[CNT]);
IF TOPIC = '' THEN
SET TOPIC = FIELDNAME(InputRoot.XML.*[CNT-1]);
END IF;
SET OutputRoot.MQRFH2.psc.Topic='application/testtopic/' || TOPIC;
SET OutputRoot.XML = InputBody;
---------------------------------------
THanks very much for all your help
Beth |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue May 16, 2006 3:36 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Because you have to access the last child of the XML tree to get the Topic, you can't avoid accessing the XML parser - because you have to invoke it to get that topic!
Unless you decide you can hand-parse the data in the BLOB domain using POSITION and SUBSTRING.
You should absolutely be planning your migration to at least version 5, too. Version 2.1. can't handle XML Namespaces, and is unsupported, and is in my opinion a risk to your organization to run that is more expensive than the cost of migration. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
beth_carlin |
Posted: Wed May 17, 2006 12:40 pm Post subject: turn off xml parsing |
|
|
Acolyte
Joined: 08 Jun 2004 Posts: 64
|
Grand Master,
I am relatively new to this mqsi project...still trying to learn it
I appreciate your help very much. We are planning to migrate to WMB V6 very soon.
Would you please let me know if
1) WMB V6 will support xml Namespace ?
2) Assuming the input xml looks something like this
<topicname>
<name>John Smith </name>
<address> 123 Bell st </address>
</topicname>
If you have some time,
Could you teach me how the code I listed above in the compute node should be changed to using BLOB domain
Thanks YOU for all your help
Beth |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed May 17, 2006 1:24 pm Post subject: Re: turn off xml parsing |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
beth_carlin wrote: |
Grand Master, |
That really just means that I've posted more than like 500 times.
beth_carlin wrote: |
I am relatively new to this mqsi project...still trying to learn it
I appreciate your help very much. We are planning to migrate to WMB V6 very soon. |
Good.
beth_carlin wrote: |
Would you please let me know if
1) WMB V6 will support xml Namespace ? |
Yes.
beth_carlin wrote: |
2) Assuming the input xml looks something like this
<topicname>
<name>John Smith </name>
<address> 123 Bell st </address>
</topicname>
If you have some time,
Could you teach me how the code I listed above in the compute node should be changed to using BLOB domain |
I'd use the POSITION function to find the place in the BLOB data where "<name>" was, and the place where "</name>" was. Then I'd substring between those to get the name. And the same with "<address>" and "</address>". _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
beth_carlin |
Posted: Thu May 18, 2006 7:30 am Post subject: THANK YOU grandmaster |
|
|
Acolyte
Joined: 08 Jun 2004 Posts: 64
|
because you coined the word 'GrandMaster' therefore I'd like to address you that way....THANK YOU very much for your instructions
Beth |
|
Back to top |
|
 |
mgk |
Posted: Fri May 19, 2006 12:12 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hi,
Quote: |
because you coined the word 'GrandMaster' therefore I'd like to address you that way |
Don't forget there are several "grand masters" who post on this forum, and using this title as a form of address could get very confusing!
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 |
|
 |
beth_carlin |
Posted: Wed Jun 28, 2006 8:04 pm Post subject: Re: turn off xml parsing |
|
|
Acolyte
Joined: 08 Jun 2004 Posts: 64
|
Dear grand master jefflowrey,
I just asked another question subject " how to add a new field in the xml output msg in pubsub ?" if you have some free time I would appreciate your instructions.
Thanks
Beth Carlin |
|
Back to top |
|
 |
|