You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Sampo Ahokas <sa...@openttcn.fi> on 2009/08/31 16:58:03 UTC

xalanc: omit-xml-declaration is ignored if standalone=no is used

Hi all,

After upgrading from xalan-c 1.4 to the svn version we encountered a 
problem with omit-xml-declaration=yes being ignored when standalone=no 
is used.

The cause of this issue seems similar to what was mentioned in 
XALANC-442, which is marked as duplicate of XALANC-421. However the 
issue is still present svn HEAD as of today 28-AUG-2009.

In the transformed document, omit-xml-declaration=yes is ignored if the
standalone attribute is present, even if standalone=no. It seems to me
that the problem is in src/xalanc/XMLSupport/XalanXMLSerializerBase.cpp,
XalanXMLSerializerBase constructor where theStandalone.length() is checked:

   m_shouldWriteXMLHeader(xmlDecl == true ? true : theStandalone.length()
!= 0),

This forces writing the XML header always even if theStandalone == "no".

I have attached a patch that I used to fix the problem for us.

Best regards,
Sampo Ahokas
OpenTTCN Ltd