This error suggests there is more than one NamePool around, probably because the DocumentBuilder used to build the document came from a different Processor than the one used to compile the stylesheet.

Saxon tries to stop this happening but doesn't always succeed. You haven't said which version of Saxon you are using. Each new version typically adds a couple of consistency checks in this area. The current version is

Michael Kay

On 20/03/2012 13:55, Paul M wrote:

Strange error occurring passing node as param

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="2.0" xmlns:xs=""
  <!--   <xsl:param name="mysamplexml" as="element()" required="yes"/> -->
  <xsl:param name="mysamplexml" as="node()" required="yes"/>
  <xsl:variable name="header">
    <tr>      <th>Element</th>      <th>Description</th>    </tr>
  <xsl:template match="/">
      <xsl:copy-of select="$mysamplexml//*"/>
      <xsl:copy-of select="$header//*"/>

    private static String exampleXML =
//                "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" +
            StringReader reader = new StringReader(exampleXML);
            XdmNode doc = StreamSource(reader));
            simpletrfm.setParameter(new QName("","mysamplexml"), doc);

I receive this exception:
java.lang.IllegalArgumentException: Unknown name code 1121
        at net.sf.saxon.event.XMLEmitter.startElement(
        at net.sf.saxon.event.UncommittedSerializer.startElement(
        at net.sf.saxon.event.NamespaceReducer.startElement(
        at net.sf.saxon.event.ComplexContentOutputter.startContent(

I know mysamplexml is passed as a document node, so not sure if I should pass it differently as well?