Author |
Message
|
leo.yue |
Posted: Fri Oct 22, 2004 7:46 pm Post subject: there are blank elemens when parsing incoming message |
|
|
Acolyte
Joined: 20 Oct 2004 Posts: 52
|
I used MQInput Node in my message flow, and it's domain is : XML
When I am debugging it I found that there are some blank elements in InputRoot.XML
XML example:
<?xml version="1.0" encoding="UTF-8"?>
<TestRoot>
<field> 1</field>
<field>1</field>
</TestRoot>
But I just eliminate the "Enter" characters and update the message as following, these blank elements disappear:
<?xml version="1.0" encoding="UTF-8"?><TestRoot><field> 1</field><field>1</field></TestRoot>
How can I do? Thanks! |
|
Back to top |
|
 |
kirani |
Posted: Fri Oct 22, 2004 10:16 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
You can read your input message as BLOB and then replace newline char in your input message with nothing. Similar topic has been discussed in this forum many times. Please search in this forum. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
leo.yue |
Posted: Sat Oct 23, 2004 3:35 am Post subject: |
|
|
Acolyte
Joined: 20 Oct 2004 Posts: 52
|
Thank you very much!
I don't want to convert it from BLOB to XML for eliminating carriage return.
because I just worry about performance.
In fact, I am operating multiple element, I just want to overleap especial charcater when excuting "MOVE CurrentProcess NEXTSIBLING".
There is a xml data:
<Root>
<step id =1></step>
<step id =2></step>
</Root>
ESQL code:
DECLARE id CHARACTER;
SET id = 2;
DECLARE curStep REFERENCE TO InputRoot.XML.Root.step;
WHILE (LASTMOVE(curStep)) AND (FIELDVALUE(curstep.(XML.Attribute)id) <> id) DO
MOVE curStep NEXTSIBLING;
END WHILE;
BTW:
How can I direct set a referenct to step according to step's id? |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat Oct 23, 2004 7:26 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can add additional qualification clauses to MOVE, like Type...
>>-MOVE--------------------------------------------------------->
>--Target----+-TO--SourceFieldReference--------------+---------><
+-PARENT--------------------------------+
'-+-FIRSTCHILD------+--| NAME clauses |-'
+-LASTCHILD-------+
+-PREVIOUSSIBLING-+
'-NEXTSIBLING-----'
NAME clauses
|--+-+-------------------+--+---------------------------+--+-------------------+-+--|
| '-TYPE --Expression-' '-NAMESPACE--+-Expression-+-' '-NAME --Expression-' |
| '-*----------' |
+-IDENTITY --PathElement------------------------------------------------------+
| (1) |
'-REPEAT-------+-TYPE------+--------------------------------------------------'
+-NAME------+
'-TYPE-NAME-' _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
leo.yue |
Posted: Sun Oct 24, 2004 6:00 am Post subject: |
|
|
Acolyte
Joined: 20 Oct 2004 Posts: 52
|
Thank you very much.
Now I can skip some blank element when I just use this statement:
"MOVE *** NEXTSIBLING REPEAT TYPE NAME"
But How I can direct reference to multiple element according to attribute value? |
|
Back to top |
|
 |
shanson |
Posted: Thu Nov 04, 2004 2:08 am Post subject: |
|
|
 Partisan
Joined: 17 Oct 2003 Posts: 344 Location: IBM Hursley
|
The XML and XMLNS domains preserve an XML message pretty much as it appears 'on the wire', so you will get elements in the tree for white space such as <CR>. If you model your XML message using the MRM (using the XML physical format) the white space is removed automatically. |
|
Back to top |
|
 |
|