Here is the java:
 
package gov.irs.TFPOnlineProcessing;
 
import java.io.File;
 
import net.sf.saxon.s9api.Processor;
import net.sf.saxon.s9api.SaxonApiException;
import net.sf.saxon.s9api.Serializer;
import net.sf.saxon.s9api.XdmNode;
import net.sf.saxon.s9api.XsltCompiler;
import net.sf.saxon.s9api.XsltExecutable;
import net.sf.saxon.s9api.XsltTransformer;
 
public class SimpleTrans {
 
 /**
  * @param args
  */
 public static void main(String[] args) {
  // TODO Auto-generated method stub
  try {
  Processor proc = new Processor(false);
  XsltCompiler comp = proc.newXsltCompiler();
  XdmNode ss = proc.newDocumentBuilder().build(new File("c:/lib/xslt/tipx.xsl"));
  XsltExecutable exp = comp.compile(ss.asSource());
  XdmNode source = proc.newDocumentBuilder().build(new File("c:/p225.dxml"));
  Serializer out = new Serializer();
  //out.setOutputProperty(Serializer.Property.METHOD, "xml");
  out.setOutputFile(new File("c:/p225_chartest.xml"));
  XsltTransformer trans = exp.load();
  trans.setInitialContextNode(source);
  trans.setDestination(out);
  trans.transform();
  }
  catch (SaxonApiException sae) {
   sae.printStackTrace();
  }
 }
 
}


From: Michael Kay [mailto:mike@saxonica.com]
Sent: Tuesday, November 18, 2008 10:13 AM
To: 'Mailing list for the SAXON XSLT and XQuery processor'
Subject: Re: [saxon] Error using character maps

Can you start again, please, and show me what your Java code and stylesheet now look like. There must be some difference from the version I tested that I'm not seeing.
 
Michael Kay
http://www.saxonica.com/


From: Cuzner Stephen P [mailto:Stephen.P.Cuzner@irs.gov]
Sent: 18 November 2008 14:55
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] Error using character maps

I tried commenting out the  setOutputProperty line as you suggested, but I still get the same error message. Is there any additional information that I can provide to help debug?


From: Michael Kay [mailto:mike@saxonica.com]
Sent: Saturday, November 15, 2008 9:58 AM
To: 'Mailing list for the SAXON XSLT and XQuery processor'
Subject: Re: [saxon] (no subject)

Please try removing the line
 
out.setOutputProperty(Serializer.Property.METHOD, "xml");
Michael Kay
http://www.saxonica.com/


From: Cuzner Stephen P [mailto:Stephen.P.Cuzner@irs.gov]
Sent: 15 November 2008 14:34
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: [saxon] (no subject)

Thanks for the workaround, but it isn't working for me. Here is the significant part of my code:
 
package gov.irs.TFPOnlineProcessing;
 
import java.io.File;
 
import net.sf.saxon.s9api.Processor;
import net.sf.saxon.s9api.SaxonApiException;
import net.sf.saxon.s9api.Serializer;
import net.sf.saxon.s9api.XdmNode;
import net.sf.saxon.s9api.XsltCompiler;
import net.sf.saxon.s9api.XsltExecutable;
import net.sf.saxon.s9api.XsltTransformer;
 
public class SimpleTrans {
 
 public static void main(String[] args) {
  try {
  Processor proc = new Processor(false);
  XsltCompiler comp = proc.newXsltCompiler();
  XdmNode ss = proc.newDocumentBuilder().build(new File("c:/lib/xslt/tipx.xsl"));
  XsltExecutable exp = comp.compile(ss.asSource());
  XdmNode source = proc.newDocumentBuilder().build(new File("c:/p225.dxml"));
  Serializer out = new Serializer();
  out.setOutputProperty(Serializer.Property.METHOD, "xml");
  out.setOutputFile(new File("c:/p225_chartest.xml"));
  XsltTransformer trans = exp.load();
  trans.setInitialContextNode(source);
  trans.setDestination(out);
  trans.transform();
  }
  catch (SaxonApiException sae) {
   sae.printStackTrace();
  }
 }
 
}
My stylesheet starts with:
 
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:import href="common04.xsl"/>

    <xsl:import href="table.xsl"/>

    <xsl:output indent="yes" doctype-public="-//OASIS//DTD DocBook XML V4.2//EN" doctype-system="../../dtd/docbook.dtd" encoding="utf-8" omit-xml-declaration="no" version="1.0" use-character-maps="AccentureProblems"/>

    <xsl:character-map name="AccentureProblems">
        <xsl:output-character character="&#x2003;" string=" &amp;#x2003;" />
        <!-- ..... -->
    </xsl:character-map>

I've tried changing to use us-ascii as the encoding, but the black box that I'm supplying to seems to have problems with that, so I really need to encode as utf-8. With the class I've shown and the stylesheet given, I get the message "Cannot use character maps in an environment with no Controller".
 
Any ideas on what could be different here?
 
Steve