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 "Lumir Vanek (JIRA)" <xe...@xml.apache.org> on 2005/12/13 09:44:46 UTC

[jira] Commented: (XERCESC-1535) DOMCountErrorHandler::handleError - Report wrong error node in domError.getLocation()->getErrorNode()

    [ http://issues.apache.org/jira/browse/XERCESC-1535?page=comments#action_12360285 ] 

Lumir Vanek commented on XERCESC-1535:
--------------------------------------

Update: 

DOMCountErrorHandler is class name in my testing code (I useDOM count sample). Affected class is DOMErrorHandler of course.

Lumir Vanek

> DOMCountErrorHandler::handleError - Report wrong error node in domError.getLocation()->getErrorNode()
> -----------------------------------------------------------------------------------------------------
>
>          Key: XERCESC-1535
>          URL: http://issues.apache.org/jira/browse/XERCESC-1535
>      Project: Xerces-C++
>         Type: Bug
>   Components: Validating Parser (DTD)
>     Versions: 2.7.0
>  Environment: Windowx XP, SuSE Linux 9.2
>     Reporter: Lumir Vanek

>
> I have XML+DTD and this XML is not valid against DTD:
> <?xml version="1.0" encoding="utf-8" ?> 
> <!DOCTYPE note [
>   <!ELEMENT note (to,from)>
>   <!ELEMENT to      (#PCDATA)>
>   <!ELEMENT from    (#PCDATA)>
> ]>
> <note><to>Tove</to><from not_declared="xxx">Jani</from></note>
> Element "from" contain undeclared attribute. Now I open XML and see what DOMCountErrorHandler::handleError says:
> --- C code begin:
> bool DOMCountErrorHandler::handleError(const DOMError& domError)
> {
> XERCES_STD_QUALIFIER cerr << "\n  Message: " << StrX(domError.getMessage()) 
> 		 << "\n node name: " << StrX(domError.getLocation()->getErrorNode()->getNodeName())
> 		 << XERCES_STD_QUALIFIER endl;
> }
> --- C code end
> Output is:
> Message: Attribute 'not_declared' is not declared for element 'from' <<--- This is true
> node name: to <<--- Reported wrong node name !!!
> As you may see, function domError.getLocation()->getErrorNode() don't return node where error occured, but their sibling DOM node.
> Lumir Vanek

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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