Validating a dtd
Stylus Studio® automatically detects any changes in the associated DTD, eliminating the need to manually refresh so you know your code will always be accurate.
In the following illustration, Stylus Studio®'s real-time syntax checking has reported an error with the element this element is not defined in its respective Document Type Definition, so it is highlighted in orange during editing, and it is reported in the output window at the time the XML is validated.
In Java, I can validate an XML document against an XSD schema using validation.Echo vb Cr Lf & _ "About:" & Chr(9) & "is an XML file validator." & vb Cr Lf & _ vb Cr Lf & _ "Syntax:" & Chr(9) & "msval [input_file_or_folder]" & vb Cr Lf & _ vb Cr Lf & _ "Examples:" & vb Cr Lf & vb Cr Lf & _ Chr(9) & "msval my.xml" & vb Cr Lf & _ Chr(9) & "msval C:\My Folder Containing XML" & vb Cr Lf & _ Chr(9) & "msval ..\..\My Folder Containing XML" & vb Cr Lf & vb Cr Lf & _ "Notes:" & Chr(9) & "If XML file is specified, results are " & _ "returned in a console message." & vb Cr Lf & vb Cr Lf & _ Chr(9) & "If a folder is specified, a report file, Msval.txt," & _ " is generated" & vb Cr Lf & _ Chr(9) & "on your desktop and validation results are recursive" & _ " for XML" & vb Cr Lf & _ Chr(9) & "files found in the specified folder and all of its" & _ " subfolders." & vb Cr Lf Exit Sub End Sub Sub Error Out Wscript. Open Text File(s Log Path, Open File For Appending) str Result = vb Cr Lf & Lineof Equals & _ "Processing completed at " & Now & vb Cr Lf & _ proc Files Count & " files processed" & vb Cr Lf & _ Line Of Equals f. Close str Result = "Results written to " & s Log Path & vb Cr Lf & _ "Files processed: " & proc Files Count & vb Cr Lf & _ vb Cr Lf & "Do you want to view the results now? Item(0) f Spec = f Spec & "\" Else Show Help WScript. Echo (vb Cr Lf & "Status: MSVAL failed." vb Cr) Wscript. " Msg Box str Result, vb Yes No, "MSVAL: Processing completed" If vb Yes Then Wsh Shell. If I'm not mistaken, this was one of the impetuses driving the switch from DTD to more modern validation mechanisms.I don't want to do anything fancy, I just want to make sure a document is valid, and print an error message if it is not.