[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [xml] Unexpected behavior parsing notations



On Wed, Mar 14, 2001 at 02:26:20PM +0100, Paolo Casarini wrote:
> Then I've this code:
> xmlDoValidityCheckingDefaultValue = 1;
> doc=xmlParseFile("test-dtd.xml");

 To provide feedback it's better to show what xmllint does.
In this case xmllint --valid --debug test-dtd.xml

> Now the doc struct have the intSubset and the extSubset fields !=
> NULL. Why? I've specified only external DTD.

  The internal subset field carries the system and public ID.

> The extSubset has elements and entities fields != NULL, right. But the
> notations field is NULL. Where are my notations?
> I can find my notations in the notations field of intSubset. Why?

  Because there was a bug in the SAX handler which was registering
them at the wrong place. Patch enclosed.

Daniel

P.S.: I have yet to see *any* real use of XML notations, that part is
      not used as far as I can tell.

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
*** SAX.c	2001/03/07 19:45:40	1.52
--- SAX.c	2001/03/14 13:50:54
***************
*** 584,590 ****
  	nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, name,
                                publicId, systemId);
      else if (ctxt->inSubset == 2)
! 	nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, name,
                                publicId, systemId);
      else {
  	if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
--- 584,590 ----
  	nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, name,
                                publicId, systemId);
      else if (ctxt->inSubset == 2)
! 	nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->extSubset, name,
                                publicId, systemId);
      else {
  	if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]