How to use the righ syntax for XPathNodeIterator.Select()?

D

dmitry.boyko

Hi all!

I have some Web Service that return the DataSet with the follow
structure

*******************************
</dfs:queryFields>\r\n\t<dfs:dataFields>\r\n\t
\t<tns:GetCustomersResponse>\r\n\t\t\t<tns:GetCustomersResult>\r\n\t\t
\t\t<ns1:DataSet1>\r\n\t\t\t\t\t<ns1:FichaInternaPrincipal xmlns:ct=
\"http://schemas.microsoft.com/office/infopath/2003/changeTracking\"
ct:OdPOsq=\"0\" diffgr:hasChanges=\"inserted\">\r\n\t\t\t\t\t
\t<ns1:ID>0</ns1:ID>\r\n\t\t\t\t\t\t<ns1:Cliente></ns1:Cliente>\r\n\t\t
\t\t\t\t<ns1:OrdenCompraNo></ns1:OrdenCompraNo>\r\n\t\t\t\t\t
\t<ns1:CotizacionNo></ns1:CotizacionNo>\r\n\t\t\t\t\t
\t<ns1:proyectoNo></ns1:proyectoNo>\r\n\t\t\t\t\t
\t<ns1:Fecha>2008-04-28</ns1:Fecha>\r\n\t\t\t\t\t\t<ns1:Contacto></
ns1:Contacto>\r\n\t\t\t\t\t\t<ns1:Vendedor></ns1:Vendedor>\r\n\t\t\t\t
\t\t<ns1:Modalidad></ns1:Modalidad>\r\n\t\t\t\t\t
\t<ns1:MonedaFacturacion>$U</ns1:MonedaFacturacion>\r\n\t\t\t\t\t
\t<ns1:CondicionesComerciales></ns1:CondicionesComerciales>\r\n\t\t\t\t
\t\t<ns1:CostoFOBEst>0</ns1:CostoFOBEst>\r\n\t\t\t\t\t
\t<ns1:CostoPZAEst>0</ns1:CostoPZAEst>\r\n\t\t\t\t\t
\t<ns1:pDEVentaEst>0</ns1:pDEVentaEst>\r\n\t\t\t\t\t
\t<ns1:MargenEst>NaN</ns1:MargenEst>\r\n\t\t\t\t\t
\t<ns1:CostoFOBReal></ns1:CostoFOBReal>\r\n\t\t\t\t\t
\t<ns1:CostoPZAReal></ns1:CostoPZAReal>\r\n\t\t\t\t\t
\t<ns1:pDEVentaReal></ns1:pDEVentaReal>\r\n\t\t\t\t\t
\t<ns1:MargenReal>NaN</ns1:MargenReal>\r\n\t\t\t\t\t
\t<ns1:Terminado>false</ns1:Terminado>\r\n\t\t\t\t\t\t<ns1:Comision></
ns1:Comision>\r\n\t\t\t\t\t\t<ns1:FacturaNo></ns1:FacturaNo>\r\n\t\t\t
\t\t\t<ns1:RemitoNo></ns1:RemitoNo>\r\n\t\t\t\t\t
\t<ns1:plazaUnitCoeficiente>555</ns1:plazaUnitCoeficiente>\r\n\t\t\t\t
\t\t<ns1:FichaInternaDetallado ct:OdPOsq=\"1\" diffgr:hasChanges=
\"inserted\">\r\n\t\t\t\t\t\t\t<ns1:ID>1</ns1:ID>\r\n\t\t\t\t\t\t
\t<ns1:FichaInternaPrincipalID>0</ns1:FichaInternaPrincipalID>\r\n\t\t
\t\t\t\t\t<ns1:prov></ns1:prov>\r\n\t\t\t\t\t\t\t<ns1:Cat></ns1:Cat>\r
\n\t\t\t\t\t\t\t<ns1:Qty></ns1:Qty>\r\n\t\t\t\t\t\t
\t<ns1:Descripcion></ns1:Descripcion>\r\n\t\t\t\t\t\t\t<ns1:FOBUnit></
ns1:FOBUnit>\r\n\t\t\t\t\t\t\t<ns1:FOBSubT>0</ns1:FOBSubT>\r\n\t\t\t\t
\t\t\t<ns1:plazaUnit>0</ns1:plazaUnit>\r\n\t\t\t\t\t\t
\t<ns1:plazaSubT>0</ns1:plazaSubT>\r\n\t\t\t\t\t\t\t<ns1:VentaTot></
ns1:VentaTot>\r\n\t\t\t\t\t\t</ns1:FichaInternaDetallado>\r\n\t\t\t\t
\t</ns1:FichaInternaPrincipal>\r\n\t\t\t\t</ns1:DataSet1>\r\n\t\t
\t<_xdns0:eek:riginalData xmlns:ct=\"http://schemas.microsoft.com/office/
infopath/2003/changeTracking\" ct:idCount=\"2\" ct:idName=\"OdPOsq\"
_xdns0:FichaInternaPrincipal_IDAutoIncrement=\"0\"
_xdns0:FichaInternaDetallado_IDAutoIncrement=\"1\"><ns1:DataSet1></
ns1:DataSet1></_xdns0:eek:riginalData></tns:GetCustomersResult>\r\n\t\t</
tns:GetCustomersResponse>\r\n\t</dfs:dataFields>\r\n</dfs:myFields>"

*******************************

And I want to set values into repeating table. But I have erorr
there.

XPathNavigator domNav = MainDataSource.CreateNavigator();
XPathNodeIterator rows = domNav.Select(
"/dfs:dataFields/tns:GetCustomersResponse/
tns:GetCustomersResult/ns1:DataSet1/ns1:FichaInternaDetallado/
ns1:plazaSubT", NamespaceManager);
int cnt = rows.Count;

while (rows.MoveNext()) <<<------- I have error.
{
//...... some code
}


I think becouse use wraing syntax.

"/dfs:dataFields/tns:GetCustomersResponse/tns:GetCustomersResult/
ns1:DataSet1/ns1:FichaInternaDetallado/ns1:plazaSubT"

But where is? Pls. help to resolve it.


Thanks a million!!!!!!!!!!!!!!!
 
G

Gavin McKay

Hello,

Can you please supply the error detail you are getting? I think it will be
tough to help you unless we know what the issue is.

Gavin.
 
Top