Re: [docbook-apps] chunker.output.omit-xml-declaration Ineffective

From
Bob Stayton <>
Date
2007-02-15T17:24:29+00:00
ID
006601c75126$24564870$6400a8c0@totoro
Thread
Re: [docbook-apps] chunker.output.omit-xml-declaration Ineffective
Interesting.  This appears to be a "feature" 
of Saxon's saxon:output extension.  When the output encoding is set to the 
default XML encoding of UTF-8, Saxon works and omits the declaration.  When 
the output encoding is set to anything else, it outputs the xml 
declaration.  

 

I think Saxon is second guessing the user in this 
case, assuming that an XML file must have a declaration of its encoding if it is 
not the default XML encoding.  In other words, it is preventing you from 
generating XML output that has an incorrect encoding, since an XML file without 
an XML encoding declaration is interpreted as UTF-8, but in this case the actual 
character encoding is ISO-8859-1.  In one sense, this is the correct 
behavior, although a bit paternalistic.  8^)   xsltproc doesn't 
have this behavior.  

 

But I have to ask if you really want to generate 
incorrectly encoded files? I don't think browsers would be happy with 
them.

 

Bob Stayton
Sagehill Enterprises
DocBook Consulting


 

 

  
----- Original Message ----- 

  
From: 
  Miller, Ray 
  (Centech) 

  
To:  
  

  
Sent: Thursday, February 15, 2007 7:44 
  AM

  
Subject: RE: [docbook-apps] 
  chunker.output.omit-xml-declaration Ineffective

  

  

  

  
>> 
  I can't duplicate this 
  problem.  It works for me outside of Oxygen, using a customization that 
  only imports that stylesheet, includes your parameter setting, and 
  processing a version 5 document. None of the chunks have a declaration.  
  Any other details? 
  <<

  

  
 

  
Additional testing 
  indicates

  
 

  
<xsl:param 
  name="chunker.output.encoding" 
  select="'ISO-8859-1'"/>

  
 

  
invalidates

  
 

  
<xsl:param 
  name="chunker.output.omit-xml-declaration" 
  select="'yes'"/>

  
 

  
Ray