Search

I'm trying to output pure XML using XSLT -- the output page has to have the <?xml version='1.0' encoding='utf-8'?> declaration. But I can't add it twice in the output (it throws an "XML declaration allowed only at the start of the document" error) Is there a workaround?

<xsl:output method="xml"/> will add the declaration to the result document by default.

Check that you don't have the omit-xml-declaration attribute set to yes.

Thanks Egor! looks like that's done it.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details