|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How can I remove the tags from an XML message |
« View previous topic :: View next topic » |
Author |
Message
|
KittieKat |
Posted: Tue Dec 18, 2001 4:21 pm Post subject: |
|
|
Apprentice
Joined: 17 Dec 2001 Posts: 31
|
Does anyone know how to strip the tags off an XML message leaving only the text field as the output? For example, the input message is Honda and I just want to output the word "Honda". I tried to use the BLOB parser in the Compute Node, somehow it didn't recognize the parser. please help, thanks. |
|
Back to top |
|
 |
KittieKat |
Posted: Tue Dec 18, 2001 4:23 pm Post subject: |
|
|
Apprentice
Joined: 17 Dec 2001 Posts: 31
|
oops, the input message should be "Honda". |
|
Back to top |
|
 |
KittieKat |
Posted: Tue Dec 18, 2001 4:25 pm Post subject: |
|
|
Apprentice
Joined: 17 Dec 2001 Posts: 31
|
The input message is the word Honda preceded by an opening tag "car" and a closing tag "car". Sorry about that. |
|
Back to top |
|
 |
EddieA |
Posted: Tue Dec 18, 2001 5:11 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Firstly, disable HTML and then the tags will show correctly in the forum.
Can you describe the output record format in the MRM. If so, then use ESQL to move each field from the XML to it's corresponding MRM field.
If you can't do it in the MRM, then you will have to do it using NEON formats, as they are more flexible as far as record format go.
Cheers,
_________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
WBI_user |
Posted: Tue Dec 18, 2001 9:28 pm Post subject: |
|
|
Partisan
Joined: 07 Aug 2001 Posts: 386
|
This will do the trick for an XML with begin tag and end tag of MESSAGE
<MESSAGE>.......</MESSAGE>
I got the help from a PMR that I reported.
DECLARE len_starttag INTEGER;
DECLARE len_endtag INTEGER;
DECLARE work BLOB;
DECLARE len_work INTEGER;
DECLARE result BLOB;
DECLARE len_result INTEGER;
-- <MESSAGE>
SET len_starttag = LENGTH(x'3C4D4553534147453E');
-- </MESSAGE>
SET len_endtag = LENGTH(x'3C2F4D4553534147453E');
SET work = BITSTREAM(InputRoot.XML."MESSAGE");
SET len_work = LENGTH(work);
SET len_result = len_work - (len_starttag + len_endtag);
SET result = SUBSTRING(work FROM (len_starttag+1) FOR len_result);
SET OutputRoot."BLOB"."BLOB" = result; |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|