ParseFile Method
See Also Example Applies To
Gets a local XML file and may check the document is well formed and valid.
Syntax
object.ParseFile (FileName, CheckWellFormed)
| Part |
Description |
| object |
An object expression that evaluates to an XMLDOMParser object. |
| FileName |
Required. A string with the name of the local file to parse. |
| CheckWellFormed |
Optional. A boolean that defines whether the parser should check the XML is "well formed". Defaults to True, i.e. will check the document is well-formed. |
Remarks
The default behaviour of this method is to check the document is well formed. The validation against a DTD is determined by the ValidationRule property.
Background
There are two checks that can be carried out on an XML file,
the first is to check the document is "well formed",
this means does it have all open tags closed, only one root element etc.
The second check is "is it valid",
this can be carried out by checking against a DTD and/or a schema. DTD validation checks that the right elements are in the right place.
This method uses simple visual basic file access functions and therefore is restricted to files on local or mapped drives.
This method actually loads the contents of the file into a string and then passes it to the ParseString method for well formed and validation checks.
|