Я пытаюсь разобрать XML, который хранится в виде столбца в таблице, в его основные компоненты.XML описывает правило, ниже приведен пример.
Пример ниже будет выглядеть так: «Дата = 23.12.2011 и Изменение = Нет».
Я бы хотел получить оператор and между правилами (BOOLEAN AND) в столбце, с левой и правой стороны для каждого правила в столбцы (DATE, 23.12.2011) иоперация между LHS и RHS в другом столбце (EQUAL TO).
<Conditions>
<FactsetConditionBase xmlns:d2p1="http://www.w3.org/2001/XMLSchema-instance" d2p1:type="FactsetExpression" Operation="Boolean And">
<Conditions>
<FactsetStatement Operation="Equal To">
<Identifier Value="Date" />
<Value xmlns:q1="http://www.w3.org/2001/XMLSchema" d2p1:type="q1:string">12/23/2011</Value>
</FactsetStatement>
<FactsetStatement Operation="Equal To">
<Identifier Value="Change" />
<Value xmlns:q2="http://www.w3.org/2001/XMLSchema" d2p1:type="q2:string">No</Value>
</FactsetStatement>
</Conditions>
</FactsetConditionBase>
</Conditions>
Эти правила также становятся более или менее сложными.
Более сложное правило: (WeekDay = понедельник и (Число начинается с 1 или Число начинается с 2 или Число начинается с 3))
<Conditions>
<FactsetConditionBase xmlns:d2p1="http://www.w3.org/2001/XMLSchema-instance" d2p1:type="FactsetExpression" Operation="Boolean And">
<Conditions>
<FactsetExpression Operation="Boolean And">
<Conditions>
<FactsetExpression Operation="Boolean And">
<Conditions>
<FactsetStatement Operation="Equal To">
<Identifier Value="WeekDay" />
<Value xmlns:q1="http://www.w3.org/2001/XMLSchema" d2p1:type="q1:string">Monday</Value>
</FactsetStatement>
</Conditions>
</FactsetExpression>
<FactsetExpression Operation="Boolean Or">
<Conditions>
<FactsetStatement Operation="Begins With">
<Identifier Value="Number" />
<Value xmlns:q2="http://www.w3.org/2001/XMLSchema" d2p1:type="q2:string">1</Value>
</FactsetStatement>
<FactsetStatement Operation="Begins With">
<Identifier Value="Number" />
<Value xmlns:q3="http://www.w3.org/2001/XMLSchema" d2p1:type="q3:string">2</Value>
</FactsetStatement>
<FactsetStatement Operation="Begins With">
<Identifier Value="Number" />
<Value xmlns:q4="http://www.w3.org/2001/XMLSchema" d2p1:type="q4:string">3</Value>
</FactsetStatement>
</Conditions>
</FactsetExpression>
</Conditions>
</FactsetExpression>
</Conditions>
</FactsetConditionBase>
</Conditions>
Менее сложное правило: Цвет = КРАСНЫЙ
<Conditions>
<FactsetConditionBase xmlns:d2p1="http://www.w3.org/2001/XMLSchema-instance" d2p1:type="FactsetStatement" Operation="Equal To">
<Identifier Value="Color" />
<Value xmlns:q1="http://www.w3.org/2001/XMLSchema" d2p1:type="q1:string">RED</Value>
</FactsetConditionBase>
</Conditions>
Заранее благодарим за любую помощь.