You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by kb...@informatica.com on 2001/01/04 23:28:35 UTC

RE: Problem with ReuseValidator

I looked at the latest code from the CVS repository.

Esstentially, after findAttr is called, attDef is NULL.

So in the else code, fValidate and fReuseValidator will be true and the call
to attDef->getReason() will crash.

Can you please let me know if this was the fix....

Kiran


------------------------------
		else
            {
               // If we are reusing validator and this attribute was
faulted-in,
               // then emit an error
               if (fValidate)
               {
                  if (fReuseValidator &&
attDef->getCreateReason()==XMLAttDef::JustFaultIn)
                  {
                      //reset the CreateReason to avoid redundant error
                      attDef->setCreateReason(XMLAttDef::NoReason);

                      fValidator->emitError
                      (
                          XMLValid::AttNotDefinedForElement
                          , fAttNameBuf.getRawBuffer()
                          , elemDecl->getFullName()
                      );
                   }
                }
            }
------------------------------------

-----Original Message-----
From: tng@ca.ibm.com [mailto:tng@ca.ibm.com]
Sent: Wednesday, January 03, 2001 1:43 PM
To: xerces-c-dev@xml.apache.org
Subject: Re: Problem with ReuseValidator (was Re: Problems with XML4C
source archive for UNIX)



I think this has been fixed in the latest Xerces-C code.  Please download
the latest package (http://xml.apache.org/dist/xerces-c/nightly/) and try
again.  Please let me know if problem persists.

Thanks!

Tinny

>kbagepalli@informatica.com wrote:
>
>  I am facing a problem with the reusevalidator code for xerces 1.3.
>
>  In XMLScanner::scanStartTag()
>
>  After XMLAttDef* attDef = elemDecl->findAttr....
>
>          It checks the code if it was added. Else there is a no code
which
>  throws an exception.
>          So I added
>          if (wasAdded)
>          {
>          }
>          //START
>          else
>          {
>                  if (!attDef)
>                  {
>               fValidator->emitError
 >                 (
>                          XMLValid::AttNotDefinedForElement
>                   , fAttNameBuf.getRawBuffer()
>                   , elemDecl->getFullName()
>                  );
>                  }
>          }
>          //END
>
>  Can somebody verify if this is correct and fix this in the source
system.
>
>  Thanks
>
>  Kiran



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org