Re: Flat searching in XML document - 08-04-2006 , 08:47 AM
and SelectSingleNode meaning many such tasks like the one described
above could be "implementing" by delegating to a SelectSingleNode call
with the proper XPath expression e.g.
SelectSingleNode("//*[@" + attrName + " = '" + attrValue + "']")
In reality you have some more work to prevent errors when e.g. attrValue
contains a single quote '. But I hope you get the idea.
There is of course also the problem with XML with namespaces where the
attribute name could be a qualified name with prefix, colon, and local
name, if you really want to solve that in general then you need to take
that into account as well.
Martin Honnen --- MVP XML
|Thread Tools||Search this Thread|