Returns the URL for the last loaded XML document.
var objurl = objXMLDOMDocument.url;
The following script example creates a DOMDocument and displays the value of its url property.
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.5.0");
xmlDoc.async = false;
xmlDoc.load("books.xml");
if (xmlDoc.parseError.errorCode <> 0) {
var myErr = xmlDoc.parseError;
alert("You have error " + myErr.reason);
} else {
alert(xmlDoc.url);
}
Set objurl = objXMLDOMDocument.url
The following Microsoft® Visual Basic® example creates a DOMDocument and displays the value of its url property.
Dim xmlDoc As New Msxml2.DOMDocument50
xmlDoc.async = False
xmlDoc.Load ("books.xml")
If (xmlDoc.parseError.errorCode <> 0) Then
Dim myErr
Set myErr = xmlDoc.parseError
MsgBox("You have error " & myErr.reason)
Else
MsgBox xmlDoc.URL
End If
HRESULT get_url(
BSTR *urlString);
urlString parameter is Null.String. The property is read-only. It returns the URL from the last successful load. If the document is being built in memory, this property returns Null.
The url property is not updated after saving a document with the save method. To update the url property, reload the document using the load method.
This member is an extension of the Worldwide Web Consortium (W3C) Document Object Model (DOM).
To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button
in the upper-left corner of the page.
Applies to: DOMDocument