Author |
Message
|
aks |
Posted: Mon Aug 26, 2002 10:55 pm Post subject: xml whitespace |
|
|
Voyager
Joined: 19 Jul 2002 Posts: 84
|
I'm using dynamic references (with NEXTSIBLING etc) to move through repeatable XML elements, because I was told that it was more efficient then first counting the number of elements with a CARDINALITY statement then looping through.
However, my input xml that contains whitespace between the elements breaks the flow. For example, if my xml looks like:
<A>
<B>blah 1</B>
<B>blah 2</B>
<B>blah 3</B>
</A>
then using NEXTSIBLING doesn't work (in fact it counts through 6 times, instead of 3, according to the trace). But if I strip all the whitespace around the elements, then it works fine.
How can I do a check to see of there is whitespace, and then ignore it?
Thanks
Alan |
|
Back to top |
|
 |
lillo |
Posted: Tue Aug 27, 2002 4:07 am Post subject: |
|
|
Master
Joined: 11 Sep 2001 Posts: 224
|
Hi,
Try the following when you move to the nextsibling element:
MOVE NEXTSIBLING TYPE '0x1000000'
I hope this help you.
Cheers, _________________ Lillo
IBM Certified Specialist - WebSphere MQ |
|
Back to top |
|
 |
aks |
Posted: Tue Aug 27, 2002 2:27 pm Post subject: |
|
|
Voyager
Joined: 19 Jul 2002 Posts: 84
|
Thanks - it works
I have also found another way as well:
MOVE ref NEXTSIBLING REPEAT TYPE NAME;
which ensures that the next sibling will be a <B> element.
Alan |
|
Back to top |
|
 |
MQSIBM |
Posted: Tue Aug 27, 2002 6:37 pm Post subject: |
|
|
Novice
Joined: 31 Oct 2001 Posts: 18
|
hi aks
i am working on WMQI 2.1.
i am using NEXTSIBLING in my esql, and its giving me syntax error.
do you have any idea about this ?
// my esql :
DECLARE myref REFERENCE TO InputBody.ExInvoice.Items[1];
WHILE LASTMOVE(myref)=TRUE
DO
SET myref = myref + 1;
MOVE myref TO NEXTSIBLING;
END WHILE;
-------------
I wantedly did deployment even though having sytax error problem,here is error -
BIP2432E: (92, 1 : The correlation name 'NEXTSIBLING' is not valid |
|
Back to top |
|
 |
aks |
Posted: Tue Aug 27, 2002 7:06 pm Post subject: |
|
|
Voyager
Joined: 19 Jul 2002 Posts: 84
|
Although the documentation in 2.1 says to use
MOVE myref TO NEXTSIBLING;
it will give a syntax error. Remove the 'TO' from the statement and it will work.
Alan |
|
Back to top |
|
 |
kirani |
Posted: Tue Aug 27, 2002 7:22 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
The syntax of MOVE statement is different in CSD1 and CSD2 of WMQI. I think, TO is allowed in CSD1, but not in CSD2. _________________ 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 |
|
 |
|