![]() Set nlist = doc.selectNodes("//book/Title") Form1 is created by default.įrom the Project menu, click References, and then select the Microsoft XML 3.0 check box.ĭrag a Command button, and drop it onto Form1.Ĭopy and paste the following code in the Click event procedure of the Command button: Dim doc As MSXML2.DOMDocumentĭoc.setProperty "SelectionLanguage", "XPath" Open a new Standard EXE project in Microsoft Visual Basic. Save Books.xml in the root folder of drive C. In Notepad, create a new XML document named Books.xml, and paste the following XML: This article documents a code sample that demonstrates how you can use the contains XML Path Language (XPath) string function to implement this requirement. ![]() When you use the Microsoft XML (MSXML) Document Object Model (DOM) in code to load and parse an XML document, it is common programming practice to identify elements and/or elements with attributes whose data contains a specified string value or word. Original product version: Microsoft XML Original KB number: 304265 Summary This article shows how to use the contains() XPath function when you are programming the MSXML DOM.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |