|
-
Dec 21st, 2001, 11:04 PM
#1
Thread Starter
Member
Validating some XML against a DTM / Schema?
Hello All.
I have a program that accepts some XML.
Now, this program can accept ANY STRING, which is bad.
I wish to check the input string by loading it into an XML Dom, and seeing if it's parsed ok. [This i can do].
If it's parsed ok, i need to check to see if the XML content conforms to my XML Schema / DTD (so i know they have passed well parsed, and well comformed XML).
How do i check if the well parsed XML is WELL COMFORMED?
How do i check the XML against an XML Schema / Dtd?
Thank you for any help, and Merry X-Mas 
-Pure Krome-
-
Jan 3rd, 2002, 09:58 AM
#2
Member
Using MS XML Parser v4.0, You can instantiate a DOMDocument40 object and the document's parseError property will expose well-formedness against any internal DTDs. If you use External DTDs then you must use the resolveExternal method. In the case of Schemas, you can instantiate a SchemaCache40 object and valdate against it.
For more info see:
msdn online
Cheers,
DJ
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|