You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Mark Brucks <br...@j3s.us> on 2003/03/31 19:44:22 UTC

error modifying document within acceptNode method

I'm using the aceptNode method (DOMBuilderFilter) to handle special 
content during parsing.  According to the documentation, it is legal to 
modify the node within the method.  I am trying to add a new #TEXT child 
node, but getting an error trying to create the new text node that I 
want to add (using Document.createTextNode() to create the new node).

This error causes handleError to be invoked, but the problem is that 
DOMError.getMessage() returns a null string, so I can't tell what the 
real problem is.

Should I expect createTextNode() to work before parsing of the document 
is complete?  Are there any restrictions on document modification from 
within acceptNode()?

Thanks - Mark Brucks


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


Re: error modifying document within acceptNode method

Posted by Mark Brucks <br...@j3s.us>.
DOH!

Sorry all - if you took the time to read the original post you probably 
realized that I can't call the createTextNode method until after parsing 
is complete (parsing returns the Document object, which implements the 
createTextNode method).

I'd like to say it was lack of sleep or the alignment of the stars, but 
I can't.

Mark Brucks

Mark Brucks wrote:

> I'm using the aceptNode method (DOMBuilderFilter) to handle special 
> content during parsing.  According to the documentation, it is legal 
> to modify the node within the method.  I am trying to add a new #TEXT 
> child node, but getting an error trying to create the new text node 
> that I want to add (using Document.createTextNode() to create the new 
> node).
>
> This error causes handleError to be invoked, but the problem is that 
> DOMError.getMessage() returns a null string, so I can't tell what the 
> real problem is.
>
> Should I expect createTextNode() to work before parsing of the 
> document is complete?  Are there any restrictions on document 
> modification from within acceptNode()?
>
> Thanks - Mark Brucks
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>
>



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