//XPATH With NameSpace
// How you can navigate through XML document, what it contains namespace

XmlDocument objXML = new XmlDocument();
XmlNamespaceManager nsMan = new XmlNamespaceManager(objXML.NameTable);
nsMan.AddNamespace(“cfdi”, “http://www.sat.gob.mx/cfd/3”);
objXML.Load(strFileName);
Node objNode=objXML.SelectNodes(“cfdi:Comprobante”, nsMan);
objXML=null;
objNode=null;

Advertisements