Hi David,
Unsing the Xerces DOM all the function calls new complete but the
nodes returned from create element don't seem to be well formed (can't
be dumped with my dumper routine like everything else could) and none
of the updates appear in the output tree generated by the FormaterToXML
and FormatterTreeWalker.
My initialization goes like this:
// snip...
XalanSourceTreeInit theSourceTreeInit;
XercesDOMSupport theDOMSupport;
XercesParserLiaison theLiaison(theDOMSupport);
XalanDocument *theDocument;
const LocalFileInputSource *theInputSource;
XPathEvaluator theEvaluator;
XalanNode* pTheContextNode;
XMLPlatformUtils::Initialize();
XPathEvaluator::initialize();
pTheInputSource = new LocalFileInputSource(
c_wstr(XalanDOMString(filename.c_str())));
// Parse the document...
theDocument =
theLiaison.parseXMLStream(*pTheInputSource);
// OK, let's find the context node...
pTheContextNode =
theEvaluator.selectSingleNode(
theDOMSupport,
theDocument,
XalanDOMString("/blah").c_str(),
theDocument->getDocumentElement());
Then I go on to create elements through the DOM document interface but
the nodes don't look bonafide and no changes seem to update in the DOM
when it's output by the Formatter. (the number of children of a given
node change though they can't be printed.)
Any clue would be greatly appreciated. Or a pointer to a sample that
programattically adds nodes to an existant xerces DOM. (something
that uses createElement and appendChild) The cases I've been able to
track down through google (in java) arn't giving me a clue as to what
wires could be crossed.
Thanks.
-R
David N Bertoni/Cambridge/IBM writes:
>
>
>
>
> Hi Russell,
>
> > David,
> > One more thing. Can't seem to find the
> TransformToXercesDOM
> > sample (In either the Xerces or Xalan trees). Am I looking in the
> > right place? (or tree?) Thanks again. -R
>
> You need the latest sources from CVS. If you've been getting your sources
> from the CVS repository, you should make sure you use the -d option when
> you update. If you're using a CVS tarball, get a new one.
>
> Dave