You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Chris Coble <cc...@sonicdesktop.com> on 2002/10/03 21:45:53 UTC

MapNode no longer works when building bridge?

Hi Dave,

I'm compiling Xerces and Xalan myself now, which allows me to step into
the framework code.  :)  It's easy like you said.

Based on your recent bug fix for me
(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13225 ) you suggested
when creating the Xalan wrapper around Xerces that I call createDocument
like so:

createDocument( m_cXercesDOMDoc, false, true );

to create the bridge.  I have done that, but it had a nasty side effect
of making map node calls fail when trying to convert XalanNode pointers
to DOM_Node objects.  So, a piece of code like the following is no
longer working:

// Open and read the XML file using xerces occurs here.

XalanDocument *pXalanDOMDoc = pXercesParserLiaison->createDocument(
cXercesDOMDoc, false, true );

XercesDocumentBridge *pXercesDocBridge = pXalanDOMDoc->mapDocument(
pXalanDomDoc );

XalanNode *pNode = pXalanDOMDoc->getFirstChild();

//throws exception because returned node would be null
DOM_Node = pXercesDocBridge->mapNode( pNode );


The code works fine if I don't build the bridge in createDocument().  

I'm storing DOM_Node's in my classes so I'm not left with invalid
XalanNode pointers if I have to recreate the bridge because of changed
XML in the xerces DOM, so performing XPATH searches and converting those
pointers to DOM_Node's is essential.

Any suggestions?

-Chris Coble