Project

Profile

Help

Saxon-HE 9.5 and getGlobalParameters

Added by Francesco Sblendorio over 11 years ago

Since some day ago, using Saxon HE 9.4.0.7 I used successfully the method "getGlobalParameters" of the class "XsltExecutable". The task is to get the parameters of an XSLT file.

When turned to Saxon HE 9.5.0.2, this method raised a NullPointerException. An example follows, working perfectly with version 9.4.0.7 but no (raising a NullPointerException) with version 9.5.0.2. Could someone help me in finding and solve this issue? Thanks in advance.


import java.io.*;
import java.util.*;
import javax.xml.transform.stream.*;
import net.sf.saxon.*;
import net.sf.saxon.s9api.*;
import org.junit.*;

public class GlobalParametersTest {

@Test
public void globalParametersTest() throws UnsupportedEncodingException, SaxonApiException {
        Configuration configuration = Configuration.newConfiguration();
        Processor processor = new Processor(configuration);
        XsltCompiler xsltCompiler = processor.newXsltCompiler();

        String source="" +
"                " +

"                " +
"                " +

"                " +
"                ";

        XsltExecutable xsltExecutable = xsltCompiler.compile(new StreamSource(new ByteArrayInputStream(source.getBytes("UTF-8"))));
        Map params = xsltExecutable.getGlobalParameters();

        System.out.println();
        int i=0;
        for (QName key: params.keySet()) {
            System.out.println("Parameter n."+(++i)+": "+key);
        }
        System.out.println();
    }
}

Following, here are segments of pom.xml respectively, with working and non-working version of Saxon-HE:


    
        net.sf.saxon
        Saxon-HE
        9.4.0.7
    

or


    
        net.sf.saxon
        Saxon-HE
        9.5.0.2
    

Replies (1)

RE: Saxon-HE 9.5 and getGlobalParameters - Added by O'Neil Delpratt over 11 years ago

Thanks Francesco for reporting the problem you have found. I have managed reproduced the exception with the Java program you sent. I have also logged the bug issue which you can keep track of the current progress, please see below:

https://saxonica.plan.io/issues/1791

Thanks and regards, O'Neil

    (1-1/1)

    Please register to reply