Hi;
We have a TreeView that represents an xml file (or it's schema is a more
accurate statement). We want to have a double click on a node in the tree
generate the XPath to get to that node.
For the full tree it's easy. We walk up the parents getting the name of each
node and put a / between each so we end up with /node1/node2 or
node1/node2/@attr1
Questions on this case:
1) should we start with /node1 or self::/node1?
2) if they click on the root should we use "self::" or "/"?
We also have cases where we have a tree from a SelectNodes() and then want
to handle a select from that. It seems to me that this case is no different -
that in one case we have an XmlDocument and the other an XmlNodeList. But an
XmlDocument is an XmlNode so is there a difference that matters between an
XmlNode and an XmlNodeList?
And if so, what should be the root of the xpath we create in this case?
--
thanks - dave
david_at_windwa rd_dot_net
Cubicle Wars - http://www.windwardreports.com/film.htm
We have a TreeView that represents an xml file (or it's schema is a more
accurate statement). We want to have a double click on a node in the tree
generate the XPath to get to that node.
For the full tree it's easy. We walk up the parents getting the name of each
node and put a / between each so we end up with /node1/node2 or
node1/node2/@attr1
Questions on this case:
1) should we start with /node1 or self::/node1?
2) if they click on the root should we use "self::" or "/"?
We also have cases where we have a tree from a SelectNodes() and then want
to handle a select from that. It seems to me that this case is no different -
that in one case we have an XmlDocument and the other an XmlNodeList. But an
XmlDocument is an XmlNode so is there a difference that matters between an
XmlNode and an XmlNodeList?
And if so, what should be the root of the xpath we create in this case?
--
thanks - dave
david_at_windwa rd_dot_net
Cubicle Wars - http://www.windwardreports.com/film.htm
Comment