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 Hugo Kotsubo <hu...@tendencies.com.br> on 2003/12/04 21:01:43 UTC

how to create a DOMElement

Hi

I'm trying to create a DOM tree with on-the-fly data.
But there's no way to create a DOMNode of type DOMElement with "new" 
operator..

I tried to create a dummy document with a single tag, parse it and get 
the root node
with doc->getDocumentElement(), where doc is a DOMDocument object.
After that, I tried to use the cloneNode() method, but after that I 
can't modify the name of the
clone node (there's no setName-like function)

So, how can I create the DOM tree?

tks
Hugo


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


Re: how to create a DOMElement

Posted by "Jeroen N. Witmond" <jn...@xs4all.nl>.
Hi,

If I understand you correctly, one way to create a DOMElement is to create
a DOMDocument and use its doc->createElement() member. See  file
xerces_c/samples/CreateDOMDocument/CreateDOMDocument.cpp

Regards,

Jeroen.

> Hi
>
> I'm trying to create a DOM tree with on-the-fly data.
> But there's no way to create a DOMNode of type DOMElement with "new"
> operator..
>
> I tried to create a dummy document with a single tag, parse it and get
> the root node
> with doc->getDocumentElement(), where doc is a DOMDocument object.
> After that, I tried to use the cloneNode() method, but after that I
> can't modify the name of the
> clone node (there's no setName-like function)
>
> So, how can I create the DOM tree?
>
> tks
> Hugo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>
>

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