Why Am I getting MS.Internal.Xml.Xpath.XpathSelectionIterator instead of the value of a text node on this line of code
Dim encoding As New System.Text.UTF8Encoding(True)
Dim reader As New System.IO.StreamReader(temparray(0).ToString, encoding)
Dim x As XPathDocument = New XPathDocument(reader)
reader.Close() '?
Dim nav As XPathNavigator
nav = x.CreateNavigator()
nav.Evaluate("//*[name()='mcd-Lol'][*[name()='mcd-Number' and text()='1'] and *[name()='mcd-Tamanho' and text()='2']]//*[name()='mcd-Den']/text()")
whereas in this online tester http://codebeautify.org/Xpath-Tester it works pwefectly?
The Xml only has text nodes and all with namespaces.
<?xml version="1.0" encoding="UTF-8" ?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
xmlns:mcd="urn:acss:ccf:facturacaoelectronica:schema:xsd:Normalizados">
<ext:UBLExtensions>
<ext:UBLExtension>
<ext:ExtensionVersionID>NormalizadosExtension:1.0</ext:ExtensionVersionID>
<ext:ExtensionContent>
<mcd:NormalizadosExtension>
<mcd:TotalCare>134.49</mcd:TotalCare>
-<mcd:Lol>
<mcd:Number>1</mcd:Number>
<mcd:Tamanho>2</mcd:Tamanho>
<mcd:Area>Z</mcd:Area>
<mcd:TotalCare>124.94</mcd:TotalCare>
-<mcd:Qual>
<mcd:Area>Z</mcd:Area>
<mcd:NumeroQual>1040192667866500</mcd:NumeroQual>
<mcd:Data>2011-11-29</mcd:Data>
-<mcd:Care>
<mcd:NumeroLinha>1</mcd:NumeroLinha>
<mcd:Den>facial</mcd:Den>
<mcd:Quant>1</mcd:Quant>
</mcd:Care>
...
</mcd:Qual>
...
</mcd:Lol>
Thanks