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 "David Bertoni (JIRA)" <xe...@xml.apache.org> on 2005/04/07 02:56:17 UTC

[jira] Commented: (XERCESC-1402) RemoveChild() gets unexpected undocumented INVALID_CHARACTER_ERR

     [ http://issues.apache.org/jira/browse/XERCESC-1402?page=comments#action_62318 ]
     
David Bertoni commented on XERCESC-1402:
----------------------------------------

First of all, I should point out that passing a pointer as a LONG is a questionable practice, because it is not portable.  It would be far better to use void* (or uintptr_t if your compiler supports it), if you don't want to expose the Xerces-C types.

That said, we will need a complete, minimal sample which we can use to reproduce this.  There is no place in the current code where removeChild() throws a DOMException with the code INVALID_CHARACTER_ERR, so my best guess is you are getting a bogus pointer and the wrong virtual member function is being called.

Have you tried debugging into the call to removeChild() to see what is actually happening?  You might also want to upgrade to the latest version of Xerces-C to see if that makes any difference.

> RemoveChild() gets unexpected undocumented INVALID_CHARACTER_ERR
> ----------------------------------------------------------------
>
>          Key: XERCESC-1402
>          URL: http://issues.apache.org/jira/browse/XERCESC-1402
>      Project: Xerces-C++
>         Type: Bug
>   Components: DOM
>     Versions: 2.5.0
>  Environment: Windows XP 200 SP 2
> MS Visual C++ 6.0
>     Reporter: Christopher Condit
>     Priority: Minor
>  Attachments: screenshot-1.jpg
>
> This code called to remove a child, throws INVALID_CHARACTER_ERR
> // REMOVE CHILD
> LONG dom_removeChild(LONG inParentNode, LONG inChildNode) {
>   DOMNode* myParent = (DOMNode*)inParentNode;
>   DOMNode* myChild  = (DOMNode*)inChildNode;
>   DOMNode* myNodeOut;
>   try {
>     myNodeOut = myParent->removeChild(myChild);
>   } catch (DOMException& e) {
>     // do something
>     return(0);
>   }
>   return((LONG)myNodeOut);
> }
> Such an exception is undocumented and appears inappropriate, given the absence of any character parm.
> Walking through code, both parms look valid.  DOM document has been loaded from a file that I know is valid.  The parent in this case is an element that I know was validly added to said DOM via CreateElement().  All data is created, fetched, and used just fine, but when I am done with it, the RemoveChild() fails.  Above example style of handle handling has been used successfully in countless other instances.
> Thanks, CXC

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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