Thursday, June 30, 2011

Select-Xml and nested XPath evaluations

Recall that

worked but

failed with error messages showing that the current iterated value has an XML string representation.

An alternative fix is to explicitly cast the subject of the inner XPath selection to XML, thus

though surprisingly

fails to yield any results from the inner search; and I've not so far determined why. Replacing the final $_.Node by [xml] $_ of course fails because False is not an XML document.

No comments :