Re: [xsl] NullPointerException

Subject: Re: [xsl] NullPointerException
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 22 May 2002 13:37:09 -0400
Norm:

Maybe I'm completely confused here but if your source has:

<paragraph>This is some text <sub>including some subscripted text</sub> and then some more text</paragraph>

what you want is as simple as

<xsl:template match="paragraph">
  <fo:block>
    <xsl:apply-templates/>
  </fo:block>
</xsl:template>

<xsl:template match="sub">
  <fo:inline baseline-shift="sub">
    <xsl:apply-templates/>
  </fo:inline>
</xsl:template>

with adjustments for your target language (e.g. you haven't actually said you are targetting FO, I just guessed).

Now if your source has something more like

<paragraph>This is some text & l t ; sub & g t ; including some subscripted text & l t ; /sub & g t ; and then some more text</paragraph>

(Note I've introduced extra spaces to work around broken email clients that don't tolerate honest code.)

Then things are harder, since what you need is a string-processing language, and XSLT isn't designed for that. (You'd have to walk on your hands to do it.)

Which is your case?

Sorry to be a nuisance if I haven't understood (yet).

Regards,
Wendell


At 01:04 PM 5/22/2002, you wrote:



I did go through the xpath tutorial and I understand that well now. but, that does not help solve my problem. What I am trying to do is to find a way to do subscript and superscript of some text data. The node search code I mailed earlier does contain the proper &lt and &gt followed by a semicolon. ( the email system I am using is converting &lt to < and &gt to :( ). I am soooo lost and need your help very badly.

The string "<sub>" is not an attribute. It is a value of an element. OK! just forget what I have done. Pls tell me a way to do a subscript/superscript!!!!

THANK YOU

Norm



__________________________________________________________________
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@xxxxxxxxxxxxxxxx
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



Current Thread