list4xt : Mailing list for the XT users community.[list4xt] String2RTF.Subject: [list4xt] String2RTF.User: Website From: Paul Tchistopolskii (pault12@pacbell.net)Date: 22/06/2000 - 08:18
Hello.
Here comes trivial 'missing link' for those who don't like
This is continuation of Eric's work published at 4xt.org,
Here we go.
------------------------- com.pault.pxsl.Str2RTF.java
package com.pault.pxsl;
import org.xml.sax.*;
import org.xml.sax.DocumentHandler;
/**
public Str2RTF(String s){ this.s = s; }
public static ResultTreeFragment convert(String s) {
public void emit(DocumentHandler handler) throws SAXException {
---------------- session.xsl
<xsl:stylesheet
<xsl:param name="UX-SERVLET-REQUEST"/>
<!-- Data to XML string -->
<xsl:variable name="_session"
<!-- String to RTF -->
<xsl:variable name="_rtf">
<!-- RTF to nodeset -->
<xsl:variable name="UX-SESSION" select="xt:node-set($_rtf)"/>
</xsl:stylesheet>
Java function dump_session_variables() returns the *string*
"<SESSION><SOME>DATA</SOME><HERE>AGAIN</HERE><SESSION>"
$UX-SERVLET-REQUEST is provided by Ux framework,
Rgds.Paul.
PS. Ux now has UNIX-alike sessions and file permissions, including
I first was thinking about changing the contents of your document, but
I mean, I think maybe you'l extend the document with this example,
If yes, I may also add :
/*
However, because it already works - let's not use Proxy for now.
public class Proxy extends org.xml.sax.HandlerBase {
private DocumentHandler h_to_pass = null;
Proxy( DocumentHandler htopass ) { super(); h_to_pass = htopass; }
public void startElement(String name, org.xml.sax.AttributeList attrs) throws
public void endElement(String name ) throws SAXException
public void characters(char[] ch, int start, int length) throws SAXException
*/
To use this fellow:
parser.setDocumentHandler( handler );
Should be changed to:
parser.setDocumentHandler( new Proxy(handler) );
Just for the sake of event filtering ;-)
Rgds.Paul.
-- (mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)
Archive générée par hypermail 2b28 le 06/11/2001 - 11:46 CET |