NPE with expand-text and empty text element

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

NPE with expand-text and empty text element

Patrik.Stellmann
Hi,

with Saxon-EE 9.6.0.5 and the following template I get an NPE:

<xsl:stylesheet xmlns:xsl        = "http://www.w3.org/1999/XSL/Transform"
       version="3.0" expand-text="yes">
       
<xsl:template match="/">
               
<xsl:text/>
       
</xsl:template>
</xsl:stylesheet>

Background:
My original code was something like
        <xsl:text/>Line one: <xsl:value-of select="$Variable1"/> more text&#x0A;<xsl:text/>
       
<xsl:text/>Line two: <xsl:value-of select="$Variable2"/> more text<xsl:text/>
where I used <xsl:text/> to get rid of the indent whitespaces in the output.

Changing the xsl:value-of to text value templates caused the problem:
        <xsl:text/>Line one: {$Variable1} more text&#x0A;<xsl:text/>
       
<xsl:text/>Line two: {$Variable2} more text&#x0A;<xsl:text/>

However, since text value template (unlike xsl:value-of) can be used inside xsl:text I could solve the problem by changing it to:
       
<xsl:text>Line one: {$Variable1} more text&#x0A;</xsl:text>
        <xsl:text>Line two: {$Variable2} more text</xsl:text>


Regards,

Patrik

GDV Dienstleistungs-GmbH & Co. KG
Glockengießerwall 1
D-20095 Hamburg
www.gdv-dl.de

Sitz und Registergericht: Hamburg
HRA 93 894
USt.-IdNr : DE 205183123

Komplementärin:
GDV Beteiligungsgesellschaft mbH
Sitz und Registergericht: Hamburg
HRB 71 153

Geschäftsführer:
Dr. Jens Bartenwerfer
Michael Bathke
Heiko Beermann
Volker Sonnenburg

------------------------------------------------------------------
Diese E-Mail und alle Anhänge enthalten vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der E-Mail ist nicht gestattet.

This e-mail and any attached files may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distributionof the material in this e-mail is strictly forbidden.


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: NPE with expand-text and empty text element

O'Neil Delpratt
Hi Patrik,

Thank you for reporting the problem you have found. It is indeed a bug which we will investigate.

I have created a bug issue for you to track its progress:


kind regards,

O'Neil
On 15 Jul 2015, at 06:35, [hidden email] wrote:

Hi,

with Saxon-EE 9.6.0.5 and the following template I get an NPE:

<xsl:stylesheet xmlns:xsl        = "http://www.w3.org/1999/XSL/Transform"
       version="3.0" expand-text="yes">
       
<xsl:template match="/">
               
<xsl:text/>
       
</xsl:template>
</xsl:stylesheet>

Background:
My original code was something like
        <xsl:text/>Line one: <xsl:value-of select="$Variable1"/> more text&#x0A;<xsl:text/>
       
<xsl:text/>Line two: <xsl:value-of select="$Variable2"/> more text<xsl:text/>
where I used <xsl:text/> to get rid of the indent whitespaces in the output.

Changing the xsl:value-of to text value templates caused the problem:
        <xsl:text/>Line one: {$Variable1} more text&#x0A;<xsl:text/>
       
<xsl:text/>Line two: {$Variable2} more text&#x0A;<xsl:text/>

However, since text value template (unlike xsl:value-of) can be used inside xsl:text I could solve the problem by changing it to:
       
<xsl:text>Line one: {$Variable1} more text&#x0A;</xsl:text>
        <xsl:text>Line two: {$Variable2} more text</xsl:text>


Regards,

Patrik

GDV Dienstleistungs-GmbH & Co. KG
Glockengießerwall 1
D-20095 Hamburg
www.gdv-dl.de

Sitz und Registergericht: Hamburg
HRA 93 894
USt.-IdNr : DE 205183123

Komplementärin:
GDV Beteiligungsgesellschaft mbH
Sitz und Registergericht: Hamburg
HRB 71 153

Geschäftsführer:
Dr. Jens Bartenwerfer
Michael Bathke
Heiko Beermann
Volker Sonnenburg

------------------------------------------------------------------
Diese E-Mail und alle Anhänge enthalten vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der E-Mail ist nicht gestattet.

This e-mail and any attached files may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distributionof the material in this e-mail is strictly forbidden.


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help



-------------------------------
O'Neil Delpratt
Software Developer, Saxonica Limited 
Twitter: https://twitter.com/ond1
Tel: +44 118 946 5894
Web: http://www.saxonica.com
Saxonica Community site: http://dev.saxonica.com
Bug tracking site: https://saxonica.plan.io/




------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help