Splitting XML node based on delimiter 'OR' in SQL server

nillinquicegdi

New Member
I have a XML which needs to be splitted based on 'OR' . IF i have 2 OR's I would be splitting into 2+1 nodes as shown below in [XML2]
[XML1]\[code\]<Rules><Rule Text="WHEN FamilyCode = 'ABC' AND (PriceDifferentiatorCode In ('DEF', 'GHI') OR ( PriceDifferentiatorCode = 'JKL' AND NameDifferentiatorCode = 'MNO' ) OR (PriceDifferentiatorCode = 'XYZ' AND NameDifferentiatorCode = 'MNO')) THEN 'DummyValue'" /></Rules>\[/code\][XML2]\[code\]<Rules><Rule RuleText="WHEN FamilyCode = 'ABC' AND PriceDifferentiatorCode In ('DEF', 'GHI') THEN 'DummyValue'" /><Rule RuleText="WHEN FamilyCode = 'ABC' AND PriceDifferentiatorCode = 'JKL' AND NameDifferentiatorCode = 'MNO' THEN 'DummyValue'" /><Rule RuleText="WHEN FamilyCode = 'ABC' AND PriceDifferentiatorCode = 'XYZ' AND NameDifferentiatorCode = 'MNO' THEN 'DummyValue'" /></Rules> \[/code\]
 
Back
Top