cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject [c2] bugs in xsp engine
Date Wed, 11 Apr 2001 20:21:19 GMT
hey guys. i've been encountering some fun bugs in the c2 xsp engine. i'm
trying to work them down to their simplest cases, but it's not easy going.
basically, the namespace-based logicsheet application mechanism doesn't
work properly:

* if you fail to declare a logicsheet namespace that's not used in your
source xsp page, but only in a logicsheet it calls, that logicsheet is not
applied. i think this is a well known bug, is anyone working on it?

* xsp pages end up with many unnecessary SAX calls to startPrefixMapping
and endPrefixMapping. waste of cpu cycles, and it makes debugging painful.

* logicsheets which you do declare in your source xsp page and use in
another logicsheet aren't invoked consistently. fer instance, i have a
logicsheet that contains this snippet:

          <w:date><xsp:expr>date_format.format(new Date())</xsp:expr></w:date>
          <xsp:logic>
            if (<xsp-request:get-parameter name="randomize"/> == null) {
              <w:body-background-color>#999999</w:body-background-color>

the generated source code looks something like this:

this.contentHandler.startElement("http://intranet.webslingerZ.com/xml/site/v1",
                                       "date", "w:date", xspAttr);
      xspAttr.clear();
      XSPObjectHelper.xspExpr(contentHandler,
                              date_format.format(new Date()));
this.contentHandler.endElement("http://intranet.webslingerZ.com/xml/site/v1",
                                     "date", "w:date");
      this.contentHandler.endPrefixMapping("xsp");
      ... lots more endPrefixMappings - almost certainly unnecessary ...
      if (this.contentHandler.startPrefixMapping("xsp",
"http://apache.org/xsp");
          this.contentHandler.startPrefixMapping("xspdoc",
"http://apache.org/cocoon/XSPDoc/v1");
          this.contentHandler.startPrefixMapping("esql",
"http://apache.org/cocoon/SQL/v2");
          this.contentHandler.startPrefixMapping("w",
"http://intranet.webslingerZ.com/xml/site/v1");
          this.contentHandler.startPrefixMapping("wzi",
"http://intranet.webslingerZ.com/xml/xsp/v1");
          this.contentHandler.startPrefixMapping("xsp-cookie",
"http://apache.org/xsp/cookie");
          this.contentHandler.startPrefixMapping("xsp-request",
"http://apache.org/xsp/request");
          xspAttr.addAttribute("", "name", "name", "CDATA",
                               "randomize");
this.contentHandler.startElement("http://apache.org/xsp/request",
                                           "get-parameter",
"xsp-request:get-parameter",
                                           xspAttr);
          xspAttr.clear();

so as you can see, it's trying to create a literal result element
<xsp-request:get-parameter name="randomize"/>. i strongly suspect, of
course, that this is due to the request logicsheet being applied before
mine, and not being applied again afterwards, even though there are
elements in its namespace in the result tree. anyone have any plans to (or
ideas for) tackling this?

- donald


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message