I have the following xml stored in a field in an Oracle database:
Activity mc:Ignorable="sap sap2010 sads" x:Class="Process"
xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:awaw="clr-namespace:A.Workflow.Activities.WSCall;assembly=A.Workflow.Activities"
xmlns:awd="clr-namespace:A.Workflow.DataObjects;assembly=A.Workflow.DataObjects"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation"
xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
xmlns:sd="clr-namespace:System.Data;assembly=System.Data"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Members
x:Property Name="GlobalMessagesCollectionIn" Type="InArgument(awd:GlobalMessagesCollection)" />
x:Property Name="EventDataCollectionIn" Type="InArgument(awd:DataFileCollection)" />
x:Property Name="DocumentDataCollectionIn" Type="InArgument (awd:DataFileCollection)" />
x:Property Name="ResultDataCollectionIn" Type="InArgument (awd:DataFileCollection)" />
x:Property Name="BrokerRefIn" Type="InArgument(x:String)" />
x:Property Name="ClientFeeRefIn" Type="InArgument(x:String)" />
x:Property Name="InitUserTeamRefIn" Type="InArgument(x:String)" />
x:Property Name="InitUserTeamNameIn" Type="InArgument(x:String)" />
x:Property Name="InitUserBrokOffRefIn" Type="InArgument(x:String)" />
/x:Members>
mva:VisualBasic.Settings>
<x:Null />
/mva:VisualBasic.Settings>
/Activity
I am trying to write pl/sql procedure which - let's say outputs @Name attribute value for each x:Property element, where the Name attribute contains substring 'In'.
The following is my attempt at solving the problem:
declare
p_ProcessFile xmltype;
BEGIN
SELECT ProcessFile
INTO p_ProcessFile
FROM Process
WHERE ProcessSeqNo = 4034; --This fetches the above xml into xmltype var
FOR i IN (select p_ProcessFile.extract( '//x:Members/x:Property[(contains(@Name, "In")) ]/@Name', 'xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"').getStringVal() AS testing FROM dual) LOOP
dbms_output.put_line(i.testing || ';');
END LOOP;
END;
Unfortunately, this outputs all values concatenated:
GlobalMessagesCollectionInEventDataCollectionInDocumentDataCollectionInResultDataCollectionInBrokerRefIn;
However, what I'm after is:
GlobalMessagesCollectionIn
EventDataCollectionIn
DocumentDataCollectionIn
ResultDataCollectionIn
etc
How can I iterate for each x:Property with the @Name attribute containing 'In'?