Author |
Message
|
newtobroker |
Posted: Thu Feb 04, 2010 7:54 pm Post subject: XMLNSC.Element |
|
|
Novice
Joined: 04 Feb 2010 Posts: 23
|
Hi,
Im new to this forum but i can see lot of good posts in this site. I have a question about XML.Element.
I did read some posts in this forum on XMLNSC.Element but that didnt help me.
I have a complete logic of sequential xml processing written by traversing an XML with MOVE cursor NEXTSIBLING TYPE XML.Element and MOVE cursor FIRSTCHILD TYPE XML.Element.
Now we are moving this logic to XMLNSC parser. So when i tried replacing XML.Element in move statement with XMLNSC.Element, it doesnt seem to work.
I did get some info about XMLNSC.Folder and XMLNSC.Field but thats not helping me here.
In XML parser, we had XML.Element that we could have used to identify any kind of element but here in XMLNSC, there is no such thing. I have to toggle between XMLNSC.Folder and XMLNSC.Field and that makes my sequential logic complicated.
Also if I dont use any TYPE, then my MOVE statement will traverse through all the attributes and thus i lose time in processing.
Is there any effective way of using XMLNSC.Field and Folder to process elements sequentially or is there any specific way to replace XML.Element in my current code with XMLNSC ??
Thanks,
C* |
|
Back to top |
|
 |
exerk |
Posted: Fri Feb 05, 2010 2:13 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
Moving to the Broker forum... _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Feb 05, 2010 3:18 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
|
Back to top |
|
 |
newtobroker |
Posted: Fri Feb 05, 2010 12:09 pm Post subject: |
|
|
Novice
Joined: 04 Feb 2010 Posts: 23
|
Kimbert,
The below code does not give me any error
Code: |
MOVE cursor FIRSTCHILD TYPE XML.Element;
|
But the below code which i try as a replacement to the above code (as we are moving to XMLNSC parsert) is giving issues - Identifier XMLNSC.Element cannot be resolved.
Code: |
MOVE cursor FIRSTCHILD NAMESPACE * TYPE XMLNSC.Element;
|
What can be the best replaced for the XML.Element in the above MOVE statement ?
Thanks,
C* |
|
Back to top |
|
 |
kimbert |
Posted: Fri Feb 05, 2010 12:24 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I presume you are getting the error when you deploy the message flow - but you haven't said so, and you have only quoted a fraction of the message.
You're probably on a version of the runtime which does not support XMLNSC.Element. I think it was added in runtime fixpack 6.1.0.4 or 6.1.0.5. |
|
Back to top |
|
 |
newtobroker |
Posted: Fri Feb 05, 2010 12:35 pm Post subject: |
|
|
Novice
Joined: 04 Feb 2010 Posts: 23
|
Kimbert,
Someone suggested me like this
Code: |
MOVE cursor FIRSTCHILD NAMESPACE * TYPE (XMLNSC.Folder OR XMLNSC.Field); |
Is this the right way, because an element can be of two types either folder or field.
On the version, I think its 6.1 but i have dropped a mail to my admin asking for details.
Thanks,
c *[/code] |
|
Back to top |
|
 |
newtobroker |
Posted: Fri Feb 05, 2010 12:38 pm Post subject: |
|
|
Novice
Joined: 04 Feb 2010 Posts: 23
|
My admin just got back, he says the broker runtime version is 6.1.0.3 on z/OS |
|
Back to top |
|
 |
kimbert |
Posted: Fri Feb 05, 2010 3:53 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
v6.1.0.3 does not support XMLNSC.Element - the simplest solution ( to this problem, anyway ) would be to upgrade to the latest fixpack.
The code snippet which you posted will not work. There is a way to do what you require, but it's not quite as easy as that. If you can't upgrade then I'll find the solution for you. |
|
Back to top |
|
 |
newtobroker |
Posted: Fri Feb 05, 2010 4:09 pm Post subject: |
|
|
Novice
Joined: 04 Feb 2010 Posts: 23
|
Kimbert,
Yes unfortunately we cannot upgrade. Can you please share the other solution ? This is urgent, appreciate your help.
Another suggestion that came around from one of my friends is using
Code: |
MOVE cursor FIRSTCHILD TYPE 0x01000000;
|
I havent tested this though.
Thanks,
C* |
|
Back to top |
|
 |
kimbert |
Posted: Mon Feb 08, 2010 4:54 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You will not be able to do this with a TYPE clause on your MOVE statement. Instead, you will need to iterate over the nodes that you are searching and check for XMLNSC.Folder or XMLNSC.PCDataField.
I think this will work, but I haven't tested it:
Code: |
SET fieldType = FIELDTYPE(ref) BITOR 0x01000000;
IF fieldType = 0x01000000 THEN
-- do stuff
ELSE
move ref to next sibling and try again
|
Don't forget to check LASTMOVE after every MOVE... |
|
Back to top |
|
 |
newtobroker |
Posted: Wed Feb 10, 2010 12:57 pm Post subject: |
|
|
Novice
Joined: 04 Feb 2010 Posts: 23
|
Thanks Kimbert. I did it in this way
MOVE cursor FIRSTCHILD TYPE XMLNSC.Folder;
IF LASTMOVE(cursor) = FALSE THEN
MOVE cursor FIRSTCHILD TYPE XMLNSC.Field;
END IF;
It seems to work so far...
C * |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Feb 10, 2010 2:27 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
newtobroker wrote: |
Thanks Kimbert. I did it in this way
MOVE cursor FIRSTCHILD TYPE XMLNSC.Folder;
IF LASTMOVE(cursor) = FALSE THEN
MOVE cursor FIRSTCHILD TYPE XMLNSC.Field;
END IF;
It seems to work so far...
C * |
I'd still do a second check on that lastmove(cursor)...
What happens when you are already at the bottom of the tree??  _________________ MQ & Broker admin |
|
Back to top |
|
 |
newtobroker |
Posted: Wed Feb 10, 2010 11:32 pm Post subject: |
|
|
Novice
Joined: 04 Feb 2010 Posts: 23
|
fjp_saper,
This condition is inside a loop and if my lastmove fails then i exit. So if its the last then we just exit processing. So far i havent seen any processing errors and the logic seems to be working but need to check on all use cases.
Thanks,
C* |
|
Back to top |
|
 |
|