Internal error on schema aware xslt processing

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

Internal error on schema aware xslt processing

Patrik.Stellmann
Hi,

when I execute this (minimized) transformation


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
    <xsl:import-schema>
        <xs:schema xmlns:xs=
"http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
            <xs:element name="Element">
                <xs:complexType mixed="true"/>
            </xs:element>
        </xs:schema>
    </xsl:import-schema>
    <xsl:template match="schema-element(Element)">
        <xsl:apply-templates select="*"/>
    </xsl:template>
</xsl:stylesheet>


on this xml

<Element>Text</Element>

with Saxon EE 9.5.1.7 (from within Oxygen) I get this error message:

XSLT Processor Internal Error: java.lang.NullPointerException.


Of course the apply-templates makes no sense since there can't exist any child elements. But when generating such code (in my case from schematron rules) it is not that obvious.

I already got a work-around but it still might be worth fixing.

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:
Volker Sonnenburg
Heiko Beermann

------------------------------------------------------------------
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.


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
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: Internal error on schema aware xslt processing

Michael Kay
Thanks for reporting it. I've reproduced it and logged it here:


where you can track progress.

Michael Kay
Saxonica
+44 (0) 118 946 5893




On 7 Apr 2015, at 14:50, [hidden email] wrote:

Hi,

when I execute this (minimized) transformation


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
    <xsl:import-schema>
        <xs:schema xmlns:xs=
"http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
            <xs:element name="Element">
                <xs:complexType mixed="true"/>
            </xs:element>
        </xs:schema>
    </xsl:import-schema>
    <xsl:template match="schema-element(Element)">
        <xsl:apply-templates select="*"/>
    </xsl:template>
</xsl:stylesheet>


on this xml

<Element>Text</Element>

with Saxon EE 9.5.1.7 (from within Oxygen) I get this error message:

XSLT Processor Internal Error: java.lang.NullPointerException.


Of course the apply-templates makes no sense since there can't exist any child elements. But when generating such code (in my case from schematron rules) it is not that obvious.

I already got a work-around but it still might be worth fixing.

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:
Volker Sonnenburg
Heiko Beermann

------------------------------------------------------------------
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.


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help