This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: NullPointerException


Norm,

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

Cheers,
Wendell

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>
>
>Norm
>
>Wendell Piez <wapiez@mulberrytech.com> 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,
> >Wendell
> >
> >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@ntlworld.com
> >>work: Michael.Kay@softwareag.com
> >>
> >> > -----Original Message-----
> >> > From: owner-xsl-list@lists.mulberrytech.com
> >> > [mailto:owner-xsl-list@lists.mulberrytech.com] On Behalf Of
> >> > normbishop1@netscape.net
> >> > Sent: 21 May 2002 00:13
> >> > To: xsl-list@lists.mulberrytech.com
> >> > 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@mulberrytech.com
> >Mulberry Technologies, Inc.                http://www.mulberrytech.com
> >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:  http://www.mulberrytech.com/xsl/xsl-list
> >
> >
>
>
>__________________________________________________________________
>Your favorite stores, helpful shopping tools and great gift ideas. 
>Experience the convenience of buying online with Shop@Netscape! 
>http://shopnow.netscape.com/
>
>Get your own FREE, personal Netscape Mail account today at 
>http://webmail.netscape.com/
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


======================================================================
Wendell Piez                            mailto:wapiez@mulberrytech.com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
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:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]