Ooops--the foo.xml generator does not have a type of "serverpages". Nix that.
:) Gene > -----Original Message----- > From: Gene Sohn [mailto:[EMAIL PROTECTED] > Sent: Tuesday, August 12, 2003 12:47 PM > To: [EMAIL PROTECTED] > Subject: dynamically generated xsp namespace issue with esql logicsheet > > > Hi, y'all, > > I am attempting to dynamically generate an xsp page in order to > use the esql > logicsheet to query the db. I am running into an interesting problem for > which I hope someone can provide an answer, but it also raises an > interesting question about logicsheets for me. > > Here's the relevant pipeline snippet: > > <map:match pattern="foo.xml"> > <map:generate src="data/foosource.xml" type="serverpages"/> > <map:transform src="styles/foo.xsl"/> > <map:serialize type="xml"/> > </map:match> > > <map:match pattern="foo.xsp"> > <map:generate src="cocoon:/foo.xml" type="serverpages"/> > <map:serialize type="xml"/> > </map:match> > > When I execute "foo.xsp", the foo.xml is generated from a > foosource.xml file > which is transformed by a foo.xsl stylesheet. The foo.xsl stylesheet > contains the namespace declarations for both xsp and esql in the top-level > xsl:stylesheet element: > > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:xsp="http://apache.org/xsp" > xmlns:esql="http://apache.org/cocoon/SQL/v2"> > . > . > . > </xsl:stylesheet> > > But the result of the foo.xml matcher "localizes" the namespace > declarations, which is proper behavior, I guess: > > <xsp:page xmlns:xsp="http://apache.org/xsp" language="java"> > <page> > <esql:connection xmlns:esql="http://apache.org/cocoon/SQL/v2"> > . > . > . > </esql:connection> > </page> > </xsp:page> > > The problem with this is that the esql logicsheet does useful stuff in the > xsp:page element (java declarations, etc). Therefore, unless I move the > esql namespace declaration to the xsp:page element (as follows), it won't > run: > > <xsp:page xmlns:esql="http://apache.org/cocoon/SQL/v2" > xmlns:xsp="http://apache.org/xsp" language="java"> > <page> > <esql:connection> > . > . > . > </esql:connection> > </page> > </xsp:page> > > Of course, I can't seem to get the transformer to produce this output. > > My questions: > > 1) Is there a way to have the transformer specify namespace declarations > where you want them, rather than automagically adding them at the most > "local" level they are needed? > > 2) Are logicsheets going to always have this "inherent" problem > of behaving > "outside" of their namespaces? To me, the foo.xml output is entirely > correct. Therefore, from a specification standpoint, I see an issue. > > 3) Is it just an esql logicsheet problem that can easily be > solved by moving > the xsp:page work into an esql: namespace element? I'm guessing so, but I > wouldn't mind hearing thoughts on this. > > 4) Is anyone else generating the content of xsp pages rather than having > them statically in files? I consider this to be quite a powerful idea at > some level, but I'm only doing this to use the esql logicsheet. > > 5) I'm aware of and can use the sql transformer as well, although I recall > seeing verbiage that it's deprecated. Any comments on whether > this is truly > deprecated or will be supported going forward, and its relative comparison > of functionality/behavior vis a vis the esql logicsheet? > > Whew! Thanks for reading! I look forward to any responses on this. Oh, > btw, I'm using 2.1m3, if that makes a difference. > > Thanks, > > Gene > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
