[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

extension functions - help needed

Subject: extension functions - help needed
From: "Jiang, Peiyun" <Peiyun.Jiang@xxxxxxxxxxxxxx>
Date: Tue, 14 Sep 2004 18:23:48 -0400
functions help
I need some help to figure out how extension functions work:
I'm using Xalan Java extension.  All set up is OK as I can use simple
functions.

The question is this: I'm converting a string to a NodeList
(processTextNode(string(.)) returns NodeList). The content of the NodeList
is a mix of text nodes and img tags.
i.e. This is a special char that will not display: <img
src="specialchar.gif" />. More text....

The function returns the right NodeList when tested in Java.  

Here is the XSLT:
<!-- text() node, do HTML string conversion -->
  <xsl:template match="text()">
       <xsl:copy-of select="cops:processTextNode(string(.))"/>
  </xsl:template>

Will this create a infinite loop (the returned nodes are processed again)?
Because I got out of memory error when I ran the conversion. How can I fix
it?

Note: the function may return null. I wonder if that's a problem.

********************
The real question is:

I have some strange characters in my docs that cannot be displayed properly
using HTML. I have to use images for them. How can I do the substitution in
XSLT?

I thought of 
(1) scanning the converted HTML to do the replacement, but most of the time
I don't have the special chars in my docs
(2) using SAX to convert the XML docs before doing XSLT, but need to modify
the DTD to include <img> that is not desirable

If you are doing similar conversion, please help!!!

********************

Thanks.

Peiyun Jiang

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.