[xsd-users] newly added node not in list?
boris at codesynthesis.com
Tue Apr 11 07:36:38 EDT 2006
Oliver.Kowalke at infineon.com <Oliver.Kowalke at infineon.com> writes:
> I would add some special functions (templated) which allow access to the
> content of an xsd:any node (already working -> c_type). Adding such a
> node to the statically typed tree (no matter if it was parsed from a
> file or created from classes of the tree) is the problem I want to
> If I understand your last notice your solution would solve the problem
> (I hope).
Ok, I've added the ability to set DOM nodes for tree nodes. You will
need to replace your libxsd/xsd/cxx/tree/elements.hxx with this one:
For restrictions see comment before the _node(DOMNode*) function in the
file above. Using this function, you will be able to write something
b_type& b_n = ... // parsed with keep_dom
using namespace xercesc;
DOMDocument* doc = b_n._node ()->getOwnerDocument();
b_n.c ().push_back (c_type ()); // Create new tree node.
c_type& c_n = b_n.c ().back (); // Get ref to the new node.
DOMElement* c_dom_n = doc->createElement(
xml::transcode< char >("c")); // Create a dom node for the new tree node.
b_n._node ()->appendChild (c_dom_n); // Add to our parent.
c_n._node (c_dom_n); // Establish association.
doc->createTextNode(xml::transcode< char >("XML Parsing Tools")));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060411/c5c2f4d2/attachment.pgp
More information about the xsd-users