You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Melissa Yang <me...@worldstream.com> on 2001/03/14 01:21:20 UTC

Converting a Xerces DOM_Node to XalanNode

Hi,
Hope you can help me on this.  I tried to convert a Xerces DOM_Node to
XalanNode in Xalan 1.1 on Win2K and used the way recommended.  However, I
got an assertion failure and the process crashed.  Here is what my code
looks like.   What did I miss here?  
	DOMParser parser;
	parser.parse( "input.xml" );
	DOM_Document doc = parser.getDocument();
	DOM_Node node = doc.getFirstChild();
    	XercesDOMSupport domSupport;
	XercesParserLiaison xercesParserLiaison( domSupport );
	XalanDocument* pXalanDoc = xercesParserLiaison.createDocument( doc
);
	XercesDocumentBridge* pDocBridge = xercesParserLiaison.mapDocument(
pXalanDoc );
	XalanNode* pXalanElement = pDocBridge->mapNode( node );
	// Our input sources...
	XSLTInputSource		theInputSource( pXalanElement);
	XSLTInputSource		theStylesheetSource("test.xsl");
	// Our output target...
	const XalanDOMString	theOutputFileName("output.xml");
	XSLTResultTarget		theResultTarget(theOutputFileName);
	int theResult = theXalanTransformer.transform(theInputSource,
theStylesheetSource, theResultTarget);

-- Melissa


RE: Converting a Xerces DOM_Node to XalanNode

Posted by Christian Aberger <Ch...@Aberger.at>.
Melissa,

there is a long, detailled discussion about this going on in this mailing
list currently under the title
"Working with DOM input and output destroyed,
XalanSourceTreeParserLiaison::createDocumenthas now void argument list.",
including a sample application. Please read this and reask if unclear points
remain.

wfR ChrisA