Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: urgent: validating XML syntax using VC++

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 4/2/2007 1:48:00 PM

sanoj.varghese@g... wrote:

> I have an XML file which needs to be validated using VC++, not against
> the schema, BUT AGAINST THE TAGS. I need to check for start <>and end
> </>tags to see whether the XML is of proper format or not. How can i
> implement this. Can anyone provide some piece of code or ideas leading
> to a solution for this problem.

If you parse the XML document with an XML parser it will tell whether 
the XML is well-formed or not as the XML parser reports errors it finds.

With C++ you can use MSXML, any MSXML version (e.g. MSXML 3 or MSXML 6 
can do well-formedness checks), see the MSXML SDK
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/b24aafc2-bf1b-4702-bf1c-b7ae3597eb0c.asp>
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/14e70ac1-b724-498e-b6e1-7e3e1ae7bb6e.asp>
you simply need to call the load method of a DOMDocument and check the 
parseError.errorCode property.

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent