XML file:
Now, I hope to make a fuzzy query for the "name". When I entered: "Li", I will show all the information on the name Li, please help the guides, it is best to have source code, thank you! Solution 1: System.xml.xmldocument x = new system.xml.xmldocument (); x.load (server.mappath ("x1.xml")); system.xml.xmlnodelist nodes = x.selectNodes ("////// "); Foreach (system.xml.xmlnode y in nodes) {if (Y.INNNERTEXT.INDEXOF (" Li ")> -1) Response.write (Y.INNERTEXT);} Solution 2: System.xml. XmlDocument doc = new system.xml.xmldocument ();
Doc.Load ("File: /// D: / Test.xml");
Foreach (system.xml.xmlnode n in doc.documentelement.selectnodes ("Person [Contains (Name, 'Lee')]") {messagebox.show (n.innerxml);}