> When I am using Xalan, I encounter a error: > The XML declaration may only appear at the very beginning of the document. > >I am sure that the style sheet is a well-defined XML document. The first line >is just an empty line. I test it on Microsoft's MSXML, it works.
MSXML is wrong. The XML declaration _MUST_ either start at the very first character of the document, or immediately after the Byte Order Mark if one is present. See http://www.w3.org/TR/REC-xml for formal grammar for a well-formed XML document. For general questions about XML syntax, such as this one, try the XML-DEV mailing list at http://xml.org
