I have an xml string and need to manipulate it within sql.
<RuleData ReturnVariable="">
<MateProperties>
<Property Key="value" DisplayName="name value" />
<Property Key="value2" DisplayName="name value2" />
</MateProperties>
<ReferenceNames>
<Item Name="0" Value="=CouplerType + "-1"" />
<Item Name="1" Value="Driveshaft-1" />
</ReferenceNames>
<ReferenceFeatures>
*<Item Name="=CouplerType + "-1"" Value="CSYS_BOREB" />
<Item Name="Driveshaft-1" Value="CSYS_CouplerINSIDE" />*
</ReferenceFeatures>
</RuleData>
These two lines I need to convert them.
<Item Name="=CouplerType + "-1"" Value="CSYS_BOREB" />
<Item Name="Driveshaft-1" Value="CSYS_CouplerINSIDE" />
To This new format.
<Value>
<Column Value="=CouplerType + "" />
<Column Value="CSYS_BOREB" />
</Value>
<Value>
<Column Value="Driveshaft-1" />
<Column Value="CSYS_CouplerINSIDE" />
</Value>
Essentially each line has to be split in two and re-named. I Can take care of the re-naming i just am having trouble splitting the columns. I have to do exactly the same thing in the ReferenceNames Section as well. That one is easier as Its always “0” and “1” so i can simply convert the xml to string and find replace with that. The ReferenceFeatures section though is more complicated because anything can be in the name section.
1 Answer