Pasting the code that traverses entire XML message, recursively using pre-order traversal method extended for non-binary tree and converts field data to upper case.
CREATE PROCEDURE Traverse (IN REF_Cursor REFERENCE)BEGIN
IF ( ( NOT FIELDTYPE(REF_Cursor)=XMLNSC.NamespaceDecl)
AND (FIELDTYPE(REF_Cursor) = NameValue)) THEN
SET REF_Cursor = UPPER(REF_Cursor);
END IF;
MOVE REF_Cursor FIRSTCHILD ;
IF LASTMOVE(REF_Cursor) THEN
CALL Traverse(REF_Cursor);
MOVE REF_Cursor PARENT;
END IF;
MOVE REF_Cursor NEXTSIBLING ;
IF LASTMOVE(REF_Cursor) THEN
CALL Traverse(REF_Cursor);
MOVE REF_Cursor PREVIOUSSIBLING;
END IF;
END;
This worked fine for the XML messages I tested it with, and the code looks simple enough. Let me know if I have overlooked some test case which might lead to failure of above procedure.
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