You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Suk Tae Kyung <tk...@penta.co.kr> on 2000/09/26 03:16:43 UTC
Document and DocumentImpl
I have problem in creating Node!!!
I'm using Tamino XML Database API.
When i query Tamino, it returns Document reference.
Here, I want to create a Node based on this Document.
Sample code is like this.
////////////////////////////////////////////////////////////
1) TaminoClient tamino = new Tamino("xxxx");
2) TaminoResult tr = tamino.query("xxx");
3) Document document = tr.getDocument();
4) ElementImpl element = new ElementImpl(document, "NEWNODE");
5) TextImpl text = new TextImpl(document, "TextValue");
6) element.appendChild(text);
////////////////////////////////////////////////////////////
1) - 2) is not important. This is just Database defendent.
At 3), I query and the return type is "Document" interface type.
So I should create new Node based on this Document Type.( 4) - 6) )
But this code(4 - 6) is error. Because ElementImpl and TextImpe constructor receives DocumentImpe as
first argument!!( not Document type)
I have been seeking the way to create "Element" based on "Document" not on DocumentImpl.
But i couldn't find it. In contrast, Docuverse dom parser support this function.
Any commit would be helpful. Thanks in advance.