Hannes Magnusson wrote:
On Sat, Nov 21, 2009 at 02:12, Hannes Magnusson
<hannes.magnus...@gmail.com> wrote:
On Tue, Nov 17, 2009 at 18:31, Daniel Veillard <veill...@redhat.com> wrote:
On Tue, Nov 17, 2009 at 05:03:41PM +0100, Murray Cumming wrote:
On Tue, 2009-11-17 at 14:24 +0100, Daniel Veillard wrote:
On Tue, Nov 17, 2009 at 01:33:44PM +0100, Murray Cumming wrote:
Should I be able to validate an XML document (such as a .glade file)
that has no DOCTYPE line, and therefore doesn't specify a DTD?

When I try it with xmllint, I get this error
  validity error : Validation failed: no DTD found !
even when I have specified a local DTD with --dtdvalid.
  Works for me with the version from git head:
Thanks. I was actually using
  xmllint --valid --dtdvalid mydtd.dtd mydoc.xml

So is --dtdvalid an alternative to --valid rather than a way of using
--valid?
 and alternative, as DTD validation as defined in the XML-1.0 spec
is --valid i.e. validating as parsing based on DOCTYPE contained in
the document, and --dtdvalid is just a different kind of validation
closely related, but certainly different, and in subtle case you may
see different results (but in general it will be the same !)

I did not know that.
This doesn't however seem to be implemented in PHP, Rob... :)

Is this something we can implement? Pretty-please? :)

AFAICT it could help us _massively_ when rendering "standalone
extension" (and possibly per-file) in the documentations.
The "root file" (manua.xml) could still have the DTD attached, but
when rendering a standalone book (extension/reference) we could simply
attach the DTD via "dtdvalid" to get the entities defined in the DTD
(all our snippets) and validate it.


Actually, I just tried it with xmllint.
--dtdvalid doesn't inject the referenced dtd into the doc so entities
aren't "copied over", its pure validation against the dtd :(

Rob: You wouldn't happen to know of any neat "workarounds" for that?


I just cant find any decent way to do this. Using that flag just causes xmllint to build then doc and then do a validation against the DTD. There is no function to allow an external DTD to be passed to the parser while the document is built, which is where it's needed. I'll still poke around a bit to see if there is any other way to get it to work, but not holding my breath.

Rob

Reply via email to