[xmlsec] building without DTD validation support in libxml

Daniel Veillard veillard at redhat.com
Thu May 12 08:10:34 PDT 2005

On Thu, May 12, 2005 at 09:58:10AM -0400, Rich Salz wrote:
> >  you need to parse the DTD to have attribute defaultingi which are
> >a requirement for the XPath data model.
> Section 5.2.1 of the XPath spec has a NOTE that says "If a document does 
> not have a DTD..."  So I don't think a DTD is required.

  it's a requirement for an XPath *implementation* . You don't need a DTD
to use XPath obviously. You need DTD parsing support to implement a
conformant XPath implementation.

> (This brings up my old issue, of course, since the second part of the 
> note says that without a DTD no element will have a unique ID.  But how 
> you're supposed to handle that when XPath also requires namespaces is, I 
> guess, left as an exercise for the implementor.)

  You're mixing issues completely here. The following is not related to
the previous messages in that thread.

  You can use DTD and namespaces, just that DTD are not namespace aware.
  Libxml2 is namespace aware. It implements DTD. You can mix both without
  problem and use XPAth to process such document obviously. I think all
  XML implementors found that, it's a no brainer. It's a bit harder for
  language designers because they need to freeze the namespace prefix
  in their DTD (or play tricks with parameter entities), but it does work.

  The separate problem that IDNESS requires a DTD is precisely why we
  are designing xml:id and plugging it between the parser and upper layers
  of the stack like XPath.


Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

More information about the xmlsec mailing list