[Home]  [List]  [News]  [Docs]  [FAQ]  [Downloads]  [Resources]  [About]
Search :
/Home /List

list4xt : Mailing list for the XT users community.

[list4xt] xt:document. I hit the wall.

Subject: [list4xt] xt:document. I hit the wall.
From: Paul Tchistopolskii (pault12@pacbell.net)
Date: 25/06/2000 - 07:42


Hello.

This is for those of us who are using XLSProcessorImpl in
SAXParser mode ( no OutputHandler attached ).

First I have to say that in XT we have '2 big parts' ( OM-based
and DOM-based ) and in OM-based part we again have
2 branches
    DocumentHandler based ( I call it SAXParser mode) and
    OutputMethodHandler based.

class XSLProcessorImpl

 public void setDocumentHandler(DocumentHandler handler) {
     documentHandler = handler;
     outputMethodHandler = null;
  }

 public void setOutputMethodHandler(OutputMethodHandler handler) {
     outputMethodHandler = handler;
     documentHandler = null;
  }

Setting one disables another.

Then this distinction is passed to ResultBase ( MultiNamespaceResult )
beast ( note 2 constructors of MultiNamespaceResult ).

The result is:

When running XSLProcessorImpl in SAXParser mode ( outputMethodHandler
is null ) - <xt:document will not work ( because :

class tr.DocumentAction {

 public void invoke(ProcessContext context, Node sourceNode, Result result) throws
XSLException {

 result = result.createResult(hrefExpr.eval(sourceNode, context));
 if (result != null) {
   result.start(outputMethod);
   content.invoke(context, sourceNode, result);
   result.end();
 }

( result is MultiNamespaceResult )

And:

class MultiNamespaceResult {

 public Result createResult(String uri) throws XSLException {
     if (outputMethodHandler != null) {
       OutputMethodHandler om = outputMethodHandler.createOutputMethodHandler(uri);
        ....
     }
 return null;
 }

This returns null in SAX Parser mode ( because outputMehodHandler was
not set 100 years ago ( MultiNamespaceResult gets created in the begining of
parse() )

At the moment I see no way to work this around without changing
XT code, so I'm now dropping all my <xt:document based things ....
( In UX I'm extremely abusing SAXParser mode )

It will be great to chnage this in the future bugfixed release of
XT ( if any ).

OK, OK, there could be different workarounds. One of them
is to get rid of DocumentHandler, replacing it with special atrificial
outputMethodHandler called SAXGeneratorHandler. ;-)

Rgds.Paul.

--
Mailing list for the XT users community.     (http://crescentprocessing.com)
(mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)



Archive générée par hypermail 2b28 le 06/11/2001 - 11:46 CET

webmaster@4xt.org


A site designed by Dyomedea