Hi
Can I do this with one XPath? If I have "layer1" and "layer2" ....
Layers/Layer[@Name=\"layer1\"] <---- This has to be true. But also ....
Layers/Layer/SnapNames/SnapName[@Name=\"layer2\"] <---- This has to be true
I did it like this:
// Find main node XmlNode nodeLayer = xmlOrbis.SelectSingleNode(String.Format("Layers/Layer[@Name=\"{0}\"]", strLayer)); if(nodeLayer != null) { String strLayer2 = m_dictLayers[pSegment2.layerID]; XmlNode nodeLayer2 = xmlOrbis.SelectSingleNode(String.Format("SnapsNames/SnapName[@Name=\"{0}\"]", strLayer2)); if(nodeLayer2 == null) { } }
Can I simplify it into one call? Something like:
XmlNode nodeLayer = xmlOrbis.SelectSingleNode(String.Format("Layers/Layer[@Name=\"{0}\"]/SnapNames/SnapName[@Name=\"{1}\"]", strLayer, strLayer2));
I don't know if that is viable ...
Andrew