You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Mingfei Peng <mf...@excite.com> on 2000/07/13 09:34:23 UTC

Problem with Xalan DOM output

I have run into a problem when I work with DOM output, my code is:
 
      XalanDocument* docOut = theParserLiaison.createDocument();
      XSLTResultTarget theResultTarget(docOut);
or
      XalanDocument* docOut = theParserLiaison.createDocument();
      FormatterToDOM* fToDOM = new
FormatterToDOM(docOut,(XalanElement*)NULL);
      FormatterListener* formatter =  fToDOM;   
      theResultTarget.setDocumentHandler(formatter);
 
They have the same effect, since the former also use FormatToDOM. 
The code works fine for most XSL/XML files, but when I use the code on the
attached files, I get a XalanDOMException, error code is 3, it means
"HIERARCHY_REQUEST_ERR" (defined in XalanDOMException.hpp). It is throwed in
xerces\c\src\dom\ParentNode.cpp
    THIS_CLASS::insertBefore(NodeImpl *newChild, NodeImpl *refChild);
line247.
 
But if I just use FormatToXML to replace FormatToDOM I can get the XSLT
result(index.html.avxslt.html). The "title"s are successfully retrieved via
document() function.
I use the Xalan 0.40 and Xerces 1.2. (XML input: index.html; XSL: j2se.xsl)
 
Is there any error with the code, or is it a problem of FormatToDOM? I copy
the code from Xalan Document (Basic usage patterns), but I cannot find
related samples in the sample projects.
 
 
Another question, where can I find the detail explanation of
XalanDOMException codes defined in XalanDOMException.hpp?
 
Thanks a lot.





_______________________________________________________
Say Bye to Slow Internet!
http://www.home.com/xinbox/signup.html