[xsd-users] newly added node not in list?

Boris Kolpackov boris at codesynthesis.com
Tue Apr 11 04:27:14 EDT 2006


Hi Oliver,

Oliver.Kowalke at infineon.com <Oliver.Kowalke at infineon.com> writes:

> the newly added c-node are not recognized if I iterate over the c-list
> of node b_n?

You create a DOM node, not a tree node. None of the modifications to
the underlying DOM document are reflected in the statically-typed
tree. Neither do such modifications get serialized, as I pointed
in one of my previous posts. So you should add your "c" node as a
statically-typed tree node, not a DOM node, if you want it to appear
in the tree structure:


> if ( b_n)
> {
> 	xercesc::DOMElement * c_n = b_n->_node()
> 						->getOwnerDocument()
> 							->createElement(
>
> xml::transcode< char >("c") );

b_n->c_n ().push_back (c_type ());
c_type& new_c = b_n->c_n ().back ();

>
> c_n->appendChild(
> 		c_n->getOwnerDocument()
> 			->createTextNode(
> 				xml::transcode< char >("XML Parsing
> Tools") ) );

The problems start here: new_c does not have a DOM node associated
with it. I suppose I could extend the API to allow manually assigning
DOM nodes to newly created tree nodes. My only concern is how useful
would that be? In other words, once you added the text node to the
new_c's underlying DOM node, what are you going to do with it?

hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060411/b3e08ec5/attachment.pgp


More information about the xsd-users mailing list