私は次のXML構造を持っています
<?xml version="1.0" encoding="utf-8"?>
<DataItems>
<DataItem>
<ID>ID1</ID>
<Metric1>Metric11Value</Metric1>
<Metric2>Metric12Value</Metric2>
<OptionalParameters>
<OptionalParameter>
<ParameterName>ParamName1</ParameterName>
<ParameterValue>ParamValue1</ParameterValue>
<ParameterUnits>ParamUnits1</ParameterUnits>
<OptionalParamter>
<OptionalParameter>
<ParameterName>ParamName2</ParameterName>
<ParameterValue>ParamValue2</ParameterValue>
<ParameterUnits>ParamUnits2</ParameterUnits>
<OptionalParamter>
<OptionalParameter>
<ParameterName>ParamName3</ParameterName>
<ParameterValue>ParamValue3</ParameterValue>
<ParameterUnits>ParamUnits3</ParameterUnits>
<OptionalParamter>
</OptionalParamters>
<DataItem>
<ID>ID2</ID>
<Metric1>Metric21Value</Metric1>
<Metric2>Metric22Value</Metric2>
<OptionalParameters>
<OptionalParameter>
<ParameterName>ParamName1</ParameterName>
<ParameterValue>ParamValue1</ParameterValue>
<ParameterUnits>ParamUnits1</ParameterUnits>
<OptionalParamter>
<OptionalParameter>
<ParameterName>ParamName2</ParameterName>
<ParameterValue>ParamValue2</ParameterValue>
<ParameterUnits>ParamUnits2</ParameterUnits>
<OptionalParamter>
<OptionalParameter>
<ParameterName>ParamName3</ParameterName>
<ParameterValue>ParamValue3</ParameterValue>
<ParameterUnits>ParamUnits3</ParameterUnits>
<OptionalParamter>
</OptionalParamters>
<DataItem>
</DataItems>
次のようなテーブル列ができるように平らにしたい
(ID, Metric1, Metric2, ParamName, ParamValue, ParamUnits)
The problem is that I don't know how do peform the dynamic filtering I need in order to eliminate the invalid rows that result during the inner join or cross apply. So what I have essentially a total of (Number of Data Items)^2 of rows with all the permutations of parameters names, values, and units. I want to know how to filter out the invalid rows.