S
steve bull
I have the following code snippet to read the colorRange attributes for the colorRangeSwatch in the xml file listed
below.
string expr = "/swatches[colorRangeSwatch='All Red Colors']/colorRangeSwatch/colorRange";
XmlElement crsElement = (XmlElement)m_colorRangeSwatchDoc.SelectSingleNode(expr);
bool fr = bool.Parse(crsElement.GetAttribute("fixed").ToString());
The element returned is always the 1st, All Blue Colors, why doesn't the expression filter on the colorRangeSwatch
value?
Any ideas would be welcome.
Thanks,
Steve
The xml file which I am trying to read from :
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<swatches id="CustomColorRangeSwatches">
<colorRangeSwatch>All Blue Colors
<colorRange fixed="True"
red="0" green="0" blue="193"
redMin="0" redMax="0"
greenMin="0" greenMax="0"
blueMin="0" blueMax="255" />
</colorRangeSwatch>
<colorRangeSwatch>All Red Colors
<colorRange fixed="True"
red="183" green="0" blue="0"
redMin="0" redMax="255"
greenMin="0" greenMax="0"
blueMin="0" blueMax="0" />
</colorRangeSwatch>
</swatches>
below.
string expr = "/swatches[colorRangeSwatch='All Red Colors']/colorRangeSwatch/colorRange";
XmlElement crsElement = (XmlElement)m_colorRangeSwatchDoc.SelectSingleNode(expr);
bool fr = bool.Parse(crsElement.GetAttribute("fixed").ToString());
The element returned is always the 1st, All Blue Colors, why doesn't the expression filter on the colorRangeSwatch
value?
Any ideas would be welcome.
Thanks,
Steve
The xml file which I am trying to read from :
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<swatches id="CustomColorRangeSwatches">
<colorRangeSwatch>All Blue Colors
<colorRange fixed="True"
red="0" green="0" blue="193"
redMin="0" redMax="0"
greenMin="0" greenMax="0"
blueMin="0" blueMax="255" />
</colorRangeSwatch>
<colorRangeSwatch>All Red Colors
<colorRange fixed="True"
red="183" green="0" blue="0"
redMin="0" redMax="255"
greenMin="0" greenMax="0"
blueMin="0" blueMax="0" />
</colorRangeSwatch>
</swatches>