Dashboard > Public Content > ... > ExcelVBA > Get An XPath
  Public Content Log In   View a printable version of the current page.  
  Get An XPath
Added by James Richardson, last edited by James Richardson on Jun 28, 2006
Labels: 
(None)

Function getXPathStringFromDocument(document As DOMDocument, xpath As String, default As String) As String 
     
    Dim node As MSXML2.IXMLDOMNode 
     
    Set node = document.selectSingleNode(xpath) 
     
    If (node Is Nothing) Then 
        getXPathStringFromDocument = default 
        Exit Function 
    End If 
     
    getXPathStringFromDocument = node.Text 
End Function
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.1 Build:#806 May 06, 2007) - Bug/feature request - Contact Administrators