I believe I am using two different Processors (third party api intance, and my own instance). version i believe of BOTH is
Fix..use one Processor?


From: Michael Kay <mike@saxonica.com>
To: saxon-help@lists.sourceforge.net
Sent: Tuesday, March 20, 2012 10:03 AM
Subject: Re: [saxon] XsltTransformer and parameters

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="http://www.w3.org/2001/XMLSchema"
  <!--   <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 = builder.build(new StreamSource(reader));
            simpletrfm.setParameter(new QName("","mysamplexml"), doc);

I receive this exception:
java.lang.IllegalArgumentException: Unknown name code 1121
        at net.sf.saxon.om.NamePool.unknownNameCode(NamePool.java:834)
        at net.sf.saxon.om.NamePool.getDisplayName(NamePool.java:733)
        at net.sf.saxon.event.XMLEmitter.startElement(XMLEmitter.java:289)
        at net.sf.saxon.event.UncommittedSerializer.startElement(UncommittedSerializer.java:149)
        at net.sf.saxon.event.NamespaceReducer.startElement(NamespaceReducer.java:72)
        at net.sf.saxon.event.ComplexContentOutputter.startContent(ComplexContentOutputter.java:531)

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


This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
saxon-help mailing list archived at http://saxon.markmail.org/