Hello,

I recently built Xalan from Subversion (revision 659741) with VS2005.
It is built against Xerces 2.8.  With this combination of builds I can
reproduce a debug assertion using the sample 'TransformToXercesDOM'.
The sample works fine with the default birds.xml and birds.xsl, however
if I modify birds.xsl to have the below contents the debug build faults
with an assertion.  Below is a listing of birds.xsl, the program output,
and the stack as captured by VS2005.

---BEGIN-birds.xsl--------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet
version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<!-- Uncommenting eliminates assertion
<xsl:output method="xml" indent="yes"/> -->

<xsl:template match="/">
    <html><body></body></html>
</xsl:template>

</xsl:stylesheet>
---END-birds.xsl----------------------------------------------------

---BEGIN-Program-Output---------------------------------------------
C:\Temp\Xalan\trunk\Build\Win32\VC8\Debug>TransformToXercesDOM birds.xml
birds.xsl 
Assertion failed: theFormatter != 0 && theFormatter->getWriter() != 0,
file ..\..\..\..\src\xalanc\XSLT\XSLTEngineImpl.cpp, line 1568
---END-Program-Output-----------------------------------------------

---BEGIN-STACK-TRACE------------------------------------------------
        msvcr80d.dll!__NMSG_WRITE()  + 0x73 bytes       
        msvcr80d.dll!_abort()  + 0x2b bytes     
        msvcr80d.dll!__wassert()  + 0x2ef bytes 
>       Xalan-C_1_10D.dll!xalanc_1_10::XSLTEngineImpl::flushPending()
Line 1568 + 0x37 bytes  C++
 
Xalan-C_1_10D.dll!xalanc_1_10::XSLTEngineImpl::startElement(const
wchar_t * name=0x00994b00)  Line 1646   C++
 
Xalan-C_1_10D.dll!xalanc_1_10::StylesheetExecutionContextDefault::startE
lement(const wchar_t * name=0x00994b00)  Line 981       C++
 
Xalan-C_1_10D.dll!xalanc_1_10::ElemLiteralResult::startElement(xalanc_1_
10::StylesheetExecutionContext & executionContext={...})  Line 326 +
0x1f bytes      C++
 
Xalan-C_1_10D.dll!xalanc_1_10::ElemTemplateElement::execute(xalanc_1_10:
:StylesheetExecutionContext & executionContext={...})  Line 253 + 0x13
bytes   C++
 
Xalan-C_1_10D.dll!xalanc_1_10::StylesheetRoot::process(xalanc_1_10::Xala
nNode * sourceTree=0x0095fd00, xalanc_1_10::XSLTResultTarget &
outputTarget={...}, xalanc_1_10::StylesheetExecutionContext &
executionContext={...})  Line 263 + 0x13 bytes  C++
        Xalan-C_1_10D.dll!xalanc_1_10::XSLTEngineImpl::process(const
xalanc_1_10::XSLTInputSource & inputSource={...}, const
xalanc_1_10::XSLTInputSource & stylesheetSource={...},
xalanc_1_10::XSLTResultTarget & outputTarget={...},
xalanc_1_10::StylesheetConstructionContext & constructionContext={...},
xalanc_1_10::StylesheetExecutionContext & executionContext={...})  Line
354     C++
 
Xalan-C_1_10D.dll!xalanc_1_10::XalanTransformer::doTransform(const
xalanc_1_10::XalanParsedSource & theParsedXML={...}, const
xalanc_1_10::XalanCompiledStylesheet * theCompiledStylesheet=0x00000000,
const xalanc_1_10::XSLTInputSource * theStylesheetSource=0x0012fbac,
const xalanc_1_10::XSLTResultTarget & theResultTarget={...})  Line 1305
C++
        Xalan-C_1_10D.dll!xalanc_1_10::XalanTransformer::transform(const
xalanc_1_10::XalanParsedSource & theParsedXML={...}, const
xalanc_1_10::XSLTInputSource & theStylesheetSource={...}, const
xalanc_1_10::XSLTResultTarget & theResultTarget={...})  Line 178
C++
 
TransformToXercesDOM.exe!transformAndSerialize(xalanc_1_10::XalanTransfo
rmer & theTransformer={...}, const xalanc_1_10::XalanParsedSource &
theParsedSource={...}, const xalanc_1_10::XalanParsedSource &
theStylesheet={...})  Line 155 + 0x7b bytes     C++
        TransformToXercesDOM.exe!main(int argc=3, char * *
argv=0x003840b8)  Line 238 + 0x1a bytes C++
        TransformToXercesDOM.exe!__tmainCRTStartup()  Line 597 + 0x19
bytes   C
        TransformToXercesDOM.exe!mainCRTStartup()  Line 414     C
        [EMAIL PROTECTED]()  + 0x23 bytes       
---END-STACK-TRACE--------------------------------------------------

Producing the assertion failure seems to require not having an
xsl:output tag in the stylesheet while also using a root-level template
match.  I looked in the debugger and the assertion is failing because
the statement "theFormatter->getWriter()" is returning 0. 

I tried this example (birds.xml & modified birds.xsl) with another XSLT
engine and it worked as expected.  So I'm curious if this behavior is a
bug in Xalan or if perhaps there is alternate explanation.

Thank you for any assistance you can provide, 
Zach

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to