XML schema validation

Hi,

I am trying to validate my xml file with a schema using the TXMLDOMParser, but it does not work. I get the message that no DTD could be found but I do not want to use DTD. This is my code:

TDOMParser Parser;

int nCode = Parser.ParseFile(pstrFileName);

if(nCode != 0)
	throw Exception::CArbitrary(Parser.GetParseCodeMessage(nCode), 0);

This is the head of my xml file:

<?xml version="1.0"?>
<!-- Config file comment-->
<scenario name="default" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="default.xsd">

Other parsers do what I want, so I guess it is a problem of ROOT and not of my xml files.

Thank you for your support.

With best regards,

Philipp

Hi,

we use libxml2 as underlying xml engine. As you can see from the examples in $ROOTSYS/tutorials/xml/DOMParsePerson.C it will find the dtd in the xml file and use that. Probably there has to be set a special xml2 option to use the head of you xml file. If you want to dive into libxml2 and see if you can add this feature to our TDOMParser that would be great. If not please file an issue report and we’ll try to address it at a later stage.

Cheers, Fons.