libxml, how to validate against a given dtd?

A

Adib Taraben

Hi,

I use libxml in C/C++.
I have an xml-file that has a dtd-definition.
and I have an other dtd that has not the same name as in the xml-file.

How can I validate that xml-file against my local dtd file?

I played around with xmllint but it seems to not work.?
Is there any example for "xmlValidateDtdFinal" function which I think
goes into that direction?
Any hints?

Many thanks,

Adib.
 
P

Patrick TJ McPhee

[...]

% How can I validate that xml-file against my local dtd file?

% I played around with xmllint but it seems to not work.?

What did you try?

xmllint -dtdvalid local.dtd file.xml

ought to do what you want.

% Is there any example for "xmlValidateDtdFinal" function which I think
% goes into that direction?

Look at the handling of dtdvalid in the xmllint.c.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top