You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Jon Smirl <jo...@mediaone.net> on 2000/06/07 18:44:17 UTC

Xalan-C - build DOM from parser

I'm try to build some simple apps to learn how the xalan-c API works. 
So for a sample I'm trying to parse a document into a tree....

XalanDocument* pDocument = theParserLiaison.createDocument();
FormatterToDOM* fToDOM = new FormatterToDOM(pDocument);
theParserLiaison.parseXMLStream(theTemplateSource, *fToDOM);

I'm running into trouble with: new FormatterToDOM();

the header file has:

 FormatterToDOM(
   XalanDocument*   doc,
   XalanDocumentFragment* docFrag = 0,
   XalanElement*   currentElement = 0);

and the implementation is:

FormatterToDOM::FormatterToDOM(
   XalanDocument*   doc,
   XalanDocumentFragment* docFrag,
   XalanElement*   currentElement) :
 FormatterListener(OUTPUT_METHOD_DOM),
 m_doc(doc),
 m_docFrag(docFrag),
 m_currentElem(currentElement),
 m_elemStack()
{
 assert(m_doc != 0 && m_docFrag != 0);
}

Isn't this always going to assert if there is a single parameter?

Jon Smirl
jonsmirl@mediaone.net