8.6 null pointer exception

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

8.6 null pointer exception

Owen Rees
The example below causes a null pointer exception with Saxon B 8.6, it
works with 8.5.1. The exception happens while the template is being
compiled so the data supplied to the transform is irrelevant.

This is a simplified extract from a much larger example in which the
exception was observed.

The exception goes away if you change the xsl:copy-of to an xsl:sequence.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
        <xsl:template match="/">
                <xsl:comment select="system-property('xsl:product-version')"/>
                <xsl:variable name="v-4" as="node()*"/>
                <xsl:variable name="v-2" as="node()*">
                        <xsl:choose>
                                <xsl:when test="exists($v-4/*)">
                                        <xsl:for-each select="$v-4/*[1]/*">
                                                <xsl:copy>
                                                        <xsl:copy-of select="@*"/>
                                                        <xsl:sequence select="*|text()"/>
                                                </xsl:copy>
                                        </xsl:for-each>
                                </xsl:when>
                        </xsl:choose>
                </xsl:variable>
                <xsl:sequence select="$v-2"/>
        </xsl:template>
</xsl:stylesheet>


--
Owen Rees
Hewlett Packard Laboratories, Bristol, UK




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Saxon8 on JRE?

Petter Høistad
Hello

Is it possible to run Saxon8 on JRE (Java Runtime Environment) or do you
have to use JDK?

I am just running Saxon to convert XML files to another XML format using dos
promt.

Regards
Petter Høistad




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: Saxon8 on JRE?

Martin Honnen-2


Petter Høistad wrote:

> Is it possible to run Saxon8 on JRE (Java Runtime Environment) or do you
> have to use JDK?

Sure, as long as the command line features/options
   <http://www.saxonica.com/documentation/using-xsl/commandline.html>
   <http://www.saxonica.com/documentation/using-xquery/commandline.html>
give you what you want you can use Saxon with the JRE.
Only if you wanted to write your own Java programs and use the Saxon
APIs you would need the SDK then to compile those Java programs.


--

        Martin Honnen
        http://JavaScript.FAQTs.com/


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

SV: Saxon8 on JRE?

Petter Høistad
Thanks!

Regards
Petter

-----Opprinnelig melding-----
Fra: [hidden email]
[mailto:[hidden email]] På vegne av Martin Honnen
Sendt: 7. november 2005 15:41
Til: [hidden email]
Emne: Re: [saxon] Saxon8 on JRE?



Petter Høistad wrote:

> Is it possible to run Saxon8 on JRE (Java Runtime Environment) or do you
> have to use JDK?

Sure, as long as the command line features/options
   <http://www.saxonica.com/documentation/using-xsl/commandline.html>
   <http://www.saxonica.com/documentation/using-xquery/commandline.html>
give you what you want you can use Saxon with the JRE.
Only if you wanted to write your own Java programs and use the Saxon
APIs you would need the SDK then to compile those Java programs.


--

        Martin Honnen
        http://JavaScript.FAQTs.com/


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help





-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: 8.6 null pointer exception

Michael Kay
In reply to this post by Owen Rees
Thanks for reporting this. I've logged the bug with a patch at

https://sourceforge.net/tracker/index.php?func=detail&aid=1350704&group_id=2
9872&atid=397617

This is on a suffiently common path that it's going to require a maintenance
release, sadly.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Owen Rees
> Sent: 07 November 2005 14:09
> To: [hidden email]
> Subject: [saxon] 8.6 null pointer exception
>
> The example below causes a null pointer exception with Saxon
> B 8.6, it
> works with 8.5.1. The exception happens while the template is being
> compiled so the data supplied to the transform is irrelevant.
>
> This is a simplified extract from a much larger example in which the
> exception was observed.
>
> The exception goes away if you change the xsl:copy-of to an
> xsl:sequence.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method="xml" version="1.0" encoding="UTF-8"
> indent="yes"/>
> <xsl:template match="/">
> <xsl:comment
> select="system-property('xsl:product-version')"/>
> <xsl:variable name="v-4" as="node()*"/>
> <xsl:variable name="v-2" as="node()*">
> <xsl:choose>
> <xsl:when test="exists($v-4/*)">
> <xsl:for-each
> select="$v-4/*[1]/*">
> <xsl:copy>
>
> <xsl:copy-of select="@*"/>
>
> <xsl:sequence select="*|text()"/>
> </xsl:copy>
> </xsl:for-each>
> </xsl:when>
> </xsl:choose>
> </xsl:variable>
> <xsl:sequence select="$v-2"/>
> </xsl:template>
> </xsl:stylesheet>
>
>
> --
> Owen Rees
> Hewlett Packard Laboratories, Bristol, UK
>
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App
> Server. Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> saxon-help mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help