RE: [xsl] NullPointerException

Subject: RE: [xsl] NullPointerException
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 22 May 2002 11:39:32 -0400

This isn't well-formed because the attribute

test="contains(. ,'<sub>')"

contains in its value the '<' character.

The '<' character is reserved in XML as the open delimiter for a tag, and can't appear anywhere in content, including attribute values.

Not that this technique would work in any case, for the reasons I just described in an earlier post. (Accordingly, I'm not unhelpfully telling you here how you *would* represent that '<' character if you needed to....)


At 09:46 PM 5/21/2002, you wrote:
Thanks Wendell,

You are right! FOP NullPointerException errors are extremely unhelpful. I did try to create the xml page using the command line parser. This time it complained about that the xml file not being well-formed, even though the .fo file is. Not sure how that can happen. If I would remove the code below then every thing is fine. Does it make any sense to you?

<xsl:template match="node()"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:if test="contains(. ,'<sub>')"> <fo:inline baseline-shift="super" font-size=".75em"> <xsl:text>FOUND SUPER </xsl:text> </fo:inline> </xsl:if> </xsl:copy> </xsl:template>


Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> wrote:

>I've seen the NullPointerException as an (extremely unhelpful) error
>message when running FOP end-to-end (straight from input XML through to
>PDF) and there's either a parse error or a stylesheet runtime error. Rather
>than report the error delivered by the parser or processor, FOP just bags it.
>Norm, if this is what's happening to you, try running your transform
>separately from FOP to generate plain XML. You could use a different XSLT
>processor altogether to take advantage of its error messages.
>I hope that helps,
>At 03:55 AM 5/21/2002, Mike wrote:
>>A NullPointerException is a bug, either in the code you are calling or
>>in your own Java code. As it's occurring in FOP, use the technical
>>support list for the FOP product at Apache.
>>Michael Kay
>>Software AG
>>home: Michael.H.Kay@xxxxxxxxxxxx
>>work: Michael.Kay@xxxxxxxxxxxxxx
>> > -----Original Message-----
>> > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>> > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
>> > normbishop1@xxxxxxxxxxxx
>> > Sent: 21 May 2002 00:13
>> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>> > Subject: [xsl] NullPointerException
>> >
>> >
>> > Hello,
>> >
>> > I am using the following to search for any tag containing
>> > '<super>-15</super>' and take appropriate action. I've been
>> > getting NullPointerException.
>> > (org.apache.fop.apps.FOPException:
>> > java.lang.NullPointerException. Java exception occurred in
>> > call to method.)
>> > Don't know where to look for the error?
>Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx
>Mulberry Technologies, Inc.
>17 West Jefferson Street Direct Phone: 301/315-9635
>Suite 207 Phone: 301/315-9631
>Rockville, MD 20850 Fax: 301/315-8285
> Mulberry Technologies: A Consultancy Specializing in SGML and XML
> XSL-List info and archive:

Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape!

Get your own FREE, personal Netscape Mail account today at

XSL-List info and archive:

Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.      
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
  Mulberry Technologies: A Consultancy Specializing in SGML and XML

XSL-List info and archive:

Current Thread